Skip to content

Archive selected threads from the context menu#3895

Open
theduke wants to merge 2 commits into
pingdotgg:mainfrom
theduke:feat/bulk-archive-selected-threads
Open

Archive selected threads from the context menu#3895
theduke wants to merge 2 commits into
pingdotgg:mainfrom
theduke:feat/bulk-archive-selected-threads

Conversation

@theduke

@theduke theduke commented Jul 11, 2026

Copy link
Copy Markdown

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.ts
  • vp check
  • vp run typecheck

Note

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 archiveSelectedThreadEntries logic: 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. archiveThread now accepts an optional onArchived hook and refreshes archived-thread state immediately after a successful mutation.

Multi-select mark unread and delete now resolve threads via parseScopedThreadKey and readThreadShell instead 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

  • Adds an Archive option to the multi-select context menu in Sidebar.tsx, disabled when any selected thread is running.
  • Introduces archiveSelectedThreadEntries in 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.
  • On partial failure, only successfully archived threads are removed from the selection; on full success, the selection is cleared.
  • archiveThread in useThreadActions.ts now accepts an optional onArchived callback and refreshes archived threads before any post-archive navigation.
  • Behavioral Change: archiveThread previously refreshed archived threads after navigation in the success branch; it now refreshes before navigation.

Macroscope summarized 2239fe5.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e8360e8c-286c-40c2-9184-841aa75e9ec4

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 11, 2026
Comment thread apps/web/src/components/Sidebar.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

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

@theduke theduke force-pushed the feat/bulk-archive-selected-threads branch from e431b78 to d1544c6 Compare July 11, 2026 18:50
Comment thread apps/web/src/components/Sidebar.tsx Outdated
@theduke theduke force-pushed the feat/bulk-archive-selected-threads branch from d1544c6 to 15b2c37 Compare July 11, 2026 18:56
Comment thread apps/web/src/components/Sidebar.tsx
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jul 11, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

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

Comment thread apps/web/src/components/Sidebar.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant