Archive selected threads from the context menu#3895
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
ApprovabilityVerdict: Needs human review This PR introduces a new bulk archive feature with non-trivial failure handling logic. An unresolved review comment identifies a potential bug where selection cleanup may clear the wrong keys after archiving. You can customize Macroscope's approvability policy. Learn more. |
e431b78 to
d1544c6
Compare
d1544c6 to
15b2c37
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2239fe5. Configure here.

Cleaning up several finished threads currently requires archiving them one at a time. Add Archive to the multi-select context menu so a group of selected threads can be archived in one action.
The action confirms once when archive confirmation is enabled. It is disabled when any selected thread has an active turn, and selection stays consistent across full success, partial failure, and post-archive navigation failures.
Tests cover the bulk Archive menu item, selected-thread count, running-thread state, and bulk archive outcome handling.
Checks:
vp test apps/web/src/components/Sidebar.logic.test.ts apps/web/src/hooks/useThreadActions.test.tsvp checkvp run typecheckNote
Medium Risk
Bulk archive touches thread mutations, selection state, and optional navigation when the active thread is archived; failure handling is new but scoped to sidebar actions with tests for the batch helper.
Overview
Adds Archive (N) to the sidebar multi-select thread context menu so several selected threads can be archived in one action. The item is disabled when any selection has an active running turn, and it respects the existing confirm archive setting with a single bulk prompt.
Bulk archiving runs through new
archiveSelectedThreadEntrieslogic: it archives sequentially, stops on a failed mutation while keeping already-archived keys, and treats post-archive failures (e.g. navigation) as follow-up failures while continuing the rest.archiveThreadnow accepts an optionalonArchivedhook and refreshes archived-thread state immediately after a successful mutation.Multi-select mark unread and delete now resolve threads via
parseScopedThreadKeyandreadThreadShellinstead of the sidebar thread map alone.Reviewed by Cursor Bugbot for commit 2239fe5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add bulk archive to the sidebar multi-select thread context menu
archiveSelectedThreadEntriesin Sidebar.logic.ts to iterate entries, invoking a caller-supplied archive function and collecting archived keys, the first mutation failure, and any post-archive failures.archiveThreadin useThreadActions.ts now accepts an optionalonArchivedcallback and refreshes archived threads before any post-archive navigation.archiveThreadpreviously refreshed archived threads after navigation in the success branch; it now refreshes before navigation.Macroscope summarized 2239fe5.