Skip to content

feat(review): assignable "Send Review Notes to Agent" keyboard shortcut (#10027) - #10070

Merged
nwparker merged 1 commit into
mainfrom
nwparker/feature-keyboard-shortcut-for-send-notes-to-agen
Jul 23, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/feature-keyboard-shortcut-for-send-notes-to-agen

Conversation

@nwparker

@nwparker nwparker commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

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

  • New sourceControl.sendReviewNotes command in the shared keybinding registry (scope: 'global', unbound). It sets conflictGroup: '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.
  • Dispatched from App.tsx's existing global capture-phase handler, so it inherits the correct context handling: terminal-shortcut policy, the Settings shortcut-recorder guard, and the defaultPrevented bail-out. The chord is only consumed when there are unsent notes.
  • Store thunk openDiffNotesSendMenuForActiveWorktree() reveals the Source Control panel and issues a nonce-based open request; it's a no-op (returns false, key left free) when the active worktree has no unsent notes.
  • The Source Control DiffNotesSendMenu consumes 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 other DiffNotesSendMenu call 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

  • vitest unit 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).
  • tsc renderer 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 🐋

…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]>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds the global sourceControl.sendReviewNotes keybinding and App-level shortcut handling. The UI store now publishes and consumes worktree-scoped requests to open the diff-notes send menu. Source Control and editor menu components process these requests with TTL and deliverable-note checks. Tests cover shortcut conflicts, request state transitions, menu opening, handling, and non-deliverable notes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: an assignable keyboard shortcut for sending review notes.
Description check ✅ Passed The description is mostly complete and covers summary, behavior, testing, review, and platform notes, though Screenshots, Security Audit, and Notes are not explicit.
Linked Issues check ✅ Passed The changes implement the requested assignable shortcut to open the Send notes to an agent picker for unsent notes in the active worktree.
Out of Scope Changes check ✅ Passed The diff stays focused on the shortcut flow, store state, menu handling, keybindings, and tests, with no obvious unrelated changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ffe54a5 and 8a19433.

📒 Files selected for processing (9)
  • src/renderer/src/App.tsx
  • src/renderer/src/components/editor/DiffNotesSendMenu.tsx
  • src/renderer/src/components/editor/NotesSendMenu.test.tsx
  • src/renderer/src/components/editor/NotesSendMenu.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/store/slices/ui.test.ts
  • src/renderer/src/store/slices/ui.ts
  • src/shared/keybindings.test.ts
  • src/shared/keybindings.ts

Comment thread src/renderer/src/App.tsx
Comment on lines +1679 to +1687
// 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
}
}

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.

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

@nwparker
nwparker merged commit 059a80b into main Jul 23, 2026
3 checks passed
@nwparker
nwparker deleted the nwparker/feature-keyboard-shortcut-for-send-notes-to-agen branch July 23, 2026 03:38
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Keyboard shortcut for "Send notes to agent"

1 participant