Skip to content

feat(web): move rare Home rows actions under More - #1889

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

Quick104 merged 4 commits into
feat/collections-revampfrom
feat/home-rows-more-menu

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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 to feat/collections-revamp once 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 checkboxSelection helper. 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's overflow-x-hidden root 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 enabled with 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_profiles is 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 Checkbox component 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:

  • Restore says "Rows that show collections, like {titles}, are removed. The collections themselves stay in Collections." instead of the mockup's "Rows you added, like …, are deleted." Restore can't tell rows an admin added from Silo's defaults, which include filter rows.
  • Wording the design doesn't cover: one collection row reads "{title} shows a collection and is removed. The collection itself stays in Collections."; more than three reads "like A, B, C and N more"; a page with no rows reads "{Page} gets Silo's default rows."
  • The 412 warning sits just above the dialog footer rather than in it, and Reload rows refetches both the list and the page version.
  • The row ⋯ menu stays available in select mode, following the planned tab order (checkbox, switch, ⋯). The mockup leaves that column empty.
  • Select all ticks every row, even past 100. The bar then disables its actions and says "Select up to 100 rows at a time."
  • Turn on and Turn off keep the selection afterwards so another action can follow; Delete keeps only the rows that failed, as before.
  • Under 640 px the bar shows icons only; the buttons keep their names for screen readers.

Validation

  • Web: make test-web (774 files, 7106 tests passed), pnpm run lint (0 errors, no warnings in changed files), format:check, build, tsc -b and budget:check pass. The launch bundle measures 321592 B brotli, 266 B over perf-budget.json and inside the check's 1024 B tolerance, so the budget file is unchanged.
  • Tests: jsdom tests cover the More menu, entering and leaving select mode with focus and Escape, tab order, ranges by Shift-click and Shift+Space, the 100-row limit, the Restore dialog's wording for Home and library pages, the disabled profile reset, a stale Restore followed by Reload rows, bulk delete with a failed row, Turn off with one stale row, and the phone dock. Hook tests cover the batch: 4 rows at a time, skipped and refused rows, and one refetch. Removing the stale-row check, the 4-row limit, the Trakt refusal, the single refetch, the Restore ETag, the reset_profiles value, 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.
  • Browser: Chromium at 1440 px and 390 px against local builds of the base branch and this branch, each with a disposable database. Turn off on two rows and Restore defaults with profile reset both saved. Escape in the delete dialog kept select mode, and Shift+Space then Escape left it with focus on More. On a 14-row list scrolled to the top, the bar stayed in view, and at the end of the page the last row sat clear of it.
  • Hygiene: make verify-local-paths passes.
  • Not run: the Go gate and the contract 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

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

  • 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 planned scope and the approved design, confirmed the page's requests are unchanged, re-ran the type check and focused tests, and broke the code in a scratch copy to see which tests catch which defects. It found one major problem, one minor and one nit; all are fixed. The selection bar was meant to float but scrolled with the page, because the admin layout's overflow-x-hidden root defeats position: 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 used role="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

  • Replaces the always-visible header controls (Restore Defaults, Delete All, Delete Selected, and the permanent selection checkbox) with a page-level More menu, an Add row action, and an explicit select mode entered from the menu (AdminHomeRows.tsx, HomeRowsPage.tsx).
  • In select mode, rows show a selection checkbox instead of the drag handle, a Select all header with a 100-row limit, and a fixed bottom bar with Turn on, Turn off, and Delete actions. Shift-click and Shift+Space extend the selection range.
  • Batch visibility updates run through a new setShownMany adapter 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).
  • Adds a RestoreDialog that summarizes affected rows, collection rows, and unaffected pages, supports a profile-reset switch, and requires an explicit reload after a stale (412) restore.
  • Behavioral Change: Delete All is removed; bulk delete and batch visibility actions are capped at 100 selected rows and disabled while busy; Escape now exits select mode even with zero rows selected; failed rows stay selected after a bulk delete; the shared Checkbox in checkbox.tsx renders a minus icon for indeterminate state.

Macroscope summarized 32f4225.

Quick104 and others added 2 commits October 4, 2026 03:05
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]>
@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: 814e5c52-bb45-4835-bfc9-3b8803583a0b

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:42:03.463864Z 32f4225 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: 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;

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

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

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown

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 Validation tasks: changes #1141 C1 line is accurate.

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

Quick104 and others added 2 commits October 4, 2026 08:35
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]>

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

Comment on lines +347 to +350
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);

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

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

Base automatically changed from chore/home-rows-trakt-cleanup to feat/collections-revamp October 4, 2026 13:55
@Quick104
Quick104 merged commit 697772e into feat/collections-revamp Oct 4, 2026
20 checks passed
@Quick104
Quick104 deleted the feat/home-rows-more-menu branch October 4, 2026 14:15
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