Repository navigation
fix(web): fix late review findings on the Home rows pages - #1913
Conversation
A reorder that failed without a server answer dropped the order on screen and kept the cached rows and version. If the server had applied it, the row snapped back and the next reorder failed with 412. The reorder now refetches the page before dropping the order, as the switch and hero actions already do. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…it row The admin sections endpoint rejects a collection row without library_collection_id. Edit row read a legacy admin row's user_collection_id as its selection and enabled Save, so a rename or hero change sent the legacy config back and failed with 400. The dialog now reads the selection the way its surface does: on the admin surface a legacy row opens with no collection, Save stays off, and picking a library collection replaces the legacy key, as the old drawer already did. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Switching a pinned Director, Actor or Studio spotlight to another of
the three dropped its subject but kept auto_rotate false, which the
server refuses ("subject is required when auto_rotate is false"). The
switch now carries the rotation over only from a rotating row; a
pinned row takes the preset's weekly rotation, as an era row already
did.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… over Restore read the page's row IDs and version fresh but took the rows' types and titles from the cached list. A collection row another admin added after the list loaded was replaced without the dialog naming it. Restore now reads the page's rows through the same fenced read the list uses and names the collection rows from that read. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Copying a row to other library pages restricted only rows with a media_scope. Continue Listening, Continue Reading (including the legacy filter_type form) and Next in Series show audiobooks or ebooks only, yet Movies and TV pages were offered and the copies stayed empty. These rows now go only to pages of the current page's library type. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Three gaps in the Settings > Home Screen save queue could write a stale page over a newer one: - After a save failed with no newer change queued, edits made during the refetch started from the rows read before it. If the save had landed, the next full-page save undid it. Edits now wait for that refetch, as they already wait for a reset. - A change made after switching profiles, while the last profile's save was in flight, started from that profile's unsaved rows. A change now starts over when the draft belongs to another profile. - A newer change named only its own rows. When the save before it succeeded but the overrides failed to reload, a shown legacy Trakt row that save had edited was left out of the next save and its edit was lost. A newer change by the same profile now names the rows of the saves before it, whether they failed or not. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A profile row drop looked up its target by index in the current rows. If the rows refetched during the drag, a row added, removed or moved underneath could pick a different target and save a move other than the one shown. The move is now placed from the order captured when the drag started: before the next row there still on the page, or after the one before it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A save stored positions only once the rows already on the page changed order. A row the profile added and then moved before the add's refetch landed was not in the page as read, so the move was not seen and the row went back to the bottom. A save now also stores positions when a row added since the page was read is no longer at the bottom in the order it was added. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Saving Edit row on Settings > Home Screen applied every field from the dialog onto the row as refetched. When an administrator changed the row's size, hero or content while the dialog was open, even a rename stored the old values as profile overrides and pinned them. Fields the user left as the dialog opened them now take the row's current values. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
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 |
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: 7d5e642453
ℹ️ 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".
| currentId: number, | ||
| ): LibraryPage[] { | ||
| if (typeof config.media_scope !== "string" || config.media_scope === "") return [...pages]; | ||
| if (!showsOneKind(row)) return [...pages]; |
There was a problem hiding this comment.
Derive copy targets from the row's content kind
When a legacy Continue Listening, Continue Reading, or Next in Series row already lives on an incompatible page—which is possible because these rows were previously copyable to every library—this branch filters targets using the current page's type rather than the content type encoded by the row. For example, Continue Listening on a Movies page still offers only other movie libraries, where it remains empty, while excluding the audiobook libraries that could use it; Reading has the analogous ebook failure. Determine the required target kind from continue_type/filter_type or sectionType, then compare canonicalized library kinds instead of inheriting the source page's kind.
AGENTS.md reference: AGENTS.md:L30-L34
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in bd893c1. Continue Listening and Next in Series now target audiobook libraries and Continue Reading targets ebook libraries, whatever page the row is on. Library types are compared by kind ("tv"/"series", "audiobook"/"Audiobooks"). Rows with a media_scope still follow their page's kind.
A Continue Listening, Continue Reading, or Next in Series row left on a page of another library type offered only pages of that page's type, where it stays empty, and none of the book libraries that could use it. Take the kind from the row and compare library types by kind, so "tv" and "series" or "audiobook" and "Audiobooks" match. 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: bd893c1b0c
ℹ️ 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 q = queue.current; | ||
| const changedIds = new Set(q.next?.kind === "save" ? q.next.changedIds : []); |
There was a problem hiding this comment.
Reset queued changed IDs when switching profiles
When a save is still in flight and another edit is queued, switching profiles before making the next edit leaves the previous profile's q.next.changedIds in this new profile's save. The new state is built from the new profile's baseline, but those stale IDs still mark rows as changed, so buildSectionOverrides can write overrides for rows the new profile did not edit (for example, copying the previous profile's row state into the child profile). Only carry the queued IDs when q.next.profile matches the newly captured profile; the surrounding comments state that queued changes from another profile are dropped.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 651c909. A change now carries queued row IDs only when the queued save belongs to the same profile. The new test switches profiles while a legacy Trakt row edit is queued and checks that the next profile's reorder leaves that row out.
A change made right after switching profiles carried the row IDs of the previous profile's queued save. Those IDs still counted as changed, so a reorder by the new profile wrote an override for a shown legacy Trakt row it never touched. Carry queued IDs only from the same profile. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Problem
Related issue: #1137
Validation tasks: changes #1141 C1 (admin Home rows: reorder recovery, editing a legacy collection row, switching a pinned spotlight, the Restore defaults dialog, and copying rows to other library pages); changes #1142 C2 (a profile hides, reorders, renames and edits its rows on Settings > Home Screen)
Late review comments on the Home rows stack found eleven ways the new Home rows pages could save something other than what the user saw, or refuse a save they should accept. This PR fixes all eleven on top of the stack. Each fix comes with a test that failed before it.
Admin Home rows:
user_collection_idas having a collection and enabled Save. The admin endpoint requireslibrary_collection_id, so even a rename failed with 400. On the admin page, such a row now opens with no collection selected and needs a library collection picked, like the old editor (fix(web): keep a Home row's collection when it isn't in the picker list #1884).auto_rotate: false, which the server refuses. A pinned row now takes the preset's weekly rotation.media_scope. Continue Listening, Continue Reading and Next in Series were offered to Movies and TV pages, where their copies stay empty. These rows now go only to libraries of the kind they show (audiobooks for Continue Listening and Next in Series, ebooks for Continue Reading), even when the row sits on a page of another type. Library types are compared by kind, so "tv" matches "series".Settings > Home Screen (profile):
Approach
All changes are in the web client and stay inside the Home rows hooks and helpers that own each behavior. Two internal signatures change:
copyTargetPagestakes the row instead of its config, and the profile hook'smovetakes the dragged order instead of a target row.One review comment asked for a capability flag for the profile
default_titlefield (#1900). That PR does not need one, and this PR does not add one. The field is always present on servers that support it, and older servers omit it. Restoring a name saves an emptytitleoverride, which older servers already accept.Validation
make test-web: pass. On the first run, one existing 101-row select test inAdminHomeRows.concurrency.test.tsxtimed out under full-suite load. It passes when run alone and passed when the whole suite was run again.tsc -b,pnpm run lint(0 errors),pnpm run format:check,pnpm run build,make verify-local-paths: pass.Risks
No API or schema changes. On Settings > Home Screen, editing is now briefly unavailable while the page reloads after a failed save. On a library page, Continue Listening, Continue Reading and Next in Series rows offer fewer pages to copy to.
Checklist
It groups late review fixes for one stack, one commit per fix, so each can be reviewed or reverted separately.
AI Disclosure
🤖 Generated with Claude Code
Note
Fix late review findings on Home rows pages
canSaveDraftandpreviewWaitTexttake a surface parameter; profile drafts still accept a personal collection identifier while admin drafts reject it.copyTargetPagesnow takes section type plus config instead of config only.Macroscope summarized 651c909.