Add shortcut to settle the open thread - #4277
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 New feature adding a keyboard shortcut to settle threads, with confirmation dialog and post-settle navigation logic across both sidebar implementations. New user-facing capabilities warrant human review. You can customize Macroscope's approvability policy. Learn more. |
4ac33ed to
a3cb697
Compare
7e1eb9e to
e6e9e4a
Compare
e6e9e4a to
f065547
Compare
2d4990a to
a6d2a79
Compare
60ff41d to
f2cc119
Compare
e7fdf0f to
0b21321
Compare
# Conflicts: # apps/web/src/components/SidebarV2.tsx # apps/web/src/keybindings.test.ts
# Conflicts: # apps/web/src/components/SidebarV2.tsx # apps/web/src/keybindings.test.ts
What Changed
thread.settleas a configurable keybinding command withMod+Shift+Xas the defaultWhy
Settling the thread currently requires targeting a hover-only sidebar action. A global shortcut makes this frequent lifecycle action available without leaving the keyboard, while the focused confirmation prevents accidental settles and makes the confirmation keystroke explicit.
UI Changes
The shortcut opens an in-app alert dialog naming the thread and explaining that it moves out of active work. The
Settle threadbutton is the initial focus target and displays anEnterkey hint; Escape cancels.Exact-head browser verification completed in an isolated environment against a disposable thread; the focused confirmation state is shown below.
Checklist
vp checkvp run typecheckvp test apps/web/src/keybindings.test.ts apps/server/src/keybindings.test.tsvp run --filter @t3tools/web buildExact-head evidence
Revalidated at 2d4990a: focused tests, vp check, and vp run typecheck passed. Integrated browser verification confirmed Mod+Shift+X opens the settle dialog from the focused composer while preserving draft text, and Mod+Shift+Enter no longer triggers settlement. The capture uses only disposable local projects.
Note
Medium Risk
Touches thread lifecycle navigation and keyboard handling in both sidebars; mistakes could mis-route after settle or settle ineligible threads, though confirmation and extensive unit tests mitigate this.
Overview
Adds
thread.settle(Mod+Shift+X,!terminalFocus) to contracts, shared defaults, server bootstrap tests, and user keybinding docs.resolveThreadSidebarShortcutActioncentralizes thread shortcut handling for both sidebars: navigate, open settle confirmation, consume (ineligible route, in-flight settle, or modal open), or ignore. While a settle dialog is open, other thread shortcuts are consumed so the route does not change behind it.Legacy and V2 sidebars wire the shortcut to an AlertDialog (Enter on the focused “Settle thread” action, Escape cancels). On confirm they call
settleThreadand, if you are still on that thread, advance viaresolveNextActiveThreadIdAfterSettle(visible order first, full unarchived list as fallback), skipping effectively settled and snoozed threads—or start a new thread when none remain. Shortcut handling is skipped when the command palette or model picker is open.Supporting changes in
Sidebar.logic: PR/change-request state for hidden or collapsed rows (git cwd resolution, worktree-only git queries, pending-state publish rules), shared effective settled/snooze helpers, and confirmation dismiss rules. Visible rows report PR state upward for auto-settle classification.Reviewed by Cursor Bugbot for commit 0b21321. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
thread.settlekeyboard shortcut (Mod+Shift+X) to settle the open thread from the sidebarthread.settleto the keybinding system, bound toMod+Shift+Xwith!terminalFocus, in both shared keybindings and contracts.resolveThreadSidebarShortcutActionin keybindings.ts to classify thread shortcuts intonone,consume,navigate, orconfirm-settleoutcomes, replacing direct traversal/jump index logic.AlertDialogconfirmation before settling; on confirm, the thread is settled and the sidebar navigates to the next active thread or opens a new one.SidebarHiddenThreadChangeRequestStateReportercomponents to track per-thread PR/change-request state for threads not currently visible in the sidebar, used to determine effective settlement state.Macroscope summarized 0b21321.