Skip to content

feat(audiobooks): redesign audiobook library around resume and series progression - #116

Merged
Quick104 merged 2 commits into
mainfrom
claude/relaxed-boyd-2823c2
Jun 9, 2026
Merged

Quick104 merged 2 commits into
mainfrom
claude/relaxed-boyd-2823c2

Conversation

@Quick104

@Quick104 Quick104 commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Audiobook libraries reuse the video-shaped library page wholesale: a cinematic backdrop-carousel hero (audiobooks have square covers and no backdrops to fill it), default sections copied from the movie list, and a browse grid where the axes audiobook listeners actually navigate by — author, narrator, series — are buried as filters. The usage pattern is inverted from movies: ~90% of opens are "resume the book I'm in," and the next pick is driven by series order and author/narrator loyalty, not genre browsing.

Approach

Keep the Home / Library / Collections architecture; replace what fills it for audiobook libraries.

Home tab

  • The continue-listening section is now featured in audiobook library defaults and renders as a new NowListeningHero: a resume deck for the most recent in-progress book (square cover as blurred backdrop, ambient color from the cover, chapter position like "Chapter 32 of 75 · The Tower", hours left, one-click Resume), with the remaining in-progress books as the row beneath.
  • New next_in_series section type (backend + recipe registration): per series the profile has finished a book of, surface the lowest-indexed later book not yet started, ordered by most recent finish. Cards show a "Book N · Series Name" eyebrow. This is the audiobook equivalent of TV's On Deck.
  • Tab label is "Home" instead of "Recommended" for audiobook libraries.

Library tab

  • New Books / Series / Authors / Narrators browse axes (persisted via the existing type search param, mirroring the series-library Series/Episodes toggle).
  • Backed by a new GET /api/v1/catalog/audiobook-groups endpoint: groups by author/narrator/series with book count, total duration, per-profile in-progress/finished counts, and up to four poster URLs for cover stacks. Selecting a group drops into the Books grid with the matching author/narrator/series filter applied (names match case-insensitively, same semantics as the facet filters).

Migration

  • 20260609222830_audiobook_library_home_redesign.sql upgrades existing audiobook libraries: features the first continue-listening section (only when the admin hasn't already featured something) and inserts a next-in-series section after it (only when none exists). Fresh libraries get the new defaults from DefaultLibrarySectionsForType.

Shared cleanup

  • Chapter-list building, version→file mapping, and hr/min duration formatting extracted to web/src/lib/audiobooks/ and reused by AudiobookContent, NowListeningHero, and the continue cards (previously duplicated inline).
  • Audiobooks in continue rows now render as square covers (poster variant) instead of cropped 16:9, with "3 hr 2 min left" formatting.
  • useCatalogWindow gains an enabled option so grouped axis views don't fetch the books grid behind themselves.

Risks / follow-up

  • Client repos: next_in_series sections and the grouped browse endpoint are new client-visible API surface. silo-android and silo-apple need follow-up to render them; until then they should tolerate the unknown section type (it resolves like any other section).
  • next_in_series has no dismissal surface yet (next_up has one); can be added if "stop suggesting this series" demand shows up.
  • Series identity is keyed on LOWER(BTRIM(series_name)), consistent with the existing facet and filter behavior — books missing series_index are excluded from progression.
  • Pre-existing on main and untouched here: 15 frontend test failures and prettier drift in 19 files (verified failing at HEAD; tracked separately).

Testing

  • GOWORK=off go test ./internal/... passes (playback GPU-probe tests flake under parallel load on the dev Mac, pass in isolation — unrelated).
  • tsc -b, ESLint (0 errors), prettier on touched files, pnpm run build, and make verify-local-paths all clean.
  • Updated defaults_test.go, recipe_equivalence_test.go, libraryPageSearchParams.test.ts (axis round-trip + unknown-value fallback), LibraryBrowse.test.tsx.
  • No screenshots: implemented in a headless worktree against the design mockup; happy to attach once it's running on dev.

AI use

Implemented end-to-end by Claude (Fable 5) via Claude Code, from a design direction approved by the maintainer; design exploration, code, migration, and tests are AI-authored and locally verified as above.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Grouped audiobook browsing (author, narrator, series) with a dedicated browse view and pagination
    • "Next in Your Series" section showing next unread book in series you’ve started/finished
    • New "Now Listening" hero with chapter-aware resume controls and per-item listening-time display
    • Utilities for audiobook chapters/files and listening-time formatting
  • UI/UX Improvements

    • Audiobook library home redesign: featured continue-listening and reordered sections
    • Tab label and card display refinements for audiobook libraries
  • Tests

    • Updated audiobook-related tests and defaults to reflect new sections and behaviors

… progression

Audiobook libraries previously reused the video-shaped library page: a
backdrop carousel hero (audiobooks have square covers and no backdrops),
movie-style default sections, and a browse grid whose primary audiobook
axes (author, narrator, series) were buried as filters.

Backend:
- New next_in_series section type: surfaces the next unstarted book, by
  series_index, in series the profile has finished a book of, ordered by
  most recent finish. Registered as a library-staple recipe.
- New GET /api/v1/catalog/audiobook-groups endpoint: grouped browse by
  author/narrator/series with book count, total duration, per-profile
  progress counts, and poster URLs for cover stacks.
- Audiobook library defaults: continue-listening is featured (renders as
  the Now Listening hero) with next-in-series directly after it. A data
  migration upgrades existing audiobook libraries, skipping layouts where
  an admin already featured a section.

Frontend:
- NowListeningHero replaces HeroBanner for audiobook libraries: resume
  deck with chapter position, hours left, ambient color from the cover,
  and one-click resume; remaining in-progress books render as the
  Continue Listening row.
- Library tab gains Books/Series/Authors/Narrators browse axes persisted
  via the type param; selecting a group drops into the Books grid with
  the matching filter applied.
- "Recommended" tab is labeled "Home" for audiobook libraries; audiobook
  continue cards use square covers and hr/min time-left formatting.
- Shared audiobook chapter/file/duration helpers extracted to
  web/src/lib/audiobooks (deduplicated from AudiobookContent).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 008a8d45-94e2-49bf-8e56-40d17b64cec7

📥 Commits

Reviewing files that changed from the base of the PR and between ec4db6e and 0149c57.

📒 Files selected for processing (5)
  • internal/catalog/audiobook_next_repo.go
  • internal/sections/fetcher.go
  • migrations/sql/20260609222830_audiobook_library_home_redesign.sql
  • web/src/components/NowListeningHero.tsx
  • web/src/hooks/queries/audiobookGroups.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • web/src/hooks/queries/audiobookGroups.ts
  • migrations/sql/20260609222830_audiobook_library_home_redesign.sql
  • web/src/components/NowListeningHero.tsx
  • internal/sections/fetcher.go

📝 Walkthrough

Walkthrough

Adds grouped audiobook browsing (author/narrator/series), a next-in-series recommendation pipeline and section type, a DB migration to seed featured and next-in-series sections, shared audiobook utilities, UI components (NowListeningHero, AudiobookGroupsView), and routing/hooks to surface grouped and audiobook-first browse behavior.

Changes

Audiobook Library Home & Browse Redesign

Layer / File(s) Summary
API handler and response contracts
internal/api/handlers/audiobook_groups.go, internal/api/router.go
New GET /api/v1/catalog/audiobook-groups handler parses/validates query params, calls catalog.ListAudiobookGroups, presigns poster URLs, and returns grouped results with total.
Catalog: ListAudiobookGroups
internal/catalog/audiobook_groups.go
Implements grouping axes, query model, SQL composition for author/narrator/series grouping, aggregates counts/durations and in-progress/finished metrics, applies access filters, and paginates results with up to four poster paths per group.
Catalog: AudiobookNextRepository
internal/catalog/audiobook_next_repo.go
Repository to compute next unread audiobook per completed series using CTE + lateral query, with optional library scoping and result scanning into NextInSeriesResult.
API router & wiring
internal/api/router.go
Wires AudiobookNextRepository into section and recommendations fetchers and registers authenticated /catalog/audiobook-groups route.
Sections: next-in-series fetcher
internal/sections/fetcher.go
Adds Fetcher.AudiobookNextRepo, dispatch for SectionNextInSeries, and fetchNextInSeriesSection that resolves repo candidates to MediaItems, preserves repo order, truncates to item limit, and builds SectionItemMeta with series context and badges.
Section types, defaults, recipes, tests
internal/sections/types.go, internal/sections/defaults.go, internal/sections/recipes/library_staples.go, internal/sections/*_test.go
Adds SectionNextInSeries, marks continue-listening as featured for audiobook defaults, inserts Next in Series into default layout, registers a library staple, and updates tests accordingly.
DB migration
migrations/sql/20260609222830_audiobook_library_home_redesign.sql
Up migration marks first continue-listening as featured per audiobook library and inserts next_in_series rows; Down reverses inserts and featured flag changes.
Frontend audiobook utilities
web/src/lib/audiobooks/files.ts, web/src/lib/audiobooks/chapters.ts, web/src/lib/audiobooks/duration.ts
Utilities for mapping versions→files, flattening chapters with absolute offsets, finding chapter by time, summing durations, and formatting listening time left.
Frontend API types & hooks
web/src/api/types.ts, web/src/hooks/queries/audiobookGroups.ts, web/src/hooks/queries/keys.ts, web/src/hooks/queries/catalog.ts
Adds TS types for grouped responses, paginated fetchAudiobookGroups, useAudiobookGroups hook, query key factory, and support for gating catalog page fetches with enabled flag.
AudiobookGroupsView component
web/src/components/audiobooks/AudiobookGroupsView.tsx
New grouped browse UI with sort/filter, series grid or author/narrator rows, and CoverStack for poster stacks with initials fallback.
NowListeningHero & integrations
web/src/components/NowListeningHero.tsx, web/src/components/LibraryHeader.tsx, web/src/pages/LibraryRecommended.tsx
NowListeningHero renders featured continue-listening audiobook with progress/chapter/time-left and resume controls; LibraryHeader/LibraryRecommended adjusted to render audiobook-specific hero and tab label.
Section item & row rendering updates
web/src/components/ContinueWatchingCard.tsx, web/src/components/SectionItemCard.tsx, web/src/components/SectionRow.tsx
ContinueWatchingCard uses audiobook time-left formatter; SectionItemCard shows next_in_series series line + Book N badge; SectionRow treats audiobooks as poster-safe.
Library browse axes & search params
web/src/pages/libraryPageSearchParams.ts, web/src/pages/libraryPageSearchParams.test.ts
Extends LibraryBrowseType with audiobook axes (books/authors/narrators), adds axis parsing/writing helpers, and updates tests for axis round-trip and defaults.
LibraryBrowse page & routing
web/src/pages/LibraryBrowse.tsx, web/src/pages/LibraryBrowse.test.tsx
Adds AudiobookAxisTabs, disables catalog query for grouped axes, renders AudiobookGroupsView for grouped axes, and routes group selection into onBrowseTypeChange with an optional QueryDefinition override.
LibraryPage integration
web/src/pages/LibraryPage.tsx
Updates handleBrowseTypeChange to accept optional QueryDefinition override and threads libraryType to header/recommended components.
AudiobookContent refactor
web/src/pages/ItemDetail/AudiobookContent.tsx
Refactors to use shared audiobook utilities for files, chapters, and duration calculations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Silo-Server/silo-server#96: Modifies audiobook continue-listening/section handling; shares overlap with section defaults and continue-listening behaviors.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 34.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: redesigning the audiobook library UI to emphasize resume and series progression, which is the main focus across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/relaxed-boyd-2823c2

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec4db6edb3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/catalog/audiobook_next_repo.go Outdated
Comment on lines +99 to +100
ORDER BY fs.last_finished_at DESC
LIMIT $3`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply library scoping before limiting next-in-series candidates

For library-scoped audiobook sections, this LIMIT is applied to the user's global recently finished series before fetchNextInSeriesSection resolves and filters those content IDs to the requested library. If a profile has many more-recent finished series in another audiobook library, those candidates consume the capped result set and the current library can render an empty or truncated “Next in Your Series” row even though it has valid next books. Push the library/access filter into this query or continue fetching until enough candidates survive the library filter.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0149c57 — library scoping (library id / allowed ids / disabled ids) is now pushed into the candidate query's LATERAL via NextInSeriesQuery, so candidates from other libraries no longer consume the limit. The 3× over-fetch remains only to cover post-resolution content-rating filtering.

Comment on lines +21 to +22
sort,
limit: String(GROUPS_FETCH_LIMIT),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Page or search audiobook groups beyond the first 500

This hard-coded fetch limit means the UI only ever receives the first 500 groups for an axis, and AudiobookGroupsView filters that partial list client-side. In libraries with more than 500 authors/narrators/series, groups after the first page cannot be displayed or found by the filter box even though the API reports a larger total. Add pagination/offset handling or a server-side search parameter before filtering locally.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0149c57 — fetchAudiobookGroups now pages through the endpoint (500/page) until the server-reported total is reached, bounded at 20 pages, so the client-side filter box sees the complete list.

Comment on lines +109 to +118
UPDATE page_sections ps
SET featured = FALSE,
updated_at = NOW()
FROM media_folders mf
WHERE ps.scope = 'library'
AND ps.library_id = mf.id
AND lower(mf.type) IN ('audiobook', 'audiobooks')
AND ps.section_type = 'continue_watching'
AND ps.config->>'continue_type' = 'listening'
AND ps.featured;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve preexisting featured sections on rollback

The down migration clears every featured continue-listening section in audiobook libraries, not just rows that this migration changed. If an admin already had Continue Listening featured before the upgrade (or featured it after), rolling back silently removes their library hero state. Track the rows updated by the up migration or restrict the down step so preexisting/admin-set featured values are preserved.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0149c57 — the Up now writes marker keys into config (featured_by_migration on the row it features, seeded_by_migration on the row it inserts) and the Down reverts only marked rows, so pre-existing/admin-set featured state and hand-created next_in_series sections survive a rollback. The migration is unreleased, so amending it in place is safe.

Comment on lines +48 to +50
const files = useMemo(
() => (detail?.type === "audiobook" ? audiobookFilesFromVersions(detail.versions) : []),
[detail],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore stale detail data before starting hero playback

useCatalogItemDetail keeps previous data while a new deck.content_id is loading, but this memo accepts any audiobook detail as the file list for the current deck. After switching libraries or after the featured item changes, clicking Resume before the new detail fetch completes can call startPlayback with the new contentId but the previous book's files/credits. Gate the detail-derived files and metadata on detail.content_id === deck.content_id before using them.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0149c57 — detail-derived files/credits/progress are now gated on fetchedDetail.content_id === deck.content_id, so a Resume click during a deck change falls through to the detail-page link (?play=1) instead of starting playback with the previous book's files.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
web/src/hooks/queries/audiobookGroups.ts (1)

1-40: ⚡ Quick win

Rename this hook module to follow the hook filename convention.

web/src/hooks/queries/audiobookGroups.ts exports useAudiobookGroups; naming it useAudiobookGroups.ts would align with the repository hook convention and improve discoverability.

As per coding guidelines, web/src/hooks/**/*.ts: “Use useThing.ts naming convention for React hooks.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/hooks/queries/audiobookGroups.ts` around lines 1 - 40, The file is
misnamed for a React hook module; rename the module to useAudiobookGroups.ts to
match the repository hook filename convention, keep the exported symbols
(useAudiobookGroups and fetchAudiobookGroups) unchanged, and update any
imports/exports that currently reference audiobookGroups.ts (including any
barrels or re-exports) so they point to useAudiobookGroups.ts to avoid broken
imports.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@migrations/sql/20260609222830_audiobook_library_home_redesign.sql`:
- Around line 102-118: The Down migration currently DELETEs from page_sections
and UPDATEs featured for all audiobook libraries (queries referencing
page_sections ps and media_folders mf), which can clobber pre-existing data;
change these statements to only target rows that this migration previously
created/modified by filtering on a migration marker stored in
page_sections.config (e.g., a specific key/value like config->>'migrated_by' =
'20260609222830_audiobook_library_home_redesign' or similar). Update the DELETE
and UPDATE WHERE clauses to join on media_folders as before but also require
that ps.config contains that migration marker so only rows touched by the Up are
removed/reverted, and ensure the revert restores any changed flags only for
those marked rows.

In `@web/src/components/audiobooks/AudiobookGroupsView.tsx`:
- Around line 127-129: The initial sort state in AudiobookGroupsView is set once
and won't change when groupBy changes; add a useEffect that watches groupBy and
calls setSort(groupBy === "series" ? "name" : "count") so the sort state resets
to the intended default whenever groupBy changes (referencing the sort and
setSort state variables and the groupBy prop).

In `@web/src/hooks/queries/audiobookGroups.ts`:
- Around line 10-24: The hard cap GROUPS_FETCH_LIMIT (500) in
fetchAudiobookGroups prevents fetching more than 500 groups; change the function
to accept an optional limit parameter (or read limit from options) instead of
always using GROUPS_FETCH_LIMIT, and pass that value into the URLSearchParams so
callers can request larger pages or server-driven pagination; update the
function signature (fetchAudiobookGroups) and its callers to provide a limit or
to handle server pagination/continuation tokens as needed.

---

Nitpick comments:
In `@web/src/hooks/queries/audiobookGroups.ts`:
- Around line 1-40: The file is misnamed for a React hook module; rename the
module to useAudiobookGroups.ts to match the repository hook filename
convention, keep the exported symbols (useAudiobookGroups and
fetchAudiobookGroups) unchanged, and update any imports/exports that currently
reference audiobookGroups.ts (including any barrels or re-exports) so they point
to useAudiobookGroups.ts to avoid broken imports.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d6249d9-5613-459c-a834-c186f20bbd7f

📥 Commits

Reviewing files that changed from the base of the PR and between 7040fa4 and ec4db6e.

📒 Files selected for processing (32)
  • internal/api/handlers/audiobook_groups.go
  • internal/api/router.go
  • internal/catalog/audiobook_groups.go
  • internal/catalog/audiobook_next_repo.go
  • internal/sections/defaults.go
  • internal/sections/defaults_test.go
  • internal/sections/fetcher.go
  • internal/sections/recipe_equivalence_test.go
  • internal/sections/recipes/library_staples.go
  • internal/sections/types.go
  • migrations/sql/20260609222830_audiobook_library_home_redesign.sql
  • web/src/api/types.ts
  • web/src/components/ContinueWatchingCard.tsx
  • web/src/components/LibraryHeader.tsx
  • web/src/components/NowListeningHero.tsx
  • web/src/components/SectionItemCard.tsx
  • web/src/components/SectionRow.tsx
  • web/src/components/audiobooks/AudiobookGroupsView.tsx
  • web/src/hooks/queries/audiobookGroups.ts
  • web/src/hooks/queries/catalog.ts
  • web/src/hooks/queries/keys.ts
  • web/src/lib/audiobooks/chapters.ts
  • web/src/lib/audiobooks/duration.ts
  • web/src/lib/audiobooks/files.ts
  • web/src/lib/sectionTypes.ts
  • web/src/pages/ItemDetail/AudiobookContent.tsx
  • web/src/pages/LibraryBrowse.test.tsx
  • web/src/pages/LibraryBrowse.tsx
  • web/src/pages/LibraryPage.tsx
  • web/src/pages/LibraryRecommended.tsx
  • web/src/pages/libraryPageSearchParams.test.ts
  • web/src/pages/libraryPageSearchParams.ts

- Push library scoping into the next-in-series candidate SQL so finished
  series whose next book lives in another library can't consume the
  candidate limit and starve a library-scoped section (Codex P2).
- Paginate the audiobook groups fetch until the server-reported total is
  reached (500/page, 20-page bound) so client-side filtering sees the
  complete author/narrator/series list (Codex P2, CodeRabbit).
- Make the redesign migration rollback-safe: rows the Up touches carry
  config markers (featured_by_migration / seeded_by_migration) and the
  Down reverts only marked rows, leaving admin-set featured state and
  hand-created next_in_series sections alone (Codex P2, CodeRabbit).
- Gate NowListeningHero's detail-derived files/credits on the detail
  matching the deck item, so Resume can't start the new book with the
  previous book's files while keepPreviousData shows stale detail
  (Codex P2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Quick104

Quick104 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review in 0149c57: next-in-series candidates are now library-scoped in SQL, the groups fetch pages past 500, the migration Down only reverts rows the Up marked, and NowListeningHero ignores stale keepPreviousData detail before starting playback.

Two findings intentionally not changed:

  • Sort default on axis change (CodeRabbit): already reset via key={groupedAxis} remount in LibraryBrowse — replied inline.
  • Rename hooks/queries/audiobookGroups.ts → useAudiobookGroups.ts (CodeRabbit nitpick): the useThing.ts convention applies to web/src/hooks/* proper; the hooks/queries/ directory consistently uses domain-named modules (catalog.ts, libraries.ts, progress.ts, sections.ts…) that export multiple fetchers + hooks, so the new file follows its siblings.

Verified after the changes: GOWORK=off go test ./internal/sections/... ./internal/catalog/..., golangci-lint v2 (no findings in changed files), tsc -b, ESLint, prettier, and the library page vitest suites all pass.

@Quick104
Quick104 merged commit b7e0d04 into main Jun 9, 2026
20 checks passed
@Quick104
Quick104 deleted the claude/relaxed-boyd-2823c2 branch June 9, 2026 23:28
Quick104 added a commit that referenced this pull request Jun 11, 2026
… progression (#116)

* feat(audiobooks): redesign audiobook library around resume and series progression

Audiobook libraries previously reused the video-shaped library page: a
backdrop carousel hero (audiobooks have square covers and no backdrops),
movie-style default sections, and a browse grid whose primary audiobook
axes (author, narrator, series) were buried as filters.

Backend:
- New next_in_series section type: surfaces the next unstarted book, by
  series_index, in series the profile has finished a book of, ordered by
  most recent finish. Registered as a library-staple recipe.
- New GET /api/v1/catalog/audiobook-groups endpoint: grouped browse by
  author/narrator/series with book count, total duration, per-profile
  progress counts, and poster URLs for cover stacks.
- Audiobook library defaults: continue-listening is featured (renders as
  the Now Listening hero) with next-in-series directly after it. A data
  migration upgrades existing audiobook libraries, skipping layouts where
  an admin already featured a section.

Frontend:
- NowListeningHero replaces HeroBanner for audiobook libraries: resume
  deck with chapter position, hours left, ambient color from the cover,
  and one-click resume; remaining in-progress books render as the
  Continue Listening row.
- Library tab gains Books/Series/Authors/Narrators browse axes persisted
  via the type param; selecting a group drops into the Books grid with
  the matching filter applied.
- "Recommended" tab is labeled "Home" for audiobook libraries; audiobook
  continue cards use square covers and hr/min time-left formatting.
- Shared audiobook chapter/file/duration helpers extracted to
  web/src/lib/audiobooks (deduplicated from AudiobookContent).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(audiobooks): address review feedback on library redesign

- Push library scoping into the next-in-series candidate SQL so finished
  series whose next book lives in another library can't consume the
  candidate limit and starve a library-scoped section (Codex P2).
- Paginate the audiobook groups fetch until the server-reported total is
  reached (500/page, 20-page bound) so client-side filtering sees the
  complete author/narrator/series list (Codex P2, CodeRabbit).
- Make the redesign migration rollback-safe: rows the Up touches carry
  config markers (featured_by_migration / seeded_by_migration) and the
  Down reverts only marked rows, leaving admin-set featured state and
  hand-created next_in_series sections alone (Codex P2, CodeRabbit).
- Gate NowListeningHero's detail-derived files/credits on the detail
  matching the deck item, so Resume can't start the new book with the
  previous book's files while keepPreviousData shows stale detail
  (Codex P2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Quick104 added a commit that referenced this pull request Jun 17, 2026
… progression (#116)

* feat(audiobooks): redesign audiobook library around resume and series progression

Audiobook libraries previously reused the video-shaped library page: a
backdrop carousel hero (audiobooks have square covers and no backdrops),
movie-style default sections, and a browse grid whose primary audiobook
axes (author, narrator, series) were buried as filters.

Backend:
- New next_in_series section type: surfaces the next unstarted book, by
  series_index, in series the profile has finished a book of, ordered by
  most recent finish. Registered as a library-staple recipe.
- New GET /api/v1/catalog/audiobook-groups endpoint: grouped browse by
  author/narrator/series with book count, total duration, per-profile
  progress counts, and poster URLs for cover stacks.
- Audiobook library defaults: continue-listening is featured (renders as
  the Now Listening hero) with next-in-series directly after it. A data
  migration upgrades existing audiobook libraries, skipping layouts where
  an admin already featured a section.

Frontend:
- NowListeningHero replaces HeroBanner for audiobook libraries: resume
  deck with chapter position, hours left, ambient color from the cover,
  and one-click resume; remaining in-progress books render as the
  Continue Listening row.
- Library tab gains Books/Series/Authors/Narrators browse axes persisted
  via the type param; selecting a group drops into the Books grid with
  the matching filter applied.
- "Recommended" tab is labeled "Home" for audiobook libraries; audiobook
  continue cards use square covers and hr/min time-left formatting.
- Shared audiobook chapter/file/duration helpers extracted to
  web/src/lib/audiobooks (deduplicated from AudiobookContent).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(audiobooks): address review feedback on library redesign

- Push library scoping into the next-in-series candidate SQL so finished
  series whose next book lives in another library can't consume the
  candidate limit and starve a library-scoped section (Codex P2).
- Paginate the audiobook groups fetch until the server-reported total is
  reached (500/page, 20-page bound) so client-side filtering sees the
  complete author/narrator/series list (Codex P2, CodeRabbit).
- Make the redesign migration rollback-safe: rows the Up touches carry
  config markers (featured_by_migration / seeded_by_migration) and the
  Down reverts only marked rows, leaving admin-set featured state and
  hand-created next_in_series sections alone (Codex P2, CodeRabbit).
- Gate NowListeningHero's detail-derived files/credits on the detail
  matching the deck item, so Resume can't start the new book with the
  previous book's files while keepPreviousData shows stale detail
  (Codex P2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Quick104 added a commit to Rhainland/silo-server that referenced this pull request Oct 9, 2026
Resolves GHSA-68fv-2mgg-jv7q (Dependabot alert Silo-Server#116). postcss,
@tailwindcss/node and css-tree all accept ^1.2.1, so only the
resolved version and integrity change; no override is needed.

Co-Authored-By: Claude Opus 5.5 <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.

1 participant