Repository navigation
feat(sections): fix broken home section templates and add six new ones - #332
Conversation
Fixes templates that silently produced nothing: - award_winners: hide from gallery (resolver is a stub until award data exists); saved sections keep resolving - seasonal_themed: christmas/st_patricks/thanksgiving get an interim title-keyword resolver, and multi-theme selection skips themes without an executable query so a data-less theme can no longer black out the section during its own window (previously killed the section all of December) - taste_match: empty genre now auto-picks the profile's strongest taste cluster (fallback: server top genre); the default preset was permanently empty - because_you_watched: honor the recipe's anchor_item_id key (fetcher only read legacy source_item_id, so pinning an anchor did nothing) - editorial_spotlight: reject subject_type=franchise (validated but could never resolve); fix drawer misrepresenting pinned presets as auto-rotate - admin_curated_list: add a catalog-search item picker so Editor's Picks is actually addable; block saving an empty list; hide admin_only recipes from profile-facing galleries - discovery fetchers (hidden_gems, forgotten_favorites, critically_acclaimed): honor single/multi library scope, intersected with viewer access; implement hidden_gems max_play_count New templates: returning_shows (new season of shows you've watched), genre_roulette (rotating top-genre spotlight with title override), anniversaries (milestone release anniversaries this month), short_watches (well-rated movies under a runtime cap), family_movie_night seasonal theme (Fri/Sat evenings), and a "New in 4K" format_showcase preset via a new sort=recent param. Adds a blanket test asserting every visible gallery preset's defaults pass its own recipe validation — the gap that let taste_match and Editor's Picks ship broken. New SQL shapes validated with EXPLAIN against the dev database. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 23 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR extends discovery filters with multi-library scoping and max-plays semantics, adds four new section types (genre roulette, returning shows, anniversaries, short watches) with corresponding recipes and fetchers, introduces taste-match/recommendation auto-pick fallbacks, adds seasonal theme keyword-fallback logic, and updates web recipe gallery components with new param fields and admin-only filtering. ChangesBackend discovery scoping and new sections
Estimated code review effort: 4 (Complex) | ~75 minutes Web recipe gallery UI updates
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Fetcher
participant Reader
participant Repo
Fetcher->>Reader: GetTasteMatchRow(genre="")
Reader->>Reader: include all taste clusters
Reader->>Repo: GetTopGenres(ctx, 1)
Repo-->>Reader: top genre
Reader-->>Fetcher: taste match row
sequenceDiagram
participant Client
participant FetchOne
participant fetchSection
participant GenreRouletteFetcher
Client->>FetchOne: request SectionGenreRoulette
FetchOne->>fetchSection: dispatch
fetchSection->>GenreRouletteFetcher: fetchGenreRouletteWithTitle
GenreRouletteFetcher-->>FetchOne: items + title
FetchOne-->>Client: SectionWithItems
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03dcc7f3a0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| SELECT 1 FROM media_files mf | ||
| WHERE mf.episode_id = ne.content_id | ||
| AND mf.missing_since IS NULL |
There was a problem hiding this comment.
Scope returning-season files to the selected libraries
In library-scoped or restricted views where a series row is visible in the selected library but the newly arrived episode file is only in another folder, this inner EXISTS still passes because it ignores mf.media_folder_id. That makes Returning Shows appear based on out-of-scope files and can reveal a new season outside the viewer's library set; apply the selected/allowed/disabled library predicates to the episode file or episode_libraries before treating it as available.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9afa7c8 — the inner media_files EXISTS now applies the effective folder scope (section scope ∩ viewer-allowed, minus disabled) to mf.media_folder_id, with an early empty return when the intersection is empty.
| argIdx += 2 | ||
| } | ||
|
|
||
| fromClause, libConditions, libArgs, newArgIdx := buildLibraryScope(libraryID, libraryIDs, nil, filter.DisabledLibraryIDs, argIdx) |
There was a problem hiding this comment.
Deduplicate multi-library direct SQL rails
When libraryIDs contains multiple folders, buildLibraryScope changes fromClause to a join against media_item_libraries; because this new SELECT does not group or distinct on mi.content_id, a title present in two selected libraries is returned twice and can consume multiple limit slots. The same direct-SQL pattern appears in the other new rails, so these queries should use a semi-join or DISTINCT before scanning.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9afa7c8 by converting buildLibraryScope itself to EXISTS/NOT EXISTS semi-joins (the catalog package's canonical Pattern D shape) rather than patching each rail: this dedupes every non-GROUP BY rail (including pre-existing ones like format_showcase and new_to_library), makes the disabled-library check item-level, and adds the deny-only positive-membership guard. The one SQL-shape test pinning the old JOIN was updated.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/recommendations/reader.go (1)
172-210: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winCluster fallback bails early instead of trying the next weaker cluster.
The new comment promises "every taste cluster qualifies (strongest first)" when genre is empty, but the existing loop body at Lines 206-208 returns
nil, nilthe momentfilterRowsempties out the first cluster it finds cached items for — it never tries the next cluster inmatching, and never reaches the global top-genre fallback below.Before this change,
matchingtypically held 0-1 clusters (exact dominant-genre matches), so this quirk was rarely exercised. Now that genre="" pulls in all clusters sorted by weight, a top cluster whose cached items get entirely filtered out byfilter(e.g. due to library-scope access restrictions) will short-circuit the whole function instead of falling through to the next cluster or the genre-sampler fallback.🐛 Proposed fix: continue instead of early return
rows, err := r.filterRows(ctx, userID, profileID, []ForYouRow{clusterRow(cluster, items)}, filter) if err != nil { return nil, err } rows = trimRows(rows, limit) if len(rows) == 0 { - return nil, nil + continue } return &rows[0], nil }🤖 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 `@internal/recommendations/reader.go` around lines 172 - 210, The cluster fallback in reader.go stops too early when the first cached cluster has no usable rows after filtering. Update the loop in the recommendation path that builds and iterates over matching clusters so it continues to the next cluster instead of returning nil,nil when trimRows(filterRows(...)) is empty. Keep the strongest-first ordering from matching/sort.SliceStable, and only return a recommendation once a cluster yields rows; otherwise fall through so later clusters and the existing top-genre fallback can still run.
🧹 Nitpick comments (6)
internal/sections/recipes/seasonal_test.go (1)
371-395: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a direct title-override test for the usable filter.
ActiveSeasonalThemeWhereis covered, butSeasonalTitleOverride(..., usable)is the public helper the fetcher calls to keep the displayed title aligned with the resolved theme. A small assertion where"christmas"is unusable and"saturday_morning"wins would lock that contract down.🤖 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 `@internal/sections/recipes/seasonal_test.go` around lines 371 - 395, Add a direct test for SeasonalTitleOverride with a usable filter, since this public helper is what the fetcher uses to keep the title aligned with the resolved theme. In the existing seasonal tests near TestActiveSeasonalThemeWhereSkipsUnusable, add an assertion that when "christmas" is rejected by the usable predicate, SeasonalTitleOverride falls through to "saturday_morning" instead of returning the higher-priority unusable theme. Use SeasonalTitleOverride and the same usable-filter pattern already exercised by ActiveSeasonalThemeWhere so the contract is covered end to end.internal/sections/fetcher.go (1)
3844-3849: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winInclude multi-library scope in the roulette rotation seed.
When
libraryID == nil, every multi-library scoped row useslibKey = "all", so different scoped genre-roulette rows share the same rotation bucket. IncludelibraryIDsin the seed to keep rotation deterministic per scope.Proposed fix
libKey := "all" if libraryID != nil { libKey = strconv.Itoa(*libraryID) + } else if len(libraryIDs) > 0 { + parts := make([]string, len(libraryIDs)) + for i, id := range libraryIDs { + parts[i] = strconv.Itoa(id) + } + libKey = strings.Join(parts, ",") }🤖 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 `@internal/sections/fetcher.go` around lines 3844 - 3849, The genre-roulette rotation seed currently collapses all multi-library scoped rows into the same "all" bucket when libraryID is nil, so different scopes share one rotation. Update the rotation key construction around the RotationIndex call in the genre roulette logic to incorporate libraryIDs (or another scope-unique identifier) when libraryID is nil, while preserving the existing single-library behavior for non-nil libraryID.web/src/components/RecipeGallery/RecipeParamFields.tsx (2)
454-467: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winCatalog search failures are silent.
results.erroris never surfaced; on a failed request (results.isError),foundfalls back to[]and the UI shows "No matches." indistinguishable from a genuine empty result, which could mislead admins into thinking their search term has no matches when the request actually failed.Also applies to: 504-508
🤖 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/components/RecipeGallery/RecipeParamFields.tsx` around lines 454 - 467, The catalog search in RecipeParamFields uses useQuery for the curated list, but failed requests are being treated like empty results. Update the search/results handling around results.isError, results.error, and found so a fetch failure is surfaced to the UI instead of falling back to an empty array and showing “No matches.”; keep the logic in RecipeParamFields and the fetchCatalogPage/queryFn flow aligned so error state is distinguishable from a genuine empty response.
436-440: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHydrate curated-item titles on open
web/src/components/RecipeGallery/RecipeParamFields.tsx:547-550Existingparams.item_idsnever seedlabels, so saved curated items render as raw IDs until they’re re-added. Populatelabelsfor the initial IDs when the drawer mounts using the catalog item-detail fetcher.🤖 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/components/RecipeGallery/RecipeParamFields.tsx` around lines 436 - 440, The curated-items field is not hydrating labels for preexisting params.item_ids, so saved items show as raw IDs until reselected. Update CuratedItemsParamField to seed the labels state on mount for any initial item_ids by fetching their titles through the same catalog item-detail fetcher used elsewhere. Keep the logic inside CuratedItemsParamField so the initial render of existing curated items uses populated labels instead of falling back to ids.internal/sections/recipes/personalized.go (1)
114-134: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueConsider bounding
LookbackDays.
ReturningShowsParams.LookbackDayshas no validation — negative or absurdly large values passValidate()unchanged. If the downstreamfetchReturningShowsbuilds a SQL interval or date-window directly from this value (not shown in this batch), a negative lookback could silently produce an empty or malformed query.♻️ Optional bounds check
func (returningShowsRecipe) Validate(raw json.RawMessage) error { if len(raw) == 0 { return nil } var p ReturningShowsParams - return json.Unmarshal(raw, &p) + if err := json.Unmarshal(raw, &p); err != nil { + return err + } + if p.LookbackDays < 0 { + return errors.New("returning_shows: lookback_days must be non-negative") + } + return nil }Worth confirming how
fetchReturningShowsininternal/sections/fetcher.goconsumes this field.🤖 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 `@internal/sections/recipes/personalized.go` around lines 114 - 134, Add validation for ReturningShowsParams.LookbackDays in returningShowsRecipe.Validate so negative or unreasonably large values are rejected instead of passing through unchanged. Keep the existing json.Unmarshal path, then enforce a sensible range on the LookbackDays field before returning, and make sure any future use in fetchReturningShows is safe to consume.internal/sections/recipes/editorial.go (1)
166-180: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider extracting a shared enum-validation helper.
The
""/daily/weekly/monthlyandmilestone_years >= 0checks repeat the same shape seen inmood.go(short_watches) anddiscovery.go(format_showcase). A smallvalidateEnum(field string, value string, allowed ...string) errorhelper would reduce duplication as more recipes are added.♻️ Example helper
func validateEnum(field, value string, allowed ...string) error { for _, a := range allowed { if value == a { return nil } } return fmt.Errorf("%s: invalid value %q (want one of %v)", field, value, allowed) }Also applies to: 215-227
🤖 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 `@internal/sections/recipes/editorial.go` around lines 166 - 180, The validation logic in genreRouletteRecipe.Validate duplicates the same enum-check pattern used in other recipe validators, so extract a shared helper such as validateEnum and reuse it here and in the matching checks from mood.go and discovery.go. Update Validate to call the helper for rotation_cadence, keeping the same field-specific error context and allowed values, so future recipe validators can share the same pattern.
🤖 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 `@web/src/components/RecipeGallery/RecipeParamFields.tsx`:
- Around line 408-427: The numeric field handling in RecipeParamFields should
reject fractional input for integer-only params. Update the onChange logic in
the numeric input helper so it only stores values when Number.isFinite(parsed),
parsed > 0, and Number.isInteger(parsed) are all true, leaving invalid or
fractional entries as undefined. Use the existing paramKey-based setter in this
component to keep the fix localized to the fields for lookback_days,
max_minutes, and milestone_years.
---
Outside diff comments:
In `@internal/recommendations/reader.go`:
- Around line 172-210: The cluster fallback in reader.go stops too early when
the first cached cluster has no usable rows after filtering. Update the loop in
the recommendation path that builds and iterates over matching clusters so it
continues to the next cluster instead of returning nil,nil when
trimRows(filterRows(...)) is empty. Keep the strongest-first ordering from
matching/sort.SliceStable, and only return a recommendation once a cluster
yields rows; otherwise fall through so later clusters and the existing top-genre
fallback can still run.
---
Nitpick comments:
In `@internal/sections/fetcher.go`:
- Around line 3844-3849: The genre-roulette rotation seed currently collapses
all multi-library scoped rows into the same "all" bucket when libraryID is nil,
so different scopes share one rotation. Update the rotation key construction
around the RotationIndex call in the genre roulette logic to incorporate
libraryIDs (or another scope-unique identifier) when libraryID is nil, while
preserving the existing single-library behavior for non-nil libraryID.
In `@internal/sections/recipes/editorial.go`:
- Around line 166-180: The validation logic in genreRouletteRecipe.Validate
duplicates the same enum-check pattern used in other recipe validators, so
extract a shared helper such as validateEnum and reuse it here and in the
matching checks from mood.go and discovery.go. Update Validate to call the
helper for rotation_cadence, keeping the same field-specific error context and
allowed values, so future recipe validators can share the same pattern.
In `@internal/sections/recipes/personalized.go`:
- Around line 114-134: Add validation for ReturningShowsParams.LookbackDays in
returningShowsRecipe.Validate so negative or unreasonably large values are
rejected instead of passing through unchanged. Keep the existing json.Unmarshal
path, then enforce a sensible range on the LookbackDays field before returning,
and make sure any future use in fetchReturningShows is safe to consume.
In `@internal/sections/recipes/seasonal_test.go`:
- Around line 371-395: Add a direct test for SeasonalTitleOverride with a usable
filter, since this public helper is what the fetcher uses to keep the title
aligned with the resolved theme. In the existing seasonal tests near
TestActiveSeasonalThemeWhereSkipsUnusable, add an assertion that when
"christmas" is rejected by the usable predicate, SeasonalTitleOverride falls
through to "saturday_morning" instead of returning the higher-priority unusable
theme. Use SeasonalTitleOverride and the same usable-filter pattern already
exercised by ActiveSeasonalThemeWhere so the contract is covered end to end.
In `@web/src/components/RecipeGallery/RecipeParamFields.tsx`:
- Around line 454-467: The catalog search in RecipeParamFields uses useQuery for
the curated list, but failed requests are being treated like empty results.
Update the search/results handling around results.isError, results.error, and
found so a fetch failure is surfaced to the UI instead of falling back to an
empty array and showing “No matches.”; keep the logic in RecipeParamFields and
the fetchCatalogPage/queryFn flow aligned so error state is distinguishable from
a genuine empty response.
- Around line 436-440: The curated-items field is not hydrating labels for
preexisting params.item_ids, so saved items show as raw IDs until reselected.
Update CuratedItemsParamField to seed the labels state on mount for any initial
item_ids by fetching their titles through the same catalog item-detail fetcher
used elsewhere. Keep the logic inside CuratedItemsParamField so the initial
render of existing curated items uses populated labels instead of falling back
to ids.
🪄 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: 477283f0-6509-41f4-8e02-8153740f5612
📒 Files selected for processing (20)
internal/catalog/discovery_repo.gointernal/catalog/discovery_repo_test.gointernal/recommendations/reader.gointernal/sections/fetcher.gointernal/sections/recipes/discovery.gointernal/sections/recipes/discovery_test.gointernal/sections/recipes/editorial.gointernal/sections/recipes/editorial_test.gointernal/sections/recipes/mood.gointernal/sections/recipes/personalized.gointernal/sections/recipes/presets_test.gointernal/sections/recipes/seasonal.gointernal/sections/recipes/seasonal_test.gointernal/sections/seasonal_query_test.gointernal/sections/types.goweb/src/components/RecipeGallery/RecipeConfigDrawer.tsxweb/src/components/RecipeGallery/RecipeGalleryModal.tsxweb/src/components/RecipeGallery/RecipeParamFields.tsxweb/src/pages/ProfileCustomizeHome.tsxweb/src/pages/settings/HomeScreenSettings.tsx
Codex review: - returning_shows: the new-season file check now applies the effective library scope (section scope ∩ viewer-allowed, minus disabled) to media_files.media_folder_id, so an episode file that only exists in an out-of-scope folder can no longer surface the series - buildLibraryScope: replaced the media_item_libraries row join with EXISTS / NOT EXISTS semi-joins. An item in several in-scope libraries now yields exactly one row in the non-GROUP BY rails (short_watches, anniversaries, seasonal keyword, format_showcase, new_to_library, ...), and the disabled-library check is item-level, closing the join-row leak where membership in an allowed library masked membership in a disabled one. Deny-only mode keeps the positive-membership guard, mirroring catalog's appendDiscoveryLibraryScope. CodeRabbit review: - recommendations reader: a taste cluster whose cached items are entirely filtered out now falls through to the next cluster / global fallback instead of returning an empty row - genre_roulette: multi-library scopes get distinct rotation seeds - returning_shows: reject negative lookback_days at validation - shared oneOf() enum validator replaces per-recipe switch duplication - SeasonalTitleOverride usable-filter contract covered by a direct test - web NumberParamField: integer-only guard + step=1 (backend fields are Go ints; fractional values failed unmarshalling at save) - curated list picker: search failures show an error instead of a misleading "No matches."; pre-existing item_ids hydrate display titles via the watch-detail endpoint instead of rendering raw ids Co-Authored-By: Claude Fable 5 <[email protected]>
|
Addressed all review findings in 9afa7c8: Codex
CodeRabbit
Verified: full Go build + package tests green, both reshaped SQL queries EXPLAIN cleanly against the dev database, web tsc/eslint/prettier/vitest green. |
#332) * feat(sections): fix broken home section templates and add six new ones Fixes templates that silently produced nothing: - award_winners: hide from gallery (resolver is a stub until award data exists); saved sections keep resolving - seasonal_themed: christmas/st_patricks/thanksgiving get an interim title-keyword resolver, and multi-theme selection skips themes without an executable query so a data-less theme can no longer black out the section during its own window (previously killed the section all of December) - taste_match: empty genre now auto-picks the profile's strongest taste cluster (fallback: server top genre); the default preset was permanently empty - because_you_watched: honor the recipe's anchor_item_id key (fetcher only read legacy source_item_id, so pinning an anchor did nothing) - editorial_spotlight: reject subject_type=franchise (validated but could never resolve); fix drawer misrepresenting pinned presets as auto-rotate - admin_curated_list: add a catalog-search item picker so Editor's Picks is actually addable; block saving an empty list; hide admin_only recipes from profile-facing galleries - discovery fetchers (hidden_gems, forgotten_favorites, critically_acclaimed): honor single/multi library scope, intersected with viewer access; implement hidden_gems max_play_count New templates: returning_shows (new season of shows you've watched), genre_roulette (rotating top-genre spotlight with title override), anniversaries (milestone release anniversaries this month), short_watches (well-rated movies under a runtime cap), family_movie_night seasonal theme (Fri/Sat evenings), and a "New in 4K" format_showcase preset via a new sort=recent param. Adds a blanket test asserting every visible gallery preset's defaults pass its own recipe validation — the gap that let taste_match and Editor's Picks ship broken. New SQL shapes validated with EXPLAIN against the dev database. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(sections): address PR #332 review findings Codex review: - returning_shows: the new-season file check now applies the effective library scope (section scope ∩ viewer-allowed, minus disabled) to media_files.media_folder_id, so an episode file that only exists in an out-of-scope folder can no longer surface the series - buildLibraryScope: replaced the media_item_libraries row join with EXISTS / NOT EXISTS semi-joins. An item in several in-scope libraries now yields exactly one row in the non-GROUP BY rails (short_watches, anniversaries, seasonal keyword, format_showcase, new_to_library, ...), and the disabled-library check is item-level, closing the join-row leak where membership in an allowed library masked membership in a disabled one. Deny-only mode keeps the positive-membership guard, mirroring catalog's appendDiscoveryLibraryScope. CodeRabbit review: - recommendations reader: a taste cluster whose cached items are entirely filtered out now falls through to the next cluster / global fallback instead of returning an empty row - genre_roulette: multi-library scopes get distinct rotation seeds - returning_shows: reject negative lookback_days at validation - shared oneOf() enum validator replaces per-recipe switch duplication - SeasonalTitleOverride usable-filter contract covered by a direct test - web NumberParamField: integer-only guard + step=1 (backend fields are Go ints; fractional values failed unmarshalling at save) - curated list picker: search failures show an error instead of a misleading "No matches."; pre-existing item_ids hydrate display titles via the watch-detail endpoint instead of rendering raw ids Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]>
Problem
A review of the home page section templates (recipes) found several that are advertised in the gallery but silently produce nothing — the home page hides empty sections, so they just never appear:
fetchAwardWinnersis a stub that always returns empty.{}, so it never rendered.anchor_item_idbut the fetcher only readsource_item_id— pinning an anchor did nothing.item_idsalways failed validation → add always 400s. It also leaked into non-admin galleries becauseadmin_onlywas never enforced client-side.max_play_countparam was dead.What changed
Fixes
award_winnersmarkedHidden(stays resolvable for saved sections).ActiveSeasonalThemeWhereskips themes that can't produce items so a data-less theme never blacks out the section in its own window. Title overrides track the same selection.anchor_item_idand legacysource_item_id(legacy wins when both set).franchiseremoved from valid subject types; drawer no longer misrepresents pinned presets (e.g. "The 80s") as auto-rotate.admin_onlyrecipes hidden from profile-facing galleries.max_play_countimplemented as a watch-count threshold.New templates
returning_shows— shows you've watched with a brand-new season (newer than any you've seen, with playable files) in the lookback window.genre_roulette— deterministic rotating top-genre spotlight (reuses editorial rotation hashing + candidate cache), row title carries the active genre.anniversaries— movies with a milestone release anniversary this month (5-year multiples by default).short_watches— well-rated movies under a runtime cap ("Short & Sweet").family_movie_night— new seasonal theme for Friday/Saturday evenings, with preset and holiday-picker entry.format_showcasegainssort: recent+ a "New in 4K" preset.Review notes
short_watches,anniversaries) join the shared resolved-list cache viauserAgnosticSectionFetcher, so cacheability tracks dispatch as before;genre_roulettemirrors theeditorial_spotlighttitle-override interception inFetchOne;returning_showsis per-user.EXPLAINagainst the dev database; plans use existing indexes.TestBeginWebOperation*(flaky), setup-wizard/compat-proxy vitest files (fail on HEAD).Verification
go build ./...,go test ./internal/... ./cmd/...(only the documented pre-existing failures),gofmt,make verify-local-paths.tsc -b,pnpm run lint(0 errors),pnpm run format:check, vitest (RecipeGallery suites pass; full-suite failures are pre-existing).AI-use disclosure
Implemented by Claude (Fable 5) via Claude Code under human direction, including the review that found the defects; verified with the test runs and dev-DB EXPLAIN checks above.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
UI Improvements