Add a shortcut to archive a thread - #2699
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 Plus 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 adds a new keyboard shortcut for archiving threads. An unresolved review comment identifies that the new shortcut bypasses the archive confirmation dialog, creating inconsistent behavior for users who have that setting enabled. This behavioral inconsistency warrants human review. You can customize Macroscope's approvability policy. Learn more. |
e8f77a4 to
d1c0b29
Compare
Dismissing prior approval to re-evaluate d1c0b29
d1c0b29 to
6f587ed
Compare
|
@juliusmarminge I was on a holiday, but I have now force pushed from my local fork to bring this PR to mergable status. |
6f587ed to
64279d3
Compare
Dismissing prior approval to re-evaluate 64279d3
Dismissing prior approval to re-evaluate fe54216
ed5cc7b to
e064cd7
Compare
e064cd7 to
3759679
Compare
Dismissing prior approval to re-evaluate 3759679
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 3759679. Configure here.
| event.stopPropagation(); | ||
| if (!routeThreadRef) return; | ||
| void attemptArchiveThread(routeThreadRef); | ||
| return; |
There was a problem hiding this comment.
Archive shortcut skips confirmation
Medium Severity
The new thread.archiveCurrent shortcut and command-palette action call attemptArchiveThread directly, so they never consult confirmThreadArchive. Sidebar archive and multi-select still prompt when that setting is on, so users who enabled archive confirmation can still archive the current thread immediately from the keyboard or Cmd+K.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3759679. Configure here.
3759679 to
959d9a7
Compare
|
Rebased onto current main and ported to the new command-palette bus architecture, since the palette context this originally hooked into was replaced upstream. The archive action now registers in the current palette action list, with toast/error handling consolidated in |
|
Closing this, because I use the new settled workflow and that has a keyboard shortcut after #8089 |


What Changed
Add
thread.archiveCurrentso the current thread can be archived without leaving the keyboard.mod+shift+awhen the in-app terminal is not focused.Why
The existing Cmd+1, Cmd+2, etc. shortcuts make switching threads fast, but stale threads still require pointer interaction to archive. This keeps the entire switch-and-clean-up workflow on the keyboard.
UI Changes
Before
Searching for
archiveon upstream main returns no matching command.After
Searching for
archiveon this PR shows “Archive current thread” with ⇧⌘A.Interaction
The shortcut archives the active thread and navigates to a fresh draft.
archive-shortcut.mp4
Verification
Automated
vp check— passedvp run typecheck— passedvp test run apps/web/src/lib/chatGlobalShortcuts.test.ts packages/contracts/src/keybindings.test.ts packages/shared/src/keybindings.test.ts— 121 tests passedManual GUI verification
Verified in a disposable, paired T3 Code environment at head
3759679409cf:mod+shift+a: archived once and navigated to a fresh draft.Evidence is captured locally as
before-command-palette.png,after-command-palette.png,after-archive-shortcut.png,after-archive-toast.png,terminal-focus-noop.png,hold-chord-single-archive.png,multi-select-selected.png,multi-select-archive-result.png, andarchive-shortcut.mp4.Checklist
Note
Low Risk
Focused UX and keybinding wiring reusing existing archive behavior; no auth or data-model changes.
Overview
Adds
thread.archiveCurrentso users can archive the active thread from the keyboard without using the sidebar.mod+shift+ais registered as the default binding (when the terminal is not focused), documented in user keybindings, and validated in contracts/shared tests. Chat route global shortcuts handle the command by callingattemptArchiveThreadon the routed thread; draft routes no-op.attemptArchiveThreadis moved intouseThreadActions(archive + failure toast), replacing duplicated logic in the sidebar. The command palette gains Archive current thread when a server thread is active, wired to the same helper.shouldIgnoreChatGlobalShortcutEventcentralizes ignoringdefaultPreventedand repeat keydowns so holding the chord does not archive multiple times.Reviewed by Cursor Bugbot for commit 959d9a7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
thread.archiveCurrentkeyboard shortcut to archive the active threadmod+shift+aforthread.archiveCurrent(when terminal is not focused) via keybindings.ts and the contracts schema in keybindings.ts.attemptArchiveThreadon the current thread, skipping repeated or already-handled keydown events via the newshouldIgnoreChatGlobalShortcutEventguard.attemptArchiveThreadis extracted into useThreadActions.ts and shows a stacked toast on non-interruption failures; the sidebar now consumes it via props instead of its own local implementation.Macroscope summarized 959d9a7.