Skip to content

fix(web): fix late review findings on the Home rows pages - #1913

Merged
Quick104 merged 11 commits into
feat/collections-revampfrom
fix/home-rows-review-followups
Oct 4, 2026
Merged

Quick104 merged 11 commits into
feat/collections-revampfrom
fix/home-rows-review-followups

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • When a reorder failed without a server answer, the page dropped the new order and kept the old version. If the server had applied the reorder, the row snapped back and the next reorder failed with 412. The page now reads the rows again before dropping the order, as the switch and hero actions already do.
  • Edit row treated a legacy collection row that stores only user_collection_id as having a collection and enabled Save. The admin endpoint requires library_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).
  • 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. A pinned row now takes the preset's weekly rotation.
  • Restore defaults got the row IDs and version from a fresh read, but titles and kinds from the cached list. A collection row that another admin added in the meantime was replaced without the dialog naming it. The dialog now names the rows from the same fenced read the restore is checked against.
  • Copy to other library pages limited only rows with a 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):

  • After a failed save, edits made while the page was reloading started from the old rows. If the save had landed anyway, the next full-page save undid it. Edits now wait for that reload, as they already do after a reset.
  • A change made right after switching profiles, while the previous profile's save was still in flight, could include that profile's unsaved rows. A change now starts from the current profile's own rows and names only rows that profile changed.
  • When a save succeeded but its overrides failed to reload, the next queued save could leave out a shown legacy Trakt row the first save had edited, losing the edit. A queued save now names the rows of the saves before it.
  • A row dropped during a reload landed by index in the reloaded list and could end up somewhere other than where it was dropped. It is now placed using the order the user dragged in.
  • A row the profile had just added and then moved went back to the bottom, because the save did not record positions for a row it had not read yet. It now does.
  • Edit row saved every field from the open dialog. If an admin changed the row's size, hero or content while the dialog was open, even a rename pinned the old values. Fields the user did not touch now keep the row's current values.

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: copyTargetPages takes the row instead of its config, and the profile hook's move takes the dragged order instead of a target row.

One review comment asked for a capability flag for the profile default_title field (#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 empty title override, which older servers already accept.

Validation

  • Vitest for the Home rows hooks, helpers, dialog, admin page and Settings > Home Screen page: pass, including one new test per fix.
  • make test-web: pass. On the first run, one existing 101-row select test in AdminHomeRows.concurrency.test.tsx timed 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.
  • I did not walk the affected cases in a browser.

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

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

It groups late review fixes for one stack, one commit per fix, so each can be reviewed or reverted separately.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code subagent
  • Model(s): claude-opus-5-5[1m]
  • Involvement: Fully AI-generated, human review pending
  • Adversarial review: n/a

🤖 Generated with Claude Code

Note

Fix late review findings on Home rows pages

  • Admin row dialogs now treat only the library collection identifier as selected. A legacy personal-collection row cannot be saved until a library collection is picked (AddRowDialog.tsx, rowDraft.ts).
  • Profile Home edits are isolated per profile, and after an uncertain save or reset the draft is held until the page is reread (useProfileHomeRows.ts).
  • Drag reorder now uses the complete order the user saw, so a moved row lands correctly even if other rows changed since (useProfileHomeRowsAdapter.ts, useAdminHomeRows.ts).
  • Bulk-copy destinations classify rows by canonical library kind (movie, TV, audiobook, ebook, podcast), so fixed-kind rows get their matching library pages (bulkCopy.ts).
  • Switching away from a pinned director, actor, or studio spotlight now applies the target preset's rotation settings instead of keeping the pinned subject (variants.ts); the admin Restore dialog names and counts rows from the exact version it restores (AdminHomeRows.tsx).
  • Behavioral Change: canSaveDraft and previewWaitText take a surface parameter; profile drafts still accept a personal collection identifier while admin drafts reject it. copyTargetPages now takes section type plus config instead of config only.

Macroscope summarized 651c909.

Quick104 and others added 9 commits October 4, 2026 09:38
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]>
@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: cb53873c-ba35-455d-a6f4-02cc9f21f319

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-04T19:29:32.820019Z 651c909 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: 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".

Comment thread web/src/lib/homeRows/bulkCopy.ts Outdated
currentId: number,
): LibraryPage[] {
if (typeof config.media_scope !== "string" || config.media_scope === "") return [...pages];
if (!showsOneKind(row)) return [...pages];

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

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

Base automatically changed from chore/home-rows-cleanup to feat/collections-revamp October 4, 2026 19:15
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]>

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

Comment on lines 259 to 260
const q = queue.current;
const changedIds = new Set(q.next?.kind === "save" ? q.next.changedIds : []);

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

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 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]>
@Quick104
Quick104 merged commit 66bc982 into feat/collections-revamp Oct 4, 2026
17 checks passed
@Quick104
Quick104 deleted the fix/home-rows-review-followups branch October 4, 2026 19:33
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