Skip to content

feat(web): add and edit ready-made Home rows in one dialog - #1883

Merged
Quick104 merged 8 commits into
feat/collections-revampfrom
feat/home-rows-dialog
Oct 4, 2026
Merged

Quick104 merged 8 commits into
feat/collections-revampfrom
feat/home-rows-dialog

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1137
Validation tasks: changes #1141 C1 (rows are added and edited in the new dialog and land at the bottom of the page; adding one row to several library pages at once is unavailable until the library-copies PR; includes the #586 weekly trending label); changes #1142 C1 (a newly added row renders at the bottom of Home instead of near the top); reaches #1137 AC1 and AC2 (the #585 seasonal title check)

Stacked on #1882 (the Home rows list), so this targets feat/home-rows-rowlist. It retargets to feat/collections-revamp once #1882 merges.

Admin > Home rows has two ways to add a row. "Add from Gallery" opens a recipe gallery, a settings drawer for the picked recipe, and on library pages an "Apply to all libraries" dialog. "+ Add Section" opens a drawer with a type dropdown, and editing a ready-made row uses that same drawer. Neither shows which titles the row will hold, and both expose raw recipe settings such as a "Subject type" select and an "Anchor item" ID box. A single create also sends no position, so a new row lands near the top of the page. This PR replaces both with one Add row dialog from the approved Home rows design: pick a kind of row, see a live preview, choose a variant, name it. Edit row… on a ready-made row opens the same form. Collection and rule rows keep the old editor (SectionEditorDrawer) until the next PR. The API, section_type values, recipe IDs and preset keys don't change.

Approach

Step 1 lists the kinds of row in six groups (Keep watching, What's new, Popular, Picked for you, Moods & themes, Collections & rules) with counts, a search that also matches words like "4K", "Ghibli" and "Christmas", and cards whose variant chips jump straight to that variant. A card for a kind already on the page carries an "On {page}" tag. Editor's Picks, genre and award rows are not offered for new rows; existing ones stay editable. Step 2 shows a live preview, the variant choice, Row name and a collapsed More options box (Number of titles, Hero banner). The row name follows the variant until the admin types their own. Edit row… shows the same form with a "Shows: … [Change]" line and Delete row… in the footer. Below 1024 px the dialog is a bottom sheet with one-column cards and group chips. The group list works as keyboard tabs, variants are radio cards, Escape closes from either step, Back keeps the search, and focus returns to Add row or the row's ⋯ button.

Saves keep stored data as it is unless the admin changes it:

  • A new row's request body is the gallery's, byte for byte, plus position = highest position + 1. Collection and rule rows created through the old editor also send that position.
  • A row shows a variant as selected only when its settings match that preset exactly. Picking a variant changes only that variant's own settings keys, so opening or renaming a row never rewrites its config. Spotlight keeps its rotation when switching between director, actor and studio. Seasonal rows saved with the older single theme key keep it on a rename and name their holiday, for example "Seasonal picks (Christmas only)".
  • An edit sends what the old editor sent, except the stored config is not merged back in, so a key that a variant change removed stays removed.
  • On a 412 the form keeps the admin's edits and disables Save. Reload row takes the server's values for fields the admin didn't change, keeps the rest, and names what changed elsewhere.

The preview asks the admin preview endpoint for 7 titles, 400 ms after the last change, and keeps the last result on screen while the next one loads. That endpoint returns no poster URLs, so the strip shows blurred thumbhash tiles with titles. One component draws the tiles and already shows a poster when poster_url is present, so it can switch to posters if the server starts sending them.

Collection, rule, genre and Editor's Picks rows still open the old editor. When Change turns an existing ready-made row into a collection or rule row, the old editor opens with the name, Number of titles and hero setting from the dialog. The gallery, its settings drawer, the "Apply to all libraries" dialog and the page's unreachable Trakt row creation code are removed from the admin page; the server already refuses new Trakt rows. Settings > Home Screen still uses the gallery until its own PR. Restore Defaults, Delete All and Delete Selected stay in the header for now.

Differences from the approved design, for sign-off:

  • The preview shows thumbhash tiles, not posters (see above).
  • The Edit row subtitle reads "Changes apply to everyone on {page} who hasn't changed this row." A profile that has saved Home Screen once stores its own name, size, hero and settings for every row, so admin edits no longer reach it and the mockup's wording isn't true.
  • The hero switch has the helper line "The web shows this row as a banner. The apps show it as a regular row."
  • After Reload row, a "Changed elsewhere: …" line names the fields that changed.
  • Personal kinds of row say "Different for each viewer." instead of "Every viewer sees the same titles.", because what each profile can open differs.
  • Some wording isn't in the mockups: variant hints, group taglines, most card sentences, the Change step title, the preview's empty and error lines, and the conflict message.

Validation

  • Web: make test-web (765 files; 6993 passed, 3 expected failures already in the base), pnpm run lint (0 errors; the three warnings in a changed file are on re-export lines this PR doesn't touch), format:check, build (includes tsc -b) and budget:check pass.
  • Tests: jsdom tests render the dialog and the page. They check that create bodies equal the gallery's recorded payloads for every preset on Home and on a library page, plus position; that renames keep config byte for byte; that the variant tables match the recipe catalog fixture; the picker groups, counts and search; keyboard use and focus return; the phone layout; Reload row after a 412; and the hand-off to the old editor. Removing position, merging the stored config back into edits, removing the double-submit guard, or dropping the picked kind on a 412 reload in the old editor each makes a test fail.
  • Browser: Chromium at 1440 px and 390 px against a local build with a disposable database and two empty libraries, before the review fixes listed under AI Disclosure. With no media, every preview showed its empty state; the thumbhash tiles and the review fixes are covered by tests only.
  • Hygiene: make verify-local-paths passes.
  • Not run: the Go gate and the contract and generated-binding verify targets, because this diff changes no Go, contract or generated input. Curated home sections — Web admin #1141 C1 and Curated home sections — Web #1142 C1 have not been walked on a running build.

Risks

No API, section_type, recipe ID or preset key changes, and hero behavior is unchanged. Stored config changes only when an admin picks a different variant: that variant's keys are written and the old variant's keys are dropped (for example Spotlight's subject, its rotation keys when switching to The 80s, or the older theme key on a seasonal row). The Anchor item field for Because you watched is gone from the form; an existing value stays in the config and keeps working. The admin-only recipe gating on Settings > Home Screen is untouched. silo-apple, silo-android and jellycompat need no change.

Until the library-copies PR lands, an admin can't add one row to several library pages at once; they add it to each page separately. That PR should merge right after this one on feat/collections-revamp.

New rows send position. Two admins adding a row to the same page at the same moment can get the same position; rows with the same position sort by ID, so both still show.

The holiday name fields keep the old editor's placeholder, Name in season (defaults to "Christmas"). #585 reports that the server doesn't apply that default, and this PR doesn't change that.

The launch bundle grows by 762 B brotli, all in the launch CSS from the dialog's Tailwind classes; the dialog's JavaScript is in the lazy-loaded admin page chunk. perf-budget.json goes from 319852 to 321326.

The user manual describes the gallery and the old editor. A siloserver.org issue covering the Add row dialog, plain row names, new rows at the bottom and the removed Anchor item field, 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, the planned scope and the server's recipe definitions, re-ran the web checks, and changed the code in a scratch copy to see which tests catch which defects. It found no blockers and eight smaller problems. Seven are fixed: switching an existing row to a collection or rule row lost the name, Number of titles and hero edits, and a 412 reload in that editor went back to the row's original kind; Continue Reading rows lost Change; rows with a single legacy holiday lacked their label and holiday checklist; the holiday checklist offered Family movie night and let an admin submit an empty list (the server would have rejected it); the phone sheet's wording differed from the design; the double-submit test passed without the guard; and Number of titles couldn't be cleared and retyped. The eighth, no way to add one row to several library pages until the library-copies PR, is by plan and is stated under Risks.

🤖 Generated with Claude Code

Note

Add unified AddRowDialog for creating and editing admin Home rows

Replaces the old recipe-gallery/bulk-creation workflow on the admin Home rows page with a two-step dialog: pick a row kind (grouped, searchable, with variant chips), then configure it with kind-specific fields, live preview, and a debounced preview query.

  • The draft model in rowDraft.ts handles preset initialization, variant switching, title-following behavior, and three-way conflict merging when a save is rejected because the row changed (RowChangedError on 412).
  • Row kinds handled by the legacy editor still work: the dialog bridges to SectionEditorDrawer.tsx with an initialType and carried title, item limit, and hero settings.
  • Adds supporting catalog metadata, picker groups, search, and variant-family catalogs in catalog.ts, search.ts, and variants.ts.
  • Behavioral Change: the Add Section button is now Add row; created rows are appended at the bottom of the page and highlighted for 2.5 seconds; the adapter capability field capabilities was renamed to serverCapabilities in useAdminHomeRows.ts.

Macroscope summarized f43c3a1.

Quick104 and others added 6 commits October 4, 2026 01:32
Admins added rows through a recipe gallery overlay, a separate config
drawer and a type select, and edited them in a sheet that showed raw
recipe settings. One Add row button now opens a two-step dialog: pick a
kind of row by group (with search and variant chips), then see a live
preview, pick the variant, name the row and open More options. Edit row
uses the same form with Shows · Change and Delete row…, and after a 412
Reload row keeps the user's changes and names what changed elsewhere.

Variants are inferred strictly and change only their own config keys, so
opening or renaming a row never rewrites its config. New rows send the
gallery's create body plus position max+1 so they land at the bottom.
Collection and rule rows still open the older editor until the dialog
gains their pickers. The unreachable Trakt creation path goes with the
gallery. The launch CSS grows with the dialog's utility classes, so the
bundle budget moves up by 1.5 KB.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…er editor

Changing an existing row to a collection or rule row opened the older
editor from the stored row, so a name, title count or hero change made in
the dialog was lost, though the Change step says they stay. A 412 reload
in that editor also dropped the picked kind and reopened the row's old one.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…escribes

Continue Reading rows lost Change, so an admin could only delete them;
only legacy Trakt rows must keep their kind. A legacy single-holiday
seasonal row now reads "Seasonal picks (Christmas only)" and its holiday
list starts from that holiday, as the old editor did, instead of offering
only the radios that replace it.

The holiday list no longer offers Family movie night, its own variant,
which flipped the row to that variant mid-edit. A list with no holiday
can't be saved: the server refuses it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…tles be retyped

On phones the picker now uses the mobile mockup's copy: a description that
carries the bottom-of-page note the footer has no room for, and a short
"Search rows" placeholder that isn't cut off at 390 px.

Number of titles snapped back whenever it was briefly empty or out of
range, so a new value took select-all and a valid first digit. It now
holds what is typed and keeps the last whole number from 1 to 100.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A double click in jsdom re-renders between clicks, so the disabled button
alone stopped the second one and the test passed without the guard. Two
clicks in one tick reach the handler twice; only the guard keeps it to
one POST.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@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: 00978f35-abdc-40af-80e8-5dfc45e51b31

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 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:33:01.187850Z f43c3a1 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.

@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: 1fd3c7e7c7

ℹ️ 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 +119 to +121
const [original, setOriginal] = useState<RowDraft | null>(() =>
initialSession ? draftFromRow(initialSession.row, catalog) : null,
);

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 Recompute the edit draft when the catalog arrives

If the sections request finishes before the recipe-catalog request, an admin can open Edit row while catalog is still undefined. This initializer then permanently records titleFollowsVariant as false; when the catalog later appears and the admin changes a default-named row to another kind or variant, pick() incorrectly preserves the old name instead of adopting the selected preset's name. Initialize only after the catalog settles, or reconcile the draft when it becomes available.

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 f43c3a1. When the catalog arrives after Edit row opened, the dialog recomputes whether the stored name is still the variant's preset name and updates the draft (unless the name was already edited). Test: "renames a row that kept its preset name when the kinds of rows load after it opened".

Comment on lines +243 to +249
const next = await adapter.reloadEdit(session);
if (!mounted.current) return;
const upstream = draftFromRow(next.row, catalog);
const merged = mergeReloadedDraft(original, draft, upstream);
setSession(next);
setOriginal(upstream);
setDraft(merged.draft);

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 Route reloaded collection rows through the collection editor

When another admin changes this row to a bridged kind such as collection while the dialog is open, a rejected save followed by Reload installs that collection draft directly into this form. This form has no collection selector, and the subsequent save calls buildRowUpdateRequest with an empty selectedCollectionId, replacing the stored collection reference with library_collection_id: "". Detect bridged kinds after reload and hand the refreshed session to onBridge instead of keeping it in this editor.

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 f43c3a1. After Reload, if the merged draft's kind is a bridged kind (collection, rules, genre, curated list), the dialog hands the refreshed session to onBridge with the draft's name, Number of titles and hero setting instead of keeping it in this form, so it is never saved with an empty collection reference. Test: "hands a row reloaded as a collection to the older editor instead of saving it here".

Quick104 and others added 2 commits October 4, 2026 08:26
…t/home-rows-dialog

# Conflicts:
#	web/src/pages/AdminHomeRows.tsx
…oads

A row opened before the kinds of rows loaded never learned that its name
was still the preset's, so picking another variant or kind kept the old
name. The dialog now works that out when the catalog arrives.

Reloading after a refused save could also pull in a row someone changed
into a collection or rule row; saving that from this form would have
cleared its collection. Those rows now go to the older editor, carrying
the name and More options.

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: f43c3a1048

ℹ️ 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 +108 to +110
const fromPerson = ["director", "actor", "studio"].includes(String(config.subject_type));
return fromPerson
? { ...rest, subject_type: option.values.subject_type }

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 Keep spotlight variants valid when switching subjects

When an existing spotlight is pinned (auto_rotate: false with a subject), switching between Director, Actor, or Studio enters this branch, drops subject, and preserves auto_rotate: false. The resulting config has no subject, so editorialSpotlightRecipe.Validate rejects the save with “subject is required when auto_rotate is false.” Preserve the subject or enable rotation when applying the new variant.

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

Base automatically changed from feat/home-rows-rowlist to feat/collections-revamp October 4, 2026 13:44
@Quick104
Quick104 merged commit c3f0e78 into feat/collections-revamp Oct 4, 2026
22 checks passed
@Quick104
Quick104 deleted the feat/home-rows-dialog branch October 4, 2026 13:44
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