feat(library): render the list view when grouping by author or series - #925
Open
m4bard wants to merge 2 commits into
Open
feat(library): render the list view when grouping by author or series#925m4bard wants to merge 2 commits into
m4bard wants to merge 2 commits into
Conversation
Switching the library to list view while grouped by author or series rendered nothing. The grid branch was the only one that handled grouped collections, so the list branch fell through to the book list with no books to show. Render collection rows in list view too: a cover, the collection name, and the book count, with the header labelling the column Author or Series to match the grouping. A collection row carries three columns where a book row carries five, so both the header and the row need their own grid template. Both selectors have to out-rank the book row's rules, which appear later in this stylesheet. A bare .collection-list-item ties with .audiobook-list-item on specificity and loses on source order, which left the header at three columns and the rows it labels at five, so the two disagreed and the table looked collapsed. The row selector is .audiobook-list-item.collection-list-item so it wins on specificity rather than on position in the file. The cascade is not covered by a test. The suite runs in jsdom, which does not apply stylesheets, so a specificity regression here would not fail anything. The 13 existing tests for this view still pass and cover the rendering rather than the layout. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
m4bard
force-pushed
the
feat/595-grouped-list-view
branch
from
September 2, 2026 18:37
40eebeb to
a0e78e0
Compare
…d list Making the grid/list toggle work under a grouping exposed three things that assumed the grouped grid was the only markup a grouping could produce. observeAuthorCards reached for the cards through a selector naming the grid's own classes, so with the list showing it found nothing and no author cover was ever requested. Grouping by author in list view showed a placeholder for every author and never retried, unless the user happened to visit grid view first. The list rows now carry the same hook and the selector matches either layout. The two grouped branches are v-if siblings, so a layout switch destroys the observed nodes and mounts fresh ones. Nothing re-observed them: the groupedCollections watcher only fires when the names change, and they had not. A round trip through the list therefore left the grid unable to fetch a cover it had not already resolved. The view-mode watcher now re-observes. That watcher, and the one that persists the mode, were registered only by initializeVirtualScroller, which returns immediately when there is no scroll container. A grouped library has none, so a library that loads already grouped registered neither, and a mode chosen there was forgotten on the next load. They are now registered from onMounted, which is idempotent with the scroller's own call. This is what the pull request already claims to fix, in the opposite direction: it stopped a stored mode being ignored, and this stops a chosen mode never being stored. waitForImagesToLoad had the same grid-only assumption and waited on nothing. Each is pinned by a test that fails when the corresponding line is reverted. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #595.
The grid and list toggle does nothing under Authors or Series.
The grouped branch at
AudiobooksView.vue:213renders only.grouped-gridand never readsviewMode. TheviewModegate lives inside the ungrouped books branch. The toggle button still renders, so it looks operable and silently is not, and aviewModeoflistkept in localStorage is ignored the moment you switch grouping.This adds the list layout to the grouped branch. A collection row carries a cover, a name and a book count, so it reuses the book row's classes and overrides the grid template rather than inventing a second visual language for the same thing.
Both branches are gated now, so the two layouts cannot render at once.
Tests
Two, one per mode. The grid one is there so the pair cannot both pass against a component that ignored
viewModeand always rendered the list.Confirmed by pinning the grid branch to
v-if="true", which fails the list test and leaves the grid one green.Worked through with Claude Code at my direction. The claims above were checked by running them rather than by reading, and I reviewed this before posting.