Repository navigation
feat(sections): rework the default home rows - #2286
Conversation
Fresh installs and Restore Defaults now get one Recently Added row for all movie and TV libraries instead of two rows per library. New episodes of a show already in the library still bring the show to the top: TV libraries use arrival-event grouping and the merged row interleaves them with movies by added time. The home defaults add Recommended for You, Because You Watched, Returning Shows, Trending This Week (TMDB), and Top Rated, which replaces Trending on Server. Default rows and admin rows created without a limit show 100 items. TV library pages gain Returning Shows. A movie or TV library created later no longer adds its own home rows when home already has a shared Recently Added row. Book, audiobook, and manga libraries keep their per-library rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue remains in the reviewed changes. Normal checks can proceed before merging. Pre-merge checks |
|
|
The Evidence section describes the before/after rows but contains no captures. Please attach or publish same-data before/after Home screenshots at desktop and phone width, showing the shared Recently Added row and new defaults, plus the TV library page's Returning Shows row. Name the builds used; if a surface is unaffected, explain why. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02422441de
ℹ️ 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".
- Skip per-library Recently Added rows for a new video library only when the shared row is enabled. - Keep audiobook, ebook, manga, and podcast default rows at 20 items; those beta surfaces stay as they were. - Limit a configured mixed row's TV libraries to the caller's scope. - Report one more card in total_count only when a card outside the page exists after deduplication. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bac075206c
ℹ️ 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".
| if sec.ItemLimit <= 0 { | ||
| sec.ItemLimit = 20 | ||
| sec.ItemLimit = sections.DefaultItemLimit |
There was a problem hiding this comment.
Preserve the v1 omitted-limit default
HandleCreateSection serves POST /api/v1/admin/sections and calls this service, so a v1 request that omits item_limit now persists 100 instead of the previous 20, changing both the response and subsequent row payload size on the frozen bridge contract. Keep the v1 default at 20 and apply the new default only through a v2-specific path; the bulk-create fallback has the same issue.
AGENTS.md reference: AGENTS.md:L226-L238
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this. Neither the v1 routes nor the v2 admin schemas document a default for an omitted item_limit (v2's AdminSection item_limit is omitempty, minimum 0, with no stated default), so the server-chosen value isn't part of either contract. v1 and v2 also share one admin service and one set of stored rows. Splitting the default by API version would let the same request store different rows depending on the route, with no client-visible contract gained. Response shapes and validation (max 500) are unchanged.
| &PageSection{ID: idRecommendedForYou, Scope: scopeHome, SectionType: SectionRecommendedForYou, Title: titleRecommendedForYou, ItemLimit: DefaultItemLimit, Config: json.RawMessage(`{}`), Enabled: true}, | ||
| &PageSection{ID: "default-because-you-watched", Scope: scopeHome, SectionType: SectionBecauseYouWatched, Title: defaultBecauseWatchedTitle, ItemLimit: DefaultItemLimit, Config: json.RawMessage(`{}`), Enabled: true}, |
There was a problem hiding this comment.
Keep personalized home defaults from surfacing books
On a fresh install or after Restore Defaults, these unscoped rows consume recommendation caches that explicitly admit audiobook and ebook candidates (internal/recommendations/repo.go:95-100), so book content can now appear in two new default home rows. That changes the deferred beta surfaces despite the separate 20-item fixes; either restrict these defaults to video candidates or avoid adding them where they can expose book recommendations.
AGENTS.md reference: AGENTS.md:L30-L35
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Leaving this as is. Recommendations include audiobook and ebook candidates on purpose (recommendations/repo.go), and those rows already show the same candidates wherever an admin adds them. This PR doesn't change what the recommendation rows return; it only puts the existing rows on the default home. Not filtering them doesn't touch the beta book features, which the policy is about ("do not gate, remove, or rework"). Restricting recommendation types for the home default would be a new recommendation behavior, which belongs in its own change if the maintainers want it.
Intersecting a mixed recently-added row's configured libraries with the caller's scope dropped items that belong to a configured library and, separately, to a library in scope. The plain query checks the two as separate memberships, so the non-TV side goes back to the configured libraries and only the TV event query, which reads the libraries it is given, is limited to the caller's scope. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e9267c084
ℹ️ 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".
| }) | ||
| result = append(result, &PageSection{ID: idContinueListening, Scope: scopeHome, SectionType: SectionContinueWatching, Title: titleContinueListening, ItemLimit: betaLibraryItemLimit, Config: ContinueTypeConfig(ContinueTypeListening), Enabled: true}) | ||
| } | ||
| result = append(result, &PageSection{ID: idRecentlyAdded, Scope: scopeHome, SectionType: SectionRecentlyAdded, Title: titleRecentlyAdded, ItemLimit: DefaultItemLimit, Config: defaultMediaScopeConfig(catalog.MediaScopeVideo), Enabled: true}) |
There was a problem hiding this comment.
Keep the new default row set off v1
DefaultHomeSections also supplies the fallback for GET /api/v1/home/* and the payload persisted by POST /api/v1/admin/sections/restore-defaults, so fresh installs and restores now replace v1's per-library recency rows with this shared row and the newly added recommendation/discovery rows. That changes the frozen v1 response and stored behavior; select the legacy defaults for v1 and expose this row set only through v2.
AGENTS.md reference: AGENTS.md:L226-L238
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this. The v1 freeze covers routes, request and response shapes, and error semantics. Home rows are server data stored in page_sections and served unchanged by both APIs, and an admin could configure this row set by hand today. Every row type here already exists on v1 with the same response shape. Keeping two default sets would make Restore Defaults depend on which API version the admin UI calls, and would leave v1 clients a different home from v2 clients on the same server.
| &PageSection{ID: "default-because-you-watched", Scope: scopeHome, SectionType: SectionBecauseYouWatched, Title: defaultBecauseWatchedTitle, ItemLimit: DefaultItemLimit, Config: json.RawMessage(`{}`), Enabled: true}, | ||
| &PageSection{ID: idReturningShows, Scope: scopeHome, SectionType: SectionReturningShows, Title: titleReturningShows, ItemLimit: DefaultItemLimit, Config: json.RawMessage(`{}`), Enabled: true}, | ||
| &PageSection{ID: idTrendingDiscover, Scope: scopeHome, SectionType: SectionTrendingDiscover, Title: titleTrendingThisWeek, ItemLimit: DefaultItemLimit, Config: json.RawMessage(`{"source":"tmdb","window":"week"}`), Enabled: true}, | ||
| &PageSection{ID: "default-top-rated", Scope: scopeHome, SectionType: SectionCriticallyAcclaimed, Title: titleTopRated, ItemLimit: DefaultItemLimit, Config: json.RawMessage(`{}`), Enabled: true}, |
There was a problem hiding this comment.
Restrict the new Top Rated default to video
When an audiobook, ebook, or other beta item has TMDB vote metadata, this unscoped SectionCriticallyAcclaimed row can surface it because fetchCriticallyAcclaimed passes no Types restriction to ListByRatingThreshold. Scope the new default to movies and series so Restore Defaults does not introduce another change to the deferred book surfaces.
AGENTS.md reference: AGENTS.md:L30-L35
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Leaving this as is. The row uses a TMDB rating floor (8.0 with at least 500 TMDB votes, AppendTMDBRatingFloor). Audiobook and ebook metadata comes from book providers that don't set TMDB votes, so in practice these items can't qualify. main's default Hidden Gems row already used the same unscoped high-rated discovery query. Adding a type filter would need a new config field on critically_acclaimed, which is outside this PR's scope.
Problem
Related issue: #1137
Validation tasks: changes #1140 C1; changes #1142 C1 (neither case has been run yet)
A fresh install's home page is mostly "Recently Added in X" and "Recently Released in X" rows, two for every library. A server with Movies and TV gets four recency rows out of eight; five libraries give ten out of fourteen. The rest of the defaults (Hidden Gems, Trending on Server) need watch history, so a new server shows little else. This change replaces the per-library rows with one Recently Added row for movies and TV, adds rows that fill without history, and raises default movie and TV rows to 100 items.
New default home rows, in order: Continue Watching, Continue Listening (audiobook servers only), Recently Added, Recommended for You, Because You Watched, Returning Shows, Trending This Week (TMDB), Top Rated, Hidden Gems, Seasonal Picks. Rows with nothing to show stay hidden, as before.
Approach
media_scope: "video". A recently-added row that spans series libraries and other libraries now takes TV cards from arrival-event grouping (the same path the TV library page uses, so a new episode of an old show brings the show to the top) and movies from the plain query, and merges them by added time. Before, a multi-library row skipped event grouping and showed series by first-added date. This also applies to existing admin-made Recently Added rows with no library filter.sections.DefaultItemLimit); the old default was 20. Default rows for audiobook, ebook, manga, and other non-video libraries (including Continue Listening) stay at 20, since those beta surfaces are left as they are. The admin API maximum stays 500. Recommendation rows still top out near 60 because the recommendation cache holds 60 candidates.Existing servers keep their rows until an admin uses Restore Defaults.
Apple and Android: rows are rendered generically, so no client change is required. Silo-Server/silo-apple#731 and Silo-Server/silo-android#549 track checking 100-item rows on the native apps.
Validation
make lint-changed: clean.internal/sections,internal/catalog,internal/api/handlers): pass, including new DB tests for the merged row's order, video scope, caller library scope, and the new-library rule (with the shared row enabled and disabled), run against Postgres.make test-go: pass except twointernal/mediasampletests that depend on the local ffmpeg build; this change does not touch that package.Evidence
Same test server and profile, before and after Restore Defaults, web desktop:
Surface and build: web app, this branch.
Risks
GET /api/v2/home/sectionsapplies. The native apps use that endpoint and are not affected.GET /api/v2/home/sectionsresponses larger (about 1.3 KB per card before compression).Checklist
AI Disclosure
tv/show/tvshowsleft out of the shared row, and an inflated total count); the remaining findings are listed under Risks.🤖 Generated with Claude Code