Repository navigation
Add Archive, Delete and Notifications to sidebar multi-select - #6221
Merged
Merged
Conversation
The sidebar's multi-select menu was hardcoded in the thread-list plugin, so it could not offer plugin actions such as Notifications, had no Delete, and archived selections through `sdk.threads.archive` directly, which skipped the child-thread confirmation, pane cleanup and route repair that single-thread archive runs. Thread actions can now provide `experimental_bulkItem`, and `experimental_ThreadActionsContextMenu` takes `experimental_bulkThreads` to show those items for a multi-row selection. Core's Mark read, Pin, Archive and Delete, thread-list's Move to section, and push-notifications' Notifications provide bulk items. Archive and Delete go through new multi-thread flows in ThreadActionsProvider that single-thread archive and delete share: one confirmation per selection, actions on the topmost selected threads only, one pane and route cleanup pass, and one Undo toast for archive. Dialog counts come from a new `POST /threads/cascade` query (`sdk.threads.experimental_listCascade`) built on the same helpers the archive and delete routes use, so single-thread and bulk dialogs count every thread the action will take. Single-thread delete previously counted direct children only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/sidebar-menu-item-source-logic-thr_rwzw5dm2xs
branch
from
October 26, 2026 17:02
4750588 to
824968a
Compare
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
The sidebar's multi-select menu (
sidebarMultiSelectexperiment) was a hardcoded component in the thread-list plugin. Plugin thread actions such as push-notifications' Notifications could not appear in it, and it had no Delete. Its Archive calledsdk.threads.archivedirectly for each thread. That skipped core's archive flow, so selecting a parent archived all of its children without the child-thread confirmation, even with that setting on, and it never ran core's pane cleanup and route repair. Separately, the single-thread delete dialog counted only direct children, although delete removes the whole tree.What changed
experimental_bulkItem({ threads, data, sdk, navigate }).experimental_ThreadActionsContextMenutakesexperimental_bulkThreadsandonEscapeKeyDown. With 2+ threads it shows a "N threads selected" bulk menu; otherwise it shows the normal menu. A row keeps a single Radix menu, so joining or leaving a selection doesn't remount it.experimental_bulkItem.threadBulkActions.requestArchiveThreads/requestDeleteThreadsinThreadActionsProvider, which single-thread archive and delete also use.POST /threads/cascade/sdk.threads.experimental_listCascade({ threadIds, action })returns the visible threads that archiving or deleting each thread would also affect. It's built on the same helpers asarchive-allanddelete, so single-thread and bulk dialogs count the same way, lifecycle-owned threads included. Single-thread delete now counts the whole tree instead of direct children.docs/api_to_audit.md(bulk items,experimental_listCascade),docs/configuration.md, the plugin-authoring guide (bulk docs live infrontend-sidebar-navigation.mdbecausefrontend-registration.mdis at its 500-line cap), and the Plugin Guide surface.HOST_DAEMON_PROTOCOL_VERSIONbump; the new route is additive. No CLI change: per-threadbb thread archive/deleteandbb push-notifications threadalready cover these actions.How you verified
CI exposed Pin mock state leaking between menu tests; reset mock implementations between tests and give the bulk-action test its own Pin response. All 59 menu tests pass (1 skipped), with lint and typecheck passing.
Archive consolidation (
bdccf5e15b): all 6,336 app tests, lint, and typecheck pass viapnpm exec turbo run test typecheck --filter=@bb/appplus the lint task in the same run. Shared single/multiple/environment Undo coverage proves parents finish restoring before descendants; the single-thread case fails on the previous implementation. Browser checks on the rebuilt preview confirmed single-parent and bulk archive dialogs, affected IDs, complete Undo restoration, and return navigation. Production code shrank by 127 lines.Empty-sidebar follow-up (
78bc4b82b6): the regression fails before the fix; all 474 thread-list tests, lint, and typecheck pass afterward. Rebuilt the worktree preview and verified with real browser clicks that two selected rows become zero after clicking empty sidebar space.CI on the rebased commit (
824968a715): 47 checks pass, 4 intentionally skipped, no failures or pending checks.Rebased onto
origin/main(e85d817479), with Plugin SDK0.6.82and the matching thread-list minimum. The previous Connect recovery failure is covered by the upstream fix in #6246; all 92 Connect tests pass locally after rebasing.pnpm exec turbo run typecheck lint testfor@bb/server,@bb/server-contract,@bb/sdk,@bb/app,@get-bb/plugin-sdk,bb-plugin-thread-list,bb-plugin-push-notifications,bb-plugin-plugin-api-docs,bb-plugin-bb-guide,@bb/connect-next: all 34 Turbo tasks pass after rebasing (server 3,690, app 6,333, Connect 92).oxfmt --checkis clean.child-summary, whatarchive-allarchives, and what delete removes.experimental_bulkItem; this test fails without the fix.ThreadRowbulk menu; this test fails with a stale prop name.pnpm start:worktreewith a seeded fixture and drove it with real browser input plus thebbCLI: 17/17 checks pass. Each bulk action was clicked in the UI and its effect read back through the CLI/API: read, pin, notifications, move, archive with one confirmation and Undo, delete cancel and confirm.