Repository navigation
feat(web): build Settings > Home Screen from the Home rows components - #1905
Conversation
Settings > Home Screen now uses the same list, row menu, More menu and Add row dialog as admin Home rows, through a profile adapter: page pills with ?page=, a switch that hides, Edit row (Shows locked on server rows), "Renamed from" with Use the original name, Remove from my Home / Delete row, export, import and reset under More, and the Hide watched items card. Rule rows follow #1118: admin accounts keep them, other accounts only while the server allows them. A page that still holds a profile's rule rows while they are off is locked, with one save that deletes them all, because the server refuses every save of that page until they are gone. Profile saves now store only what the profile changed (hidden, removed, title, the fields it edited, and positions once it orders the page), so later admin edits reach every profile except in what it changed itself. Overrides saved before keep their pinned fields until a reset. The admin Edit row subtitle says so. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The personal collection list also holds collections other profiles on the account shared, so a row showing a sibling's shared collection read "Your Rainy days collection". Rows now say "Your" only when the acting profile made the collection, and "The" otherwise. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A burst of profile saves sends a draft built from the rows as read at the first change, but compared it with the rows as refetched after the save before it. An admin edit landing in between looked like a profile change, so the profile pinned the admin's old value (or every row's position after an admin reorder). Each save now compares the draft with the rows it was built from, so only what the profile changed is stored. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Settings > Home Screen page now speaks of rows and of resetting to the server's rows, but its toasts still said "sections" and "default". 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b98ed79b26
ℹ️ 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".
| for (const override of savedOverrides) { | ||
| if (override.section_id && override.id) savedIds.set(override.section_id, override.id); | ||
| if (override.section_id && override.id) saved.set(override.section_id, override); |
There was a problem hiding this comment.
Preserve ID-less saved overrides during partial saves
When a server-row override was saved without an id—a shape the v2 API accepts and returns with an empty ID—this condition drops it from saved. The new partial-save path then treats that row as never overridden and either omits it or rebuilds only the current edit; because the subsequent PUT replaces the entire override set, changing any row can silently erase existing title, hero, size, or config customizations on ID-less overrides. Index overrides by section_id regardless of ID, and generate a replacement ID only when writing them back.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 87af48c. The builder now reads saved overrides by section_id whether or not they have an ID, and gives an ID-less one a new ID when it writes it back, so a later save keeps its title, size, hero and config. A shown legacy Trakt row with only an ID-less override is still left out, as before, because the server refuses a new override ID that leaves such a row showing. New test: "keeps what an earlier save without an ID stored, under a new ID" (fails without the fix).
| onChange: | ||
| kindLocked(draft.config) || session?.kindLocked | ||
| ? undefined | ||
| : () => setStep("pick"), |
There was a problem hiding this comment.
Apply the server-row lock to content controls
For a server-owned collection, filter, or curated-list row, session.kindLocked only removes the Shows “Change” action. RowForm still renders an active CollectionPicker, RuleBuilder, or CuratedTitlesEditor, and buildProfileRowUpdate persists the resulting config, so a profile can change the collection, rules, or hand-picked titles that the administrator's row shows despite this surface intending to lock that content. Propagate the lock to those controls rather than only to the kind picker.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 31c7f2a. RowForm takes a contentLocked prop, which AddRowDialog sets from session.kindLocked. A server row on Settings > Home Screen then gets no collection picker, rule builder, rule order or Editor's Picks title list, so its config only changes through the variant, which the design allows. New page test: "doesn't offer to change a server row's collection, rules or picked titles" (fails without the fix).
| const pageLock = useMemo<ProfilePageLock | null>(() => { | ||
| // Unknown until the flag loads; a save refused meanwhile still says why. | ||
| if (ruleRows || !flags.isSuccess) return null; | ||
| const kinds = ruleRowKinds(catalog); | ||
| const rowIds = sections |
There was a problem hiding this comment.
Wait for the recipe catalog before enabling locked pages
When the profile flag has loaded as disabled but the recipe catalog is still loading or has failed, ruleRowKinds(undefined) only recognizes filter kinds and misses non-filter admin-only recipes such as admin_curated_list. A page containing one of those profile-added rows therefore remains editable, but the server rejects every save that retains it. Keep editing unresolved or failed until the catalog can determine the complete lock set, and expose an appropriate retry state on failure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in b7eb626. When rule rows are off for this profile and the page holds rows it added, editing now waits for the recipe catalog (pageLockCheck is loading). If the catalog fails, the page shows "The kinds of rows didn't load, so this page can't change right now." with Try again, which refetches it. The lock is computed only once the catalog is known. New page test covers a failed catalog with a profile-added Editor's Picks row: the page stays read-only, and after Try again it shows the lock note naming that row (fails without the fix).
|
The Suggested fix (no diff): replace the Validation tasks line with:
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
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 |
…into feat/home-screen-home-rows # Conflicts: # web/src/hooks/queries/homeRows/useProfileHomeRows.test.tsx # web/src/hooks/queries/homeRows/useProfileHomeRows.ts # web/src/pages/AdminHomeRows.tsx # web/src/pages/settings/HomeScreenSettings.page.test.tsx
The v2 API accepts and returns section overrides without an ID. The partial-save builder skipped those when reading the saved set, so the next save of any row dropped the title, size, hero or config they held. Read them by section and give them a new ID when writing them back. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…file edits Settings > Home Screen locks what a server row shows, but the lock only removed the Shows "Change" button. Edit row still offered the collection picker, rule builder, rule order and Editor's Picks list, and the save stored their config, so a profile could change what the admin's row 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: 33b38b601e
ℹ️ 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 ordered = | ||
| !baseline || | ||
| savedOverrides.some((o) => o.section_id && o.position !== undefined) || | ||
| stableJson(sharedOrder(sections, baseline)) !== stableJson(sharedOrder(baseline, sections)); |
There was a problem hiding this comment.
Count pending new rows when detecting a reorder
When a profile adds a row and moves it before the create save and refetch finish, baseline does not contain the new ID, so both sharedOrder calls discard it and ordered remains false whenever the pre-existing rows retain their relative order. The custom row is consequently serialized with its original append position and snaps back after the refetch, silently losing the move; detect placement changes involving IDs absent from the baseline as ordering changes.
Useful? React with 👍 / 👎.
| const overId = sections[orderedIds.indexOf(movedId)]?.id; | ||
| if (overId) move(movedId, overId); |
There was a problem hiding this comment.
Resolve drag targets from the captured row snapshot
If the sections query refetches while a drag is active—for example after reconnecting or after another editor changes the page—orderedIds still describes the snapshot captured at drag start, but this lookup applies its index to the current sections. An inserted, removed, or reordered row can therefore select the wrong overId and persist a different move from the one shown; derive the target from the captured IDs rather than the live array.
AGENTS.md reference: AGENTS.md:L71-L75
Useful? React with 👍 / 👎.
With rule rows off for profiles, a page holding an Editor's Picks row the profile added is locked too, but only the recipe catalog says that kind is admin-only. While the catalog loaded or after it failed, the page stayed editable and the server refused every save. Editing now waits for the catalog when the page has rows the profile added, and a failed load offers Try again. 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: b7eb62653a
ℹ️ 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 section = sectionFor(session.row.id) ?? (session.token as SettingsSectionEntry); | ||
| saveSection(buildProfileRowUpdate(section, draft, draft.title)); |
There was a problem hiding this comment.
Preserve upstream fields when saving a stale edit
When a server row refetches while Edit row is open—for example, after an administrator updates it in another tab and this tab regains focus—section is the latest row, but draft still contains the originally opened hero, size, and config. buildProfileRowUpdate applies those stale draft values, so even a name-only save creates profile overrides that pin the old values and content instead of inheriting the administrator's update. Merge only fields changed relative to session.row, or treat the upstream change as a conflict.
Useful? React with 👍 / 👎.
Problem
Related issue: #1137, #989
Validation tasks: changes #1142 C2 (a profile reorders, hides and renames its rows on the new page, and saves store only the fields it changed); reaches #1142 C3 (poster peeks come from the profile's own Home routes, so they show only titles it can open) and #1181 C1 (Home rows stay per profile). All three are Not run, so no recorded result changes.
Stacked on #1901 (Home Screen save hook), so this targets
refactor/home-screen-save-hook. #1901 sits on #1900 and #1898, and through them on the rest of the Home rows series down to #1882. It retargets tofeat/collections-revamponce those merge.Settings > Home Screen still uses the old section editor: a scope select, a table of sections, a recipe gallery and a separate export and import card. Admin Home rows has been rebuilt as one list with switches, a row menu and an Add row dialog, so the two pages now look and work differently. The old page also stores a copy of every server row's title, hero, size and config the first time a profile changes anything. After that, an admin's edits to those rows never reach the profile. The profile also can't tell that a row was renamed, or get the server's name back.
This PR rebuilds Settings > Home Screen on the Home rows components the admin page uses, following the approved design. From now on a save stores only what the profile changed, and a renamed row says what it was renamed from and offers the original name back.
Approach
?page=opens a library page directly. Each row has a switch ("Show {title} on my {page}"). Hidden rows collapse to a dashed line. Rows the profile added carry a Yours tag, and the header counts rows and shown rows. The row menu has Edit row…, Use the original name, the hero banner item, Move to top and Move to bottom, plus Remove from my {page}… for server rows or Delete row… for the profile's own rows. Export layout, Import layout… and Reset {page} to the server's rows… are under More. Add row shows no live preview on this page. The Hide watched items card sits under the list. Settings search now finds Home rows, Hide watched items, Export layout, Import layout and Reset Home.default_title(feat(api): return a profile row's server title in profile section settings #1900) shows "Renamed from X". Use the original name saves the row without a title, so it follows later admin renames again.Differences from the approved design, for sign-off:
Validation
make test-web(791 files, 7285 tests passed),pnpm run lint(0 errors; nothing reported in changed files),format:check,build,tsc -bandbudget:checkpass.make verify-local-pathspasses.?page=; Renamed from and Use the original name; export, import and reset under More, with focus back on More; peeks calling only the profile's routes; the rule-row capability for admin and other accounts; and the page lock and its one-save delete. Override-builder tests cover each case of storing only changed fields, and a hook test covers an admin edit that lands between two back-to-back saves. Six of the new override-builder tests fail against the base branch's code. One existing hook test was changed on purpose: the first save now holds only the row it changed.?page=. A rename sent onlytitle, a hide sent onlyhidden: true, and an added row stored every field after the admin rows' positions.Risks
This changes what new profile saves store. Admin edits now reach every profile that hasn't changed that field, which is the intent. Profiles that saved before this PR keep their pinned values until they use Reset. Saves from other tabs or devices are still last-write-wins.
No API, stored format,
section_type, recipe ID, preset key, layout export/import or hero change. The page readsdefault_title, which #1900 adds. silo-apple and silo-android don't call the profile section settings route, and jellycompat reads the resolved rows, so none of them need a change.The user manual describes the old Home Screen page. A siloserver.org issue covering this page, along with the rest of the Home rows changes, is drafted and not filed yet.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Build Settings > Home Screen from shared Home rows components
HomeRowsPageand a profile adapter. The page now covers row editing, hiding, renaming, original-name restore, removal, hero selection, rule-row deletion, reset, and layout export/import.buildSectionOverridesin profileOverrides.ts.creator_profile_idfrom useAllUserCollections.ts.reorder; queued saves keep the edit-time baseline so intervening server edits are not pinned as profile overrides.Macroscope summarized b7eb626.