Repository navigation
feat(web): move rare Home rows actions under More - #1889
Conversation
Restore Defaults, Delete All and Delete Selected sat in the page header and every row carried a checkbox all the time, although these actions are rare. The header now holds only More and Add row (docked at the bottom under 1024px). More opens Select rows, a select mode with a floating bar that turns up to 100 rows on or off (each row checked against the page first, four at a time, one refetch) or deletes them, and Restore defaults…, whose dialog says which rows go, that their collections stay, which pages are untouched, and what resetting every profile clears. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The select-mode bar was sticky, but AdminLayout's root clips horizontal overflow, which made it the bar's scroll container: the bar sat at the end of the list, so an admin picking rows near the top had to scroll down to reach Turn on, Turn off or Delete. Pin it to the viewport over the content column and reserve room at the page's foot so the last row stays clear. The bar is now a labelled group rather than a toolbar without arrow-key focus, and the count is announced once, by its status line. Tests now cover Shift+Space read from the key down and the bar staying off while a row write and its refetch are in flight. 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: b9a918fe9f
ℹ️ 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 writeOne = async (id: string): Promise<BatchFailure["reason"] | null> => { | ||
| const section = onScreen.get(id); | ||
| if (!section) return "changed"; | ||
| if (section.enabled === shown) return null; |
There was a problem hiding this comment.
Verify skipped rows before reporting success
If another admin changes a selected row from the requested state after this page loaded—for example, turns on a row that still appears off locally—this early return skips fetchAdminSectionSnapshot and never detects the conflict. The final refresh then shows the row as on, while reportShownBatch receives neither a change nor a failure and announces that the selected rows were already off. Validate the current snapshot before treating an apparently unchanged row as skipped so the batch either applies the requested state or reports the concurrent change.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 32f4225. A batch now reads every selected row before it skips one, so a row another admin flipped after the page loaded is reported as changed and not as "already off". A new test in useAdminHomeRows.test.tsx covers this case.
|
Minor validation impact — #1141 C1 (Curated home sections — Web admin). Restore and delete actions move under More/select mode, and Add row moves to a narrow-screen dock; the normal create and reorder paths remain unchanged. C1 is currently Not run, so no prior result is invalidated. Run C1 against the merged UI and record the tested build. The PR's Suggested fix: No code diff is needed; validate #1141 C1 on the merged UI and record the build. Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
…nto feat/home-rows-more-menu
Select-mode Turn on/off skipped rows that already looked right on the page without reading them, so a row another admin had flipped since the page loaded was announced as "already off" while the refetch showed it on. Read every selected row first and report a mismatch as changed. 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: 32f4225f4f
ℹ️ 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 restoreRowIds = new Set(restoreSnapshot?.ordered_ids ?? []); | ||
| const restoreCollectionTitles = adapter.sections | ||
| .filter((section) => restoreRowIds.has(section.id) && section.section_type === "collection") | ||
| .map((section) => section.title); |
There was a problem hiding this comment.
Read collection details from the restore snapshot
If another admin adds a collection row or changes a row into one after this page's list loaded but before Restore opens, restoreSnapshot contains the current IDs and ETag while adapter.sections still contains the stale definitions. The dialog can therefore omit the collection warning or show obsolete titles, yet the restore succeeds against the fresh ETag and replaces those rows. Fetch the row definitions under the same scope-version fence used for the restore confirmation instead of combining a fresh order snapshot with the cached list.
Useful? React with 👍 / 👎.
Problem
Related issue: #1137
Validation tasks: changes #1141 C1 (Delete All and Delete Selected become More > Select rows > Delete…, and Restore defaults moves under More with new wording)
Stacked on #1885, so this targets
chore/home-rows-trakt-cleanup(#1885 sits on #1884, #1883 and #1882). It retargets tofeat/collections-revamponce those merge.The Admin > Home rows header keeps rarely used, destructive actions next to Add row: Restore Defaults, Delete All, and Delete Selected once rows are ticked. Every row also shows a selection checkbox all the time. Delete All is one click and a confirm away from emptying the page, and there is no way to turn several rows on or off at once. This PR leaves only More and Add row in the header, with Select rows and Restore defaults… under More. Select rows opens a select mode where up to 100 rows can be turned on, turned off or deleted together. The Restore dialog now says what it replaces, that collections stay in Collections, and what resetting profiles clears. This is the More menu step of the approved Home rows redesign.
Approach
More is a menu with two items, each with one line of help. Select rows: "Turn several rows on or off, or delete them together." Restore defaults…: "Put back the rows Silo starts with on this page."
In select mode, checkboxes replace the drag grips and dragging is off. A line above the list holds Select all (mixed when only some rows are picked), "Up to 100 rows at a time" and Done. Shift-click and Shift+Space select a range, using the existing
checkboxSelectionhelper. Escape or Done leaves select mode and puts focus on More. Escape in an open row menu or dialog closes only that menu or dialog. A bar at the bottom of the window reads "N selected · Turn on · Turn off · Delete…". It is fixed to the window rather than sticky, because the admin layout'soverflow-x-hiddenroot stops sticky positioning from working; the page adds bottom padding in select mode so the bar never covers the last row.Turn on and Turn off write each row the way its switch does: read the row's version, check it still matches the page, then PATCH
enabledwith that ETag. They work on 4 rows at a time and refetch the list once at the end. A row that changed elsewhere is skipped, and a toast names it. Rows already in that state are skipped, and old Trakt rows are never turned back on. Drag, page switching, Restore and the bar's buttons stay disabled until that refetch lands, so the next write uses the new page version. Delete… uses the existing delete flow: it reads the row versions before the new "Delete N rows?" confirm, and rows that fail to delete stay selected.Restore defaults… reads the page version when it opens. It sends the same request as before;
reset_profilesis true only when the switch is on and the server reports that capability. Without the capability, the "Also reset every profile's {page}" switch is disabled with "Resetting profiles isn't available on this server." A 412 keeps the dialog open, shows a warning with Reload rows, and hides Restore until the admin reloads.Below 1024 px, More (48 px) and a full-width Add row sit in a bar docked to the bottom, and the menu opens upward. In select mode the selection bar takes the dock's place. Row switches and ⋯ buttons get 44 px tap targets. The shared
Checkboxcomponent now draws a minus for the mixed state; its only other user, the Add row dialog's settings fields, never sets that state.Differences from the approved design and plan, for sign-off:
Validation
make test-web(774 files, 7106 tests passed),pnpm run lint(0 errors, no warnings in changed files),format:check,build,tsc -bandbudget:checkpass. The launch bundle measures 321592 B brotli, 266 B overperf-budget.jsonand inside the check's 1024 B tolerance, so the budget file is unchanged.reset_profilesvalue, the bar's wait for a pending write, or the Shift+Space handling each makes a test fail. jsdom can't check that the bar stays in view; the browser run below does.make verify-local-pathspasses.Risks
The page sends the same requests as before: the per-row PATCH with the row's ETag, the restore PUT with the page's ETag, and the existing delete flow. No API, stored data,
section_type, recipe ID, preset key, layout export/import or gating change, and hero behavior is unchanged. silo-apple, silo-android and jellycompat need no change.Admins used to the header buttons have to find them under More; Delete All is now More > Select rows > Select all > Delete…. Each menu item carries a help line.
Turn on or Turn off makes two requests per row (read, then write), 4 rows at a time, for at most 100 rows.
The user manual describes the old header buttons. A siloserver.org issue covering More, select mode and the new Restore dialog, along with the rest of the Home rows changes, is drafted and not filed yet.
Checklist
AI Disclosure
overflow-x-hiddenroot defeatsposition: sticky, so an admin had to scroll to the end of the list to reach Turn on, Turn off and Delete…. It is now fixed to the window, with page padding, and was rechecked in a browser. No test failed when the Shift+Space range or the bar's wait for a pending write was removed; tests now cover both. The bar usedrole="toolbar"without arrow-key focus and announced the count twice; it is now a labelled group with one status count.🤖 Generated with Claude Code
Note
Move Admin home rows bulk actions into a More menu and add select mode
setShownManyadapter method that processes rows four at a time (BATCH_PARALLEL = 4), skips no-op and legacy Trakt rows, reports stale or failed rows individually, and refetches the list once (useAdminHomeRows.ts).RestoreDialogthat summarizes affected rows, collection rows, and unaffected pages, supports a profile-reset switch, and requires an explicit reload after a stale (412) restore.Checkboxin checkbox.tsx renders a minus icon for indeterminate state.Macroscope summarized 32f4225.