Repository navigation
feat(review): assignable "Send Review Notes to Agent" keyboard shortcut (#10027) - #10070
Conversation
…10027) Adds a keyboard command that opens the "Send notes to an agent" picker for the active worktree's AI diff-review notes, enabling a fully keyboard-driven review flow. Unbound by default; users assign it in Settings → Keyboard Shortcuts. - New `sourceControl.sendReviewNotes` command (scope global, unbound). Set `conflictGroup: 'editor'` so Settings warns on collisions with editor chords (e.g. Add Review Note), not just global ones. - Dispatched from App.tsx's existing global capture handler so it respects the terminal-shortcut policy, the shortcut-recorder guard, and defaultPrevented. - Store thunk `openDiffNotesSendMenuForActiveWorktree` reveals Source Control and requests the notes send menu open; no-op when there are no unsent notes. - Menu opens via a nonce-based store request consumed on mount, TTL-bounded so a request the menu never consumed can't reopen it on a later remount. Co-authored-by: Orca <[email protected]>
📝 WalkthroughWalkthroughAdds the global 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: abb6002b-a9cc-4ce7-8d87-240aa97fca94
📒 Files selected for processing (9)
src/renderer/src/App.tsxsrc/renderer/src/components/editor/DiffNotesSendMenu.tsxsrc/renderer/src/components/editor/NotesSendMenu.test.tsxsrc/renderer/src/components/editor/NotesSendMenu.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/store/slices/ui.test.tssrc/renderer/src/store/slices/ui.tssrc/shared/keybindings.test.tssrc/shared/keybindings.ts
| // Unbound by default; opens the active worktree's Source Control notes send picker. Only consumes the chord when there are unsent notes. | ||
| if (matchShortcut('sourceControl.sendReviewNotes')) { | ||
| if (actions.openDiffNotesSendMenuForActiveWorktree()) { | ||
| input.preventDefault() | ||
| notifyTerminalCapture('sourceControl.sendReviewNotes') | ||
| return | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Handle this command before the editable-target exit.
isEditableTarget() returns at Lines 1531-1533 before this branch, so a configured shortcut cannot open the picker while the diff editor has focus. Move this dispatch before that generic guard while retaining canRevealRightSidebar and terminal-policy checks.
…tablyai#10027) (stablyai#10070) Adds a keyboard command that opens the "Send notes to an agent" picker for the active worktree's AI diff-review notes, enabling a fully keyboard-driven review flow. Unbound by default; users assign it in Settings → Keyboard Shortcuts. - New `sourceControl.sendReviewNotes` command (scope global, unbound). Set `conflictGroup: 'editor'` so Settings warns on collisions with editor chords (e.g. Add Review Note), not just global ones. - Dispatched from App.tsx's existing global capture handler so it respects the terminal-shortcut policy, the shortcut-recorder guard, and defaultPrevented. - Store thunk `openDiffNotesSendMenuForActiveWorktree` reveals Source Control and requests the notes send menu open; no-op when there are no unsent notes. - Menu opens via a nonce-based store request consumed on mount, TTL-bounded so a request the menu never consumed can't reopen it on a later remount. Co-authored-by: Orca <[email protected]>
Summary
Closes #10027.
Adds a keyboard command that opens the "Send notes to an agent" picker for the active worktree's AI diff-review notes — enabling a fully keyboard-driven review flow (add note → save → send, no mouse).
Per the request, this ships as a command that users assign themselves in Settings → Keyboard Shortcuts (search "Send Review Notes"). It is unbound by default so it can never collide with an existing chord.
How it works
sourceControl.sendReviewNotescommand in the shared keybinding registry (scope: 'global', unbound). It setsconflictGroup: 'editor'so Settings' conflict detection warns when a user binds it over an editor chord (e.g. Add Review Note) as well as over global chords.App.tsx's existing global capture-phase handler, so it inherits the correct context handling: terminal-shortcut policy, the Settings shortcut-recorder guard, and thedefaultPreventedbail-out. The chord is only consumed when there are unsent notes.openDiffNotesSendMenuForActiveWorktree()reveals the Source Control panel and issues a nonce-based open request; it's a no-op (returnsfalse, key left free) when the active worktree has no unsent notes.DiffNotesSendMenuconsumes the request on mount and opens the picker. The request is TTL-bounded (5s) so a request the menu never got to consume can't reopen it on a later remount.Only the canonical Source Control notes menu opts in (
respondToOpenRequest), so there's no double-open across the otherDiffNotesSendMenucall sites.Review
Design reviewed adversarially over two rounds (GPT-5.6-Sol sub-agent). Findings fixed: original window-listener approach fired from any focus and died when the sidebar tab was switched → replaced with the context-aware App.tsx dispatch above; stale-request reopen bounded with a TTL; conflict-detection blind spot closed via
conflictGroup.Testing
vitestunit tests added: store thunk (ui.test.ts), menu open-on-request (NotesSendMenu.test.tsx), and conflict detection (keybindings.test.ts). Full affected suites green (252 tests).tscrenderer typecheck,oxlint, and the max-lines ratchet all pass.Cross-platform / SSH
No hardcoded modifiers — chords resolve through the shared platform-aware matcher (
Mod→ ⌘ on macOS, Ctrl elsewhere). Sending continues through the existing worktree-aware target-mode path, so the SSH/remote flow is unchanged.Made with Orca 🐋