Skip to content

feat(library): render the list view when grouping by author or series - #925

Open
m4bard wants to merge 2 commits into
Listenarrs:canaryfrom
m4bard:feat/595-grouped-list-view
Open

feat(library): render the list view when grouping by author or series#925
m4bard wants to merge 2 commits into
Listenarrs:canaryfrom
m4bard:feat/595-grouped-list-view

Conversation

@m4bard

@m4bard m4bard commented Sep 1, 2026

Copy link
Copy Markdown

Closes #595.

The grid and list toggle does nothing under Authors or Series.

The grouped branch at AudiobooksView.vue:213 renders only .grouped-grid and never reads viewMode. The viewMode gate lives inside the ungrouped books branch. The toggle button still renders, so it looks operable and silently is not, and a viewMode of list kept 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 viewMode and 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.

@m4bard
m4bard requested a review from a team September 1, 2026 03:30
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>
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] List view missing for ?group=authors and ?group=series

1 participant