Skip to content

Show ready / total book counts with quality-color cue on grouped collections#589

Draft
kevinheneveld wants to merge 2 commits into
Listenarrs:canaryfrom
kevinheneveld:feat/audiobooks-collection-ready-count
Draft

Show ready / total book counts with quality-color cue on grouped collections#589
kevinheneveld wants to merge 2 commits into
Listenarrs:canaryfrom
kevinheneveld:feat/audiobooks-collection-ready-count

Conversation

@kevinheneveld
Copy link
Copy Markdown

Summary

  • For audiobook collections grouped by author or series, the count column previously showed just the library total (e.g. 12 books). This adds a ready / total breakdown — `8 / 12 books` — where the numerator counts books with a playable file present (statuses quality-match or quality-mismatch).
  • The numerator is colored:
    • Green when every present file meets the quality profile.
    • Orange when at least one file is below the profile but still playable.
    • Neutral when no files are present yet.
  • Applied to both the new list-view row and the grid-card bottom placard (visible when item-details is enabled). The small corner count badge on grid cards stays as just the library total to keep the visual uncluttered.
  • Build/PR note: stacked on top of Add list view for grouped author/series in audiobooks library #585 (the list-view rendering for grouped collections). Add list view for grouped author/series in audiobooks library #585 should be merged first; otherwise the list-view template this PR colors doesn't exist yet.

Implementation notes

  • New per-collection fields on groupedCollections: readyCount and qualityMismatchCount. Computed inline by calling computeAudiobookStatus (the pure helper in fe/src/utils/audiobookStatus.ts).
  • qualityProfiles ref and activeDownloadAudiobookIds computed are moved earlier in the file so groupedCollections can depend on them. The status-cache computed (audiobookStatusById) declared further down stays where it is — groupedCollections calls the pure function directly to avoid a temporal-dead-zone error during initial watcher setup.
  • Colors reuse the existing #2ecc71 / #f39c12 palette from the audiobook-status legend.

Test plan

  • cd fe && npm run test:unit — 351 / 351 passing (351 new test asserts readyCount is populated from books-with-files data)
  • npx vue-tsc --noEmit -p tsconfig.app.json — clean
  • cd tests && dotnet test — passing (no backend changes)

Closes kevinheneveld#2

@kevinheneveld kevinheneveld requested a review from a team May 14, 2026 00:40
@kevinheneveld kevinheneveld marked this pull request as draft May 14, 2026 01:43
@kevinheneveld kevinheneveld force-pushed the feat/audiobooks-collection-ready-count branch from 647ae2b to 31b6c62 Compare May 17, 2026 22:43
@kevinheneveld kevinheneveld reopened this May 17, 2026
Kevin Heneveld added 2 commits May 19, 2026 08:13
The audiobooks toolbar exposes a list/grid toggle, but the grouped view
template only rendered a grid — toggling to list mode while grouped by
author or series was silently ignored. The list template only existed
inside the `groupBy === 'books'` branch.

This adds a parallel list rendering for grouped collections:
- Row per collection (cover thumb, name, book count)
- Clicking a row navigates to the collection page (matches grid behavior)
- Keyboard accessible (Enter / Space activate the row)

CSS reuses the existing `.audiobooks-list` / `.audiobook-list-item`
patterns; the row layout has its own three-column grid template
(cover / name / count) since collection rows don't carry status badges
or per-item actions.

Tests added for both authors and series groupings in list mode.

(cherry picked from commit 284cea4)
…e per collection

For grouped audiobook views (authors, series), the count column previously
showed just the library total. This adds a "ready / total" breakdown where
"ready" counts books that have a playable file (status quality-match or
quality-mismatch), with the numerator colored:
- green when every present file meets the quality profile
- orange when at least one file is sub-par but still playable
- neutral when no files are present yet

Applied to the list-view row and the grid-card bottom placard (visible when
showItemDetails is on). The small corner count badge stays as just the
library total to keep the visual uncluttered, per Kevin's request.

Implementation note: qualityProfiles and activeDownloadAudiobookIds were
moved above groupedCollections so the new per-collection counting can
call computeAudiobookStatus directly. Avoids a temporal-dead-zone error
during initial watcher setup that would otherwise hit the status-cache
computed declared further down the file.

Closes #2

(cherry picked from commit 647ae2b)
@kevinheneveld kevinheneveld force-pushed the feat/audiobooks-collection-ready-count branch from 0e4423c to 3492def Compare May 19, 2026 16:14
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] Show ready / total book count with quality-color cue for grouped author and series views

2 participants