Skip to content

feat(web): pick collections and build rule rows in the Home row dialog - #1895

Merged
Quick104 merged 7 commits into
feat/collections-revampfrom
feat/home-rows-collection-rule-rows
Oct 4, 2026
Merged

Quick104 merged 7 commits into
feat/collections-revampfrom
feat/home-rows-collection-rule-rows

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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 to feat/collections-revamp once 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:

  • Collection rows get a picker with a search box, an All / Manual / Smart / Synced list filter, and one choice per collection showing its poster, type and title count. A collection that already has a row on the page is marked "On {page}". The row name starts as the collection's name. The admin picker offers every visible library collection, including ones in libraries the admin's own profile can't open, and leaves hidden collections out. If a row's collection isn't in the list, the picker says the row keeps it until another is picked. Legacy Trakt rows can't change their collection.
  • Rule rows ("Titles matching rules") read as a sentence, "Show [kind] from [libraries] that match [all/any] of these:", followed by the rule lines, Add rule and Add an "or" group. Filters with several groups stay as stored; when their groups join with "and", the button reads Add an "and" group. Personalized rules and sorts are allowed, and rules the editor can't display stay read-only, as in the drawer. The sort order moves under More options, whose summary names it ("Highest rated first"). The preview header shows "N titles match · showing M" from the preview's total_count and dims while a new count loads.
  • Legacy genre rows open the rule builder.
  • Editor's Picks rows edit their title list, moved out of the recipe settings fields. Save stays off while the list is empty.

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:

  • A collection, rule or genre row whose collection or rules weren't changed sends its stored config byte for byte, including on a rename or a hero toggle.
  • Picking a different collection writes that option's id key and keeps every other key.
  • Editing rules replaces only the query keys. Legacy filter_type, filter_library_id(s) and order fold into today's shape, as they did in the drawer.
  • New collection and rule rows send the create bodies the recorded payload tests pin, plus position at the bottom of the page.
  • Edits use the same ETag-checked save as other rows: on a 412 the dialog keeps the admin's edits, and Reload row merges in the server's changes.

CollectionOption now 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 uses SectionEditorDrawer until its own PR.

Differences from the plan and the approved design, for sign-off:

  • An untouched legacy genre row 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. The buildAdminSectionPayload golden test still pins the rewrite, but it now covers only the drawer path.
  • The plan kept a "collection changed" flag on the draft and turned Save off while collection options load. Here a pick updates the config at once, so an unchanged selection already keeps the config, and Save is off only until a new collection row has a collection.
  • The plan's useRowCollectionOptions(surface) is admin-only for now (useAdminRowCollections). The profile side comes with Settings > Home Screen.
  • The rule builder doesn't offer the "Movies & shows" scope, because a row's config reads that scope back as all titles.
  • Not built from the mockup: the multi-poster art on collection choices (one poster shows) and chips for genre values (rules use text boxes). The "Only admins can add rule rows unless…" note belongs to the "Let profiles add rule rows" PR.

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. The useCreateSection and useUpdateSection hooks lost their last caller and are removed here.

Validation

  • Web: 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 -b and budget:check pass.
  • Tests: the drawer's rule cases are ported to the dialog (untouched multi-group and unknown-field rows save byte-identical config; personalized rules and sorts; read-only rules kept until removed). Other tests cover the picker's filters, search, keyboard use, a collection missing from the list, a failed load and the Trakt lock; rule groups; the Editor's Picks list; create bodies against the recorded payloads; config kept on a rename or hero toggle; a pick that keeps other keys; rule edits that touch only query keys; a 412 and Reload row on a rule row; hidden collections not offered; the match count and its loading state; and the row list wording. The new and changed tests fail when run against the base branch's code.
  • Browser: Chromium at 1440 px and 390 px against a local build with a disposable database and empty libraries, before the review fixes listed under AI Disclosure. The collection step matched the design's collection-row mockup, and the check caught a rule's value box squeezed to nothing at 390 px, which is fixed. With no media every preview was empty, so match counts and posters are covered by tests only.
  • Hygiene: make verify-local-paths passes.
  • Not run: the Go gate and the contract verify targets, because this diff changes no Go, contract or generated input. Curated home sections — Web admin #1141 C1 has not been walked with collection and rule rows on a build with real media.

Risks

No API, section_type, recipe ID, preset key, layout export/import or gating change, and hero behavior is unchanged. Components read capabilities.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

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code subagents (implementer, independent reviewer)
  • Model(s): claude-opus-5-5[1m]
  • Involvement: Fully AI-generated, human review pending
  • Adversarial review: An independent reviewer subagent checked the diff against the approved design and the planned scope, re-ran the web checks, and ran the new and changed tests against the base branch's code to confirm they catch the change. It found no blockers and five smaller problems. Four are fixed: a rule row's match count stayed on screen with no cue while a new preview loaded; every rule's controls had the same accessible names; the picker called a row's collection missing when the list had only failed to load; and two admin section hooks had no callers. The fifth, that an untouched legacy genre row now keeps its stored config, is intended and is stated under Approach.

🤖 Generated with Claude Code

Note

Add collection picker, rule builder, and curated-titles editor to the Home row dialog

  • Brings collection, filter-rule, and Editor's Picks row editing into the AddRowDialog, removing the onBridge callback and the BRIDGED_ROW_KINDS handoff to the older section editor in AddRowDialog.tsx
  • Adds CollectionPicker with search, type filters, and poster art, RuleBuilder with sentence-style groups and conjunctions, and CuratedTitlesEditor for ordered catalog title picks
  • Adds collection options to the adapter via useAdminRowCollections, which filters out hidden collections and includes poster and count metadata
  • canSaveDraft now blocks saving a collection row without a collection id, and an admin-curated row without item ids; blank collection titles follow the selected collection name
  • Updates and deletes to useCreateSection/useUpdateSection in sections.ts were removed along with the older SectionEditorDrawer integration in AdminHomeRows.tsx
  • Behavioral Change: buildRowUpdateRequest now 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 configuration

Macroscope summarized a89cf72.

Quick104 and others added 5 commits October 4, 2026 04:49
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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T12:50:47.015200Z a89cf72 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dcadbdf0-52e2-49a1-bf52-34e481202a3a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

@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: 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".

Comment on lines +22 to +24
// No "Movies & shows" (video): a row's config reads that scope back as all titles.
const SCOPES: ReadonlyArray<[MediaScope, string]> = [
["all", "All titles"],

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 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 👍 / 👎.

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 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.

Quick104 and others added 2 commits October 4, 2026 08:43
…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]>

@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: 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) : "";

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 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 👍 / 👎.

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 035ae08 on #1913 (follow-up for late findings)

Base automatically changed from feat/home-rows-poster-peeks to feat/collections-revamp October 4, 2026 14:31
@Quick104
Quick104 merged commit 3b6af2e into feat/collections-revamp Oct 4, 2026
20 checks passed
@Quick104
Quick104 deleted the feat/home-rows-collection-rule-rows branch October 4, 2026 14:32
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