Repository navigation
feat(web): pick collections and build rule rows in the Home row dialog - #1895
Conversation
Collection, rule, legacy genre and Editor's Picks rows still opened the older section editor sheet, so the admin page kept two editors. Step 2 of the Home row dialog now has a collection picker (search, Manual / Smart / Synced list filter, on-this-page marker), a sentence-style rule builder over the shared rule rows with the order under More options, and the Editor's Picks title list. The admin page no longer uses SectionEditorDrawer. Untouched collection and rule rows save their stored config byte for byte; picking a collection writes only that option's id key. Admin options are the server's visible library collections, and a row whose collection is gone says so. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… reloads The preview keeps the last result on screen during the debounce and the next request, so the count briefly described the previous rules with no cue. It now dims and the strip reports busy until the new count arrives. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Every rule line had controls named Field, Condition, Value and Remove rule, so with several rules a screen reader user could not tell them apart. Each editable rule is now a group named Rule N. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…to load A failed collections request left the options empty, so the picker also warned that the row's collection was gone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Home rows page saves through its adapter now, so these hooks had no callers. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54a23a7058
ℹ️ 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".
| // No "Movies & shows" (video): a row's config reads that scope back as all titles. | ||
| const SCOPES: ReadonlyArray<[MediaScope, string]> = [ | ||
| ["all", "All titles"], |
There was a problem hiding this comment.
Restore the Movies & Series rule scope
When an admin wants one rule row covering movies and series while excluding audiobook, ebook, and manga titles, this scope list no longer offers a way to express it. Choosing “All titles” omits media_scope and therefore includes every media type, while choosing Movies or Shows excludes the other video type. The previous editor and the backend both support media_scope: "video" as “Movies & Series,” so removing that option regresses creation of valid video-wide rule rows.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in a89cf72. The builder offers "Movies & shows" (media_scope: "video") again. The option had been dropped because queryDefinitionFromSectionConfig read video back as all titles, so it now keeps video, and the row summary reads "movies and shows". Tests cover picking the scope, round-tripping it through a rules edit, and the row description.
…o feat/home-rows-collection-rule-rows # Conflicts: # web/src/components/homeRows/addRow/AddRowDialog.test.tsx # web/src/components/homeRows/addRow/AddRowDialog.tsx # web/src/components/sections/SectionEditorDrawer.tsx # web/src/pages/AdminHomeRows.tsx
The backend expands media_scope "video" to movies and series, and the old section editor offered it, but the new rule builder dropped the option because a row's config read "video" back as all titles. Keep "video" when reading a section config, offer "Movies & shows" in the builder, and describe such rows as movies and shows. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a89cf72406
ℹ️ 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".
| ); | ||
| const collections = adapter.collections ?? NO_COLLECTIONS; | ||
| const collectionChoices = useMemo<CollectionChoices>(() => { | ||
| const currentId = draft?.sectionType === "collection" ? collectionIdOf(draft.config) : ""; |
There was a problem hiding this comment.
Require a library collection on the admin surface
For an existing admin collection row whose legacy config contains only user_collection_id, this call uses collectionIdOf's default "profile" surface, so the invalid personal ID is treated as the current selection; canSaveDraft uses the same default and enables Save. buildRowUpdateRequest then preserves that config unchanged, but the admin sections endpoint requires library_collection_id, causing a rename, hero change, or no-op save to fail with 400 instead of requiring the admin to pick a library collection as the previous drawer did. Pass the admin surface through both selection and save validation.
Useful? React with 👍 / 👎.
Problem
Related issue: #1137
Validation tasks: changes #1141 C1 (collection, rule, legacy genre and Editor's Picks rows are now added and edited in the Add row dialog instead of the old editor; a row saved without changes to its collection or rules keeps its stored configuration); reaches #1140 C1 (new collection and rule rows send the same create requests as before) and #1137 AC1
Stacked on #1893 (poster peeks), so this targets
feat/home-rows-poster-peeks. #1893 sits on #1891, #1889, #1885, #1884, #1883 and #1882. It retargets tofeat/collections-revamponce those merge.Admin > Home rows adds and edits ready-made rows in the Add row dialog (#1883), but collection, rule, genre and Editor's Picks rows still go to the old section editor drawer. Picking the Collection or "Titles matching rules" card closes the dialog and opens the drawer, which lists collections by name only and never shows which titles the row will hold. This PR builds those kinds into the dialog as the approved Home rows design draws them, so every admin row is added and edited in one place. The admin page no longer uses
SectionEditorDrawer.Approach
For these kinds, step 2 and Edit row put the row's own control above the live preview:
total_countand dims while a new count loads.The rule lines are the collection rule editor's rows, split out of
FilterRuleEditor, which renders as before. Each rule is now a group named "Rule N", so a screen reader can tell which rule a Value box or Remove rule button belongs to.In the row list, a collection row reads "The X collection (Manual)". When its collection has been deleted, the row reads "Collection no longer available" and can be removed with Delete row….
Saves keep stored data unless the admin changes it:
filter_type,filter_library_id(s)andorderfold into today's shape, as they did in the drawer.positionat the bottom of the page.CollectionOptionnow carries poster, thumbhash, title count and type for both library and personal collections, so Settings > Home Screen can use the same picker later. Settings > Home Screen still usesSectionEditorDraweruntil its own PR.Differences from the plan and the approved design, for sign-off:
genrerow now keeps its stored config on save. The drawer rewrote it into today's filter shape on every save; the design asks for genre rows to save as they are. ThebuildAdminSectionPayloadgolden test still pins the rewrite, but it now covers only the drawer path.useRowCollectionOptions(surface)is admin-only for now (useAdminRowCollections). The profile side comes with Settings > Home Screen.SectionEditorDrawer's admin mode and its admin tests no longer have a caller in the app; the PR that removes the old editors deletes them. TheuseCreateSectionanduseUpdateSectionhooks lost their last caller and are removed here.Validation
make test-web(782 files, 7180 tests passed),pnpm run lint(0 errors; the warnings in changed files are on exports this PR doesn't add),format:check,build,tsc -bandbudget:checkpass.make verify-local-pathspasses.Risks
No API,
section_type, recipe ID, preset key, layout export/import or gating change, and hero behavior is unchanged. Components readcapabilities.ruleRows, not the account role. silo-apple, silo-android and jellycompat need no change.Stored config changes only when an admin picks another collection or edits rules. A legacy rule row stored with the "video" media scope shows as all titles in the rule builder and loses "video" if its rules are edited; the drawer behaved the same way.
The user manual describes the drawer's collection list and filter editor. A siloserver.org issue covering collection and rule rows, along with the rest of the Home rows changes, is drafted and not filed yet.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add collection picker, rule builder, and curated-titles editor to the Home row dialog
onBridgecallback and theBRIDGED_ROW_KINDShandoff to the older section editor in AddRowDialog.tsxCollectionPickerwith search, type filters, and poster art,RuleBuilderwith sentence-style groups and conjunctions, andCuratedTitlesEditorfor ordered catalog title picksuseAdminRowCollections, which filters out hidden collections and includes poster and count metadatacanSaveDraftnow blocks saving a collection row without a collection id, and an admin-curated row without item ids; blank collection titles follow the selected collection nameuseCreateSection/useUpdateSectionin sections.ts were removed along with the olderSectionEditorDrawerintegration in AdminHomeRows.tsxbuildRowUpdateRequestnow sends the draft config as-is for collection and rule rows, preserving untouched and form-unowned config keys instead of rebuilding through admin payload defaults; changing a rule's media scope can rewrite an incompatible sort configurationMacroscope summarized a89cf72.