Repository navigation
feat(activity): multi-select agent rows with a bulk right-click menu - #25486
Conversation
Reveals are skipped while the activity view is showing, and activation no longer lifts workspace-list filters there. Only explicit requests (Go to workspace, reveal-current-workspace, Cmd+J project row, agent send target, Cmd+1-9) switch to the workspace list via showSidebarWorkspaceList.
Activity view gains its own persisted Hide automation-created, Hide CLI-created and Hide other-client agents toggles, applied through the existing activity scope filter so the selected-row exemption and identity-preserving return keep working. The options trigger now uses the workspace view's SlidersHorizontal icon and shared numeric badge, counting every active activity filter, and Add project stays visible so no header button shifts between views.
Open, Mark as read/unread, Go to workspace (real workspaces only), Copy (agent title, plus branch and path for real workspaces), and Clear from list for finished threads, reusing the row's existing actions and clearActivityThread.
Go to workspace and Cmd+1-9 switched the sidebar before activating, so a blocked folder activation still left the activity view. Activation now owns the switch via showWorkspaceList, applied after its failure gates. The separate showSidebarWorkspaceList action and the one-line sidebar-body-reveal module go away: setSidebarBody is the single writer, and the census pins its callers.
Move the workspace list's id-keyed click/Cmd/Shift selection into useListMultiSelection and rename the pure selection functions to lib/list-multi-selection so another list can reuse them. The workspace hook keeps its row order and Cmd+1-9 publish; no visible change.
…ribute Move the multi-selected workspace card style out of Tailwind classes into one main.css rule keyed by data-worktree-card-selected, so agent rows can share it. The attribute is set only off the active card and off lineage drop targets, and the rule also skips [data-worktree-card-active], so the active look wins even when the DOM marks a card active before React.
Agent rows now select like workspace cards: a plain click selects and opens, Cmd-click (Ctrl-click on Windows/Linux) toggles and Shift-click selects a range across groups, without opening anything. On macOS a Ctrl-click is left to the row menu. Right-clicking inside a 2+ selection offers Mark N as read / Mark N as unread / Clear N from list (with Undo). The row menu is now controlled and joins the shared close-all event, whose constant moves to one module.
There was a problem hiding this comment.
ℹ️ No critical issues — a couple of nitpicks below.
Reviewed changes — full read of the 58-file diff plus surrounding sources; two independent review passes (the agent-menu snapshot / close-all race, and the shared-hook extraction vs the sidebar and kanban consumers).
- Shared selection hook — click / Cmd(Ctrl) / Shift selection moved out of the workspace list into
hooks/use-list-multi-selection.ts, backed by renamed pure functions inlib/list-multi-selection.ts(wasworktree-multi-selection.ts). The sidebar hook stays a thin wrapper: row order, array-identity reuse, and the Cmd/Ctrl+1–9 layout-effect publishing are preserved, and the kanban keeps its own anchor-fallback logic. - One selected-row style — the multi-selected card look moved from Tailwind classes into a single
main.cssrule keyed bydata-worktree-card-selected, applied only to selected, non-active, non-lineage-drop rows; the rule reuses the exact tokens the removed classes used and sits after the hover rules. - Agent multi-select + bulk menu —
ActivityThreadListPaneruns the shared hook over its flattened rows; the agent context menu is now a controlled RadixContextMenuthat snapshots its targets on open, dispatches/observes the centralizedCLOSE_ALL_CONTEXT_MENUS_EVENT, and shows a counted bulk section (Mark N read / unread / Clear N) for selections of two or more, hiding the single-agent Open / Go to workspace / Copy items. - Batch store actions —
markThreadsRead/markThreadsUnreadsend one batched update; the single-row actions now delegate to them. - Event constant centralized —
CLOSE_ALL_CONTEXT_MENUS_EVENTmoved from four separate definitions tolib/close-all-context-menus.ts, with every importer migrated. - Tests — 25 test files added or updated (the hook, the agent list, the menu, the card attribute, the batch actions).
I traced the two riskiest seams and found no functional defects: the menu's own open event cannot close it (its listener is only attached while menuOpen is true, so the synchronous self-dispatch misses it), the target snapshot is safe against the portaled-item pointerdown that clears the selection, and the open agent is excluded from bulk mark-unread exactly as in the single-row menu (allowMarkUnreadWhenSelected preserved). Grep confirms no leftover worktree-multi-selection / old function names and no unmigrated CLOSE_ALL_CONTEXT_MENUS_EVENT importers.
ℹ️ Nitpicks
src/renderer/src/components/sidebar/worktree-list/navigation/use-selection.ts:74returnsrenderedWorktreeIdentities, which has no consumer anywhere (grep-verified). Since this PR rewrote that line to source it from the new hook, it could drop the field instead of carrying the dead return forward.src/renderer/src/hooks/use-list-multi-selection.ts:9importsuseReusedArrayIdentityfrom@/components/sidebar/worktree-list/listing/use-reused-array-identity, so a top-levelhooks/module now depends on a deep sidebar component module. Relocating that helper (and itsreuseArrayIfEqualdependency) tolib/orhooks/would keep the dependency direction one-way.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
… to the workspace menu Brings in the single-agent menu alignment and applies the same conventions to the bulk menu: one read toggle (Mark N Read / Mark N Unread), Clear N from List, Title Case, size-3.5 icons.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — incremental pass over the two commits since the prior pullfrog review: the base-branch merge that aligned the agent row menu to the workspace row menu, and the follow-up that names the agent count in the bulk labels. Read the full 59-file diff plus surrounding sources, ran 279 focused tests, and re-ran the runtime English catalog gate.
- Agent row menu matches the workspace row menu — a single read toggle ("Mark Read" / "Mark Unread", Bell/BellOff icons) replaces the two separate read items; Copy Title/Branch/Path are flat items instead of a
ContextMenuSub; Title Case labels andsize-3.5icons throughout, matchingWorktreeContextMenuView. - Bulk read collapsed to one toggle — "Mark N Agents Read" when any selected agent is unread, otherwise "Mark N Agents Unread" (disabled when no target is markable), so a mixed selection never offers both directions at once.
- Bulk counts name the agent — plural
_one/_othercatalog entries added for the three bulk labels;en-runtime-required.jsoncorrectly ships the six plural variants (the generator keeps every_one/_otherand drops base keys whose value equals the call-site default). - Tests updated — the context-menu test asserts the new labels and the read-wins-when-mixed branch; the exact-label assertions genuinely exercise the plural keys and the toggle, and the whole
components/activitysuite plus the shared hook/lib selection tests pass (44 files / 279 tests).
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…aces' into activity-agent-multiselect # Conflicts: # src/renderer/src/components/activity/activity-thread-context-menu.test.tsx # src/renderer/src/components/activity/activity-thread-context-menu.tsx
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — incremental pass over the single commit since the prior pullfrog review: the merge of the base branch tip (5e64ed4c5b), whose only net effect is the agent row menu's copy items.
- Copy items match the workspace row menu —
getActivityThreadCopyTargetsdrops theCopy Branchtarget and now returnsCopy PaththenCopy Title, gating the path on a real workspace that has one; thecopyBranchkey is removed fromen.json. This mirrorsWorktreeContextMenuView's Copy Path / Copy Worktree Name ordering. - Tests updated — the exact
toEqual([path, title])assertion and theCopy Branchabsence check pin the new shape, anden-runtime-required.jsonnever carried the removed key.
I read the full incremental delta (git diff 7e3b71a..HEAD) and the context-menu region of the full 59-file diff, ran activity-thread-context-menu.test.tsx (16 pass) and verify:localization-catalogs (exit 0); copyBranch no longer appears in any i18n file. No behavioral defects in the delta.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…elect # Conflicts: # src/renderer/src/components/activity/activity-thread-context-menu.test.tsx # src/renderer/src/components/activity/activity-thread-context-menu.tsx # src/renderer/src/components/activity/activity-thread-virtual-row.tsx # src/renderer/src/i18n/locales/en.json
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (2)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (59)
💤 Files with no reviewable changes (19)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe changes add reusable multi-selection behavior and apply it to workspace and activity lists. Activity context menus now support bulk read, unread, and clear actions, with batch read and unread callbacks wired through the activity panes. The close-all context-menu event moves to a shared module. Selected worktree cards and activity rows expose a shared selected-state style. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The selection and bulk-action changes appear mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Bulk actions retain existing controls and do not appear to grant additional access or agent authority. The main concern is a bounded state-ownership race: clearing an older selection can affect a newer retained run that replaces it while the menu remains open. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 17.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 37 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
Conflict in worktree-card-surface.tsx: main (#25486) moved the multi-selected look to a data-worktree-card-selected attribute; kept that, with the read-only card's `interactive` flag still gating the hover class, cursor and click.

ELI5
In the left sidebar's agent list you can now pick several agents at once, the same way you already pick several workspaces, and right-click to mark them all read, mark them all unread, or clear them from the list in one go.
What Changed
Before: clicking an agent row always opened that agent. There was no way to select more than one row, so marking or clearing several agents meant right-clicking each row in turn. The agent right-click menu could also stay open alongside a workspace or tab menu.
After:
How it works, in three commits:
hooks/use-list-multi-selection.ts) keyed by string ids, and its pure functions moved tolib/list-multi-selection.ts. The workspace hook is now a thin wrapper that keeps its row order and the Cmd+1–9 shortcut publishing, and returns the same shape as before. The workspace board keeps its own hook and only picks up the renamed functions.main.cssrule keyed by adata-worktree-card-selectedattribute. Both lists set that attribute only on rows that are selected and not the open/active row. The rule also excludes[data-worktree-card-active], because navigation can mark a card active in the DOM before React re-renders. Screenshots 01 and 02 below differ only inside an animated status spinner.ActivityThreadListPaneruns the shared hook over the agent rows it renders, so the sidebar list and the full Agents page both get it. The agent row menu is now a controlled RadixContextMenu. When it opens it sends the app's close-all-menus event, takes a snapshot of its targets from the selection, and closes when another menu sends the event. The close-all event name was defined in four places; it now lives inlib/close-all-context-menus.ts. NewmarkThreadsRead/markThreadsUnreadactions send a whole batch to the store in one update.Why
DropdownMenu. Our style guide prefersContextMenufor right-click menus, and RadixContextMenucan be closed from code, so moving it over is possible. It isn't worth it in this PR. The workspace menu is about 800 lines with four test files, and it depends on capture-phase behaviour that would all need rewriting: letting the native menu through, nested lineage scopes, Alt revealing developer items, and handing focus to the parent picker. Users would see no difference. The agent menu was already aContextMenuand only needed the bulk section and the close-all hookup.Linked Issue
N/A (internal). Stacked on #25376; base is
activity-view-hide-client-workspaces.Visual Proof
Workspace list, multi-selected (two plain-selected cards plus the active card in the selection). Before (Tailwind classes) / after (shared attribute rule). Computed background and border match exactly; the ring shadow is the same 1px value:
Multi-selected workspace cards (left) next to multi-selected agent rows (right); "Refactor the activity filters" is the open agent and keeps its open look:
Single-agent menu on an unread agent and on a read agent, and the bulk menu with three agents selected (two unread, all three finished):
The result of marking 4 agents read from the bulk menu (bells gone, selection cleared):
Clearing 2 agents from the bulk menu, with the Undo toast (Undo restored both rows):
Menus never coexist. With a workspace menu open on the workspace board, right-clicking an agent row closes it (left). With the agent menu open, right-clicking a workspace card closes the agent menu (right):
Testing
New tests:
Each new behavioural test was confirmed to fail with its fix removed. Existing workspace selection, board and context-menu tests pass unchanged apart from import renames and dropping the now-unused close-all key from module mocks.
Ran locally:
pnpm tc; vitest over activity, sidebar, lib, hooks, tab-bar, right-sidebar, status-bar, terminal-pane, editor, assets and i18n (2381 files / 21045 tests passing);oxlint;pnpm run check:code-quality:changed;check:max-lines-ratchet; localization sync and allverify:localization-*.Not run: Windows/Linux (the toggle key comes from the existing
navigator.userAgentcheck and the hook tests cover both platforms), and light theme.AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)