Skip to content

feat(web): show Home rows as one list with switches and a row menu - #1882

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

Quick104 merged 12 commits into
feat/collections-revampfrom
feat/home-rows-rowlist

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1137
Validation tasks: changes #1141 C1 (reorder, on/off, hero and delete now happen in the list and its row menu, and each row is described in a sentence instead of recipe badges); reaches #1137 AC1

Admin > Home rows shows each row as a table line with a recipe badge, an On/Off badge and pencil and trash buttons. To turn a row off or make it the hero banner, an admin has to open the full editor drawer, and the table doesn't say what a row will show. This PR replaces the table with the list from the approved Home rows design: one line per row with a description, an on/off switch and a ⋯ menu. Adding and editing rows, Restore Defaults and bulk delete still use today's dialogs and header buttons; later PRs in the series replace them. The API and saved data don't change.

Approach

Pills switch between Home and each library page, and a count such as "9 rows · 8 on" shows for the current page. The selected page is in the address as ?page=home or ?page=<libraryId>, so a link can open a library page; an unknown value opens Home. Each row has a drag handle, an icon for its kind of row (posters come in a later PR), its name, a yellow "Hero banner" tag on the hero row, a sentence built from its type and settings ("The next episode of every show each viewer follows · 20 titles"), an on/off switch and a ⋯ menu.

An off row collapses to a dashed line, "{title} is off. Nobody sees this row.", with the switch in the same place, so keyboard focus stays on it while the row collapses and expands. The ⋯ menu has Edit row… (the existing drawer), Use as hero banner or Stop using as hero banner, Move to top, Move to bottom and Delete row…. Delete opens a new confirmation dialog that keeps the warning about managed collections. Rows move by mouse, by touch after a 200 ms press on the handle, and by keyboard (Space, arrow keys, Space), and the screen-reader announcements name the row. After a move, focus goes to the moved row's ⋯ button; after a delete, to the next row's ⋯ (the previous row's for the last row, or Add Section when none are left). Library pages show the design's note that the rows sit above the library grid.

The list components in web/src/components/homeRows/ read only HomeRowsAdapter (web/src/lib/homeRows/types.ts), never the account role. useAdminHomeRows is the admin implementation. The profile wording is already there so Settings > Home Screen can use the same components in a later PR.

Writes from the list follow the existing version checks:

  • Switch, hero and reorder writes run one at a time. All admin row mutations, including the ones the old dialogs still run, now share one mutation key. Reordering, page switching and Restore Defaults stay disabled until a write and the list refetch after it finish, so a reorder is never sent with an outdated list version.
  • Before a switch or hero change, the page reads the row (one extra GET) and compares it with what it shows. If the row changed elsewhere, it sends nothing and shows "Home rows changed since you opened this page…" with a Reload rows button. A 412 on reorder shows the same banner and keeps the attempted order until Reload rows.

The old page tests move with the page to AdminHomeRows.*.test.tsx. The concurrency cases (412 on reorder, a refresh during a pending reorder, the page held while a reorder is pending, a failed first read, delete targets) now drive the menus and pills instead of the pencil, trash and tabs. The table row component and useReorderSections had no remaining callers and are removed.

Validation

  • Web: make test-web (762 files; 6938 passed, 3 expected failures already in the base), tsc -b, pnpm run lint (0 errors; the one warning in a changed file is on a line this PR doesn't touch), format:check, build and budget:check pass.
  • Tests: jsdom tests render the list and cover the row sentences, the switch and its focus, the hero item, menu moves and where focus goes, keyboard reorder through dnd-kit, the touch delay, the page pills and ?page= links, the changed-elsewhere banner, write ordering, reordering held after writes from the old dialogs, and the error shown when libraries fail to load. Removing the row comparison, the wait for the refetch, the kept order on 412, touch-none, the 200 ms delay or the version captured at drag start each makes a test fail.
  • Browser: the Home page, a library page, the row menu and a phone-width layout were checked in Chromium against a local build with a disposable database, before the review fixes listed under AI Disclosure. Those 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 has not been walked on a running build.

Risks

No API, stored data, section_type value, recipe ID or preset key changes. The hero menu item sends the same featured field as the drawer, and hero behavior is unchanged. The gallery's admin-only recipe gating is untouched. silo-apple, silo-android and jellycompat need no change.

Changes an admin will notice beyond the new layout: Escape clears the row selection only when pressed inside the list, not from an open menu or dialog and not during a drag. The delete dialog is titled "Delete {title}?" with a "Delete row" button. The list's "Reload order" button and the "Reload sections" button shown after a failed read are now "Reload rows"; the Restore Defaults dialog keeps its "Reload sections" button for now. The selection checkboxes stay on every row until a later PR adds a select mode.

Saves from the old drawer and delete dialogs don't join the list's one-at-a-time queue; reordering waits for them and their refetch, and later PRs move them into the queue. Rule rows say how many rules they have but not what the rules are, and collection rows don't say whether the collection is manual, smart or a synced list; a later PR adds both.

The user manual describes the old table. A siloserver.org issue covering the switch, the collapsed off rows and the ⋯ menu, 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 changed the code in a scratch copy to see which tests catch which defects. It found no blockers and seven smaller problems, all fixed. Writes from the old dialogs and Restore Defaults didn't wait for the list to refetch, so a reorder right after a delete could fail on an outdated version. Toggling one row twice quickly briefly showed the old state. A ?page= link stayed on "Loading rows…" if libraries failed to load. Tests didn't pin the version captured at drag start or the touch delay. Default rule rows read "All movies" whatever their sort order. The list's accessible name was announced twice. Some section code was left without callers.

🤖 Generated with Claude Code

Note

Show Home rows as one list with switches, row menus, and drag-to-reorder

  • Replaces the old AdminSections table page with a shared HomeRowsPage component tree (HomeRowsPage.tsx), rendering rows in a single sortable list with per-row visibility switches, overflow menus, and page switching between Home and libraries
  • Rows can be reordered by mouse, press-and-hold touch, or keyboard; reorders submit the order token captured at drag start and preserve the attempted order on conflict
  • The admin adapter (useAdminHomeRows.ts) handles optimistic visibility writes, ETag-protected updates, serialized quick actions, and stale-data conflicts; 412/404 responses route to conflict handling instead of error toasts
  • Row descriptions, switch labels, and collapsed-row wording are generated per surface and page in describe.ts, and row kinds get labels and picker groups in catalog.ts
  • Behavioral Change: deletes the /home-rows route's old AdminSections module and the exported SortableSectionTableRow; the route now loads AdminHomeRows (App.tsx), and SectionSummaryBadges no longer renders library, collection, or enabled badges

Macroscope summarized e264a94.

Quick104 and others added 10 commits October 3, 2026 23:53
Admin Home rows was a table with Featured and Enabled columns, Home/Library
tabs and a library select. It is now the approved one-list layout: page pills
for Home and each library (deep-linkable with ?page=), one line per row with
a plain sentence and title count, an on/off switch that collapses off rows to
a dashed line in place, and a ⋯ menu with Edit row…, hero banner, Move to
top/bottom and Delete row….

The list components live in components/homeRows and read only a surface
adapter, so Settings > Home Screen can reuse them. The admin adapter runs
switch, hero and reorder writes one at a time, reads each row before a quick
action and refuses to write when it changed elsewhere, and keeps reordering
and page switching disabled until the refetch after each write lands, since
any row write bumps the version a reorder is checked against. Keyboard
reorder announces rows by title, touch drags start from the grip after a
short press, and focus returns to a neighbour's menu after a delete or move.

Adding, editing, Restore defaults and bulk delete still use the existing
dialogs and header buttons until the follow-up PRs replace them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
At 390 px the 74 px art column and the hero tag next to the name left the
row title no width at all. Phones now get a 48 px art column, and the hero
tag moves onto the description line, as the mobile mockup draws it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Delete, edit, add and restore ran outside the list's write queue, so right
after a delete the list still offered a reorder against the old page version
and it failed with a conflict. Every admin row write now carries one mutation
key; the list stays pending while any of them runs and until its refetch
lands, and Restore Defaults waits for the same fence.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Turning a row off and back on quickly queued two writes. When the first
finished it cleared the row's on-screen value, so the row snapped back to
off until the second write landed. Only the newest toggle of a row and
field now clears that value.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A Home rows link to a library page waits for the library list before it
reads rows. If that list failed to load, the page stayed on "Loading rows…"
with every action disabled. It now shows the read error, and Reload rows
retries the libraries.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The keyboard reorder test used a version that never changed, so it could
not tell the version captured at pickup from the current one, and nothing
checked the 200 ms press-and-hold that keeps touch swipes scrolling. Both
are now asserted; the delay constant is no longer exported.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The default "Top Rated Movies" and "Recently Released Episodes" rows have no
rules, so the list called them "All movies" and "All episodes". A rule row
with no rules now says how it is ordered ("All movies, highest rated
first"), and a library page's Recently added row names what it holds
("Newest movies in this library"), as in the approved design.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The list's panel and the list inside it both carried "Rows on Home", so a
screen reader announced the same name for a region and then for the list.
Only the list keeps the name now.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The new list replaced the only callers of useReorderSections and of the
library, collection and on/off badges in SectionSummaryBadges. The row kind
catalog stays for the Add row picker and now has its own test.

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: 8fe4d809-433f-46ed-82c9-bc9189c55082

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:30:43.351544Z e264a94 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: ce79756853

ℹ️ 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 +124 to +125
onChange={adapter.setPage}
disabled={adapter.pending}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Cancel stale snapshots when switching pages

The page switcher remains enabled while snapshotLoading is true because it only observes adapter.pending. If an admin starts Edit, Delete, bulk delete, or Restore Defaults and switches pages before the snapshot request finishes, snapshotRequest is not incremented, so the old request can open a dialog on the new page and a confirmation can update, delete, or restore rows from the previous page. Disable page switching during snapshot reads or invalidate pending snapshots when the page changes.

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.

Confirmed and fixed in ce353ad. Changing pages now invalidates any pending Edit, Delete, bulk delete, or Restore Defaults read, so a read that finishes on another page no longer opens its dialog. A new test covers Delete, Edit, and Restore Defaults: it switches pages mid-read and checks that no dialog opens and nothing is written.

Comment on lines +227 to +230
} catch (error) {
if (isStale(error)) setConflict({ scope: "row", rowId: id });
else toast.error(adminSectionMutationMessage(error, "Could not save this row"));
} finally {

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 Reconcile quick actions after transport failures

When the server applies the PATCH but the connection drops or the response body is truncated, updateAdminSection rejects even though the row changed. This catch path only reports an error and then clears the optimistic value, leaving the UI on the old state; the next action also sees the server snapshot differ and raises a conflict. Treat non-definitive transport failures as an unknown outcome and refetch the list before settling the displayed value.

AGENTS.md reference: AGENTS.md:L13-L18

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.

Confirmed and fixed in e264a94. When a quick action fails without a server answer (anything other than a problem response, such as a dropped connection or a cut-off body), the page now rereads the list before clearing the optimistic value. The row then shows what the server holds, and the next action on it does not report a false conflict. A new hook test applies the PATCH, drops the response, and checks both.

Quick104 and others added 2 commits October 4, 2026 08:24
The page switcher stays usable while an Edit, Delete, bulk delete or
Restore Defaults read is in flight. A read that finished after the admin
moved to another page still opened its dialog there, so a confirmation
could change rows on the page the admin had left. Changing pages now
invalidates any pending read.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
If the connection drops or the response body is cut off after the server
applied a switch or hero change, the row went back to its old value on
screen and the next action on it reported a conflict. A failure without a
server answer now rereads the page before the row's value settles.

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

ℹ️ 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 +258 to +260
} else {
setDraft(null);
toast.error(adminSectionMutationMessage(error, "Could not move this row"));

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 Re-read the order after an ambiguous reorder failure

When the reorder PUT is applied but its response is lost or truncated, this branch clears the draft and only shows a toast, leaving the cached rows and ETag at the previous order. The row therefore snaps back in the UI, and the next reorder receives a 412 even though the first change succeeded. Treat transport failures as an unknown outcome and refetch the current list—or retain a conflict requiring reload—before clearing the draft.

AGENTS.md reference: AGENTS.md:L73-L75

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

@Quick104
Quick104 merged commit 305756a into feat/collections-revamp Oct 4, 2026
22 checks passed
@Quick104
Quick104 deleted the feat/home-rows-rowlist 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