Add Ctrl/Cmd+Enter shortcut for code review "Send to Agent"#12982
Add Ctrl/Cmd+Enter shortcut for code review "Send to Agent"#12982warp-dev-github-integration[bot] wants to merge 7 commits into
Conversation
The code review comment composer's "Comment" button can be submitted with
cmdorctrl-enter and renders that keystroke, but the comment tray's "Send to
Agent" button had no keyboard path and no keystroke hint.
- Add a shared `CODE_REVIEW_SUBMIT_KEYSTROKE` ("cmdorctrl-enter") used by both
the composer's submit button and the new send path, so they're the exact
same binding.
- Convert "Send to Agent" to an `ActionButton` (PrimaryTheme) with that
keybinding so it renders the keystroke chip, matching the "Comment" button.
- Register a `code_review:submit_review_comments` editable binding scoped to the
`CodeReviewView_NotEditing` context (so it can't fire while composing a
comment), handled via a new `CodeReviewAction::SubmitReviewComments`.
- Add `CommentListView::can_send` and guard both the button's enabled state and
the keyboard handler with it so the shortcut is a no-op when sending is
disabled.
Co-Authored-By: Oz <oz-agent@warp.dev>
The keystroke chips on the "Send to Agent" and "Comment" buttons are rendered from a fixed CODE_REVIEW_SUBMIT_KEYSTROKE, and comment submission is a fixed editor binding. Registering the send trigger as an editable binding meant a user rebinding it in settings would desync the actual key from what the buttons show. Register it as a FixedBinding instead, so the trigger, both rendered chips, and the comment-submit binding all derive from the one constant and can't drift. Co-Authored-By: Oz <oz-agent@warp.dev>
f37d682 to
d85b9cf
Compare
The "Send to Agent" shortcut (cmdorctrl-enter) only applies in the `CodeReviewView_NotEditing` context, i.e. when the review pane itself holds focus. After authoring a comment, focus is left inside the child editor (the inline line-comment editor or the pane composer), so the shortcut didn't fire until the user clicked back into the pane. Refocus the review pane in `update_review_comment` once a comment is committed, so the shortcut works immediately in the natural "add comments then send" flow. Mirrors the existing focus_self() after reverting a diff hunk. Co-Authored-By: Oz <oz-agent@warp.dev>
| ); | ||
| } | ||
|
|
||
| ctx.focus_self(); |
There was a problem hiding this comment.
Need to make sure we transfer focus to that the Code review view can receive the subsequent keystroke without having to click it.
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds a shared code review submit keystroke, renders it on the comment tray's Send to Agent action, and registers Ctrl/Cmd+Enter to submit queued review comments when the code review pane is not editing.
Concerns
⚠️ [IMPORTANT] This is a user-facing UI/behavior change, but the provided PR artifacts only state that a screenshot was posted in Slack; they do not include an attached screenshot or recording in the PR description/comments that reviewers can inspect. Please attach visual evidence demonstrating the shortcut chip and end-to-end Send to Agent shortcut behavior.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
The code review send-to-agent work made `CommentListView::sync_send_button` read the `AIRequestUsageModel` singleton when comments are populated (to compute the "Send to Agent" button's enabled state/tooltip). The `find_model` tests use their own lighter test harness that never registered that singleton, so they panicked once a `CodeReviewView` populated comments. Register `ServerApiProvider` + `AIRequestUsageModel` in the find_model test harness, matching `code_review_view_tests::initialize_test_app`. Co-Authored-By: Oz <oz-agent@warp.dev>
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds a shared Ctrl/Cmd+Enter shortcut and keybinding hint for sending queued code review comments to the agent. The implementation keeps the shortcut scoped to the non-editing code review context and guards both the button and shortcut with the sendable-comments checks.
Concerns
- The change is user-facing, but the PR context only says a screenshot exists in a Slack thread; no screenshot or recording is attached to the PR description/context for reviewers to verify the rendered shortcut and end-to-end behavior.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| }); | ||
|
|
||
| let send_button = ctx.add_view(|ctx| { | ||
| ActionButton::new("Send to Agent", PrimaryTheme) |
There was a problem hiding this comment.

Human Remarks (Andy)
The idea of this PR is to make sending the comments from code review to the agent more keyboard-driven. We have cmd/ctrl-enter for adding a single comment, but after you do that you have to go back to the mouse to click "send to agent". This PR adds that same keystroke to the "send to agent button".
Description
In the code review panel, a review comment can be submitted with
cmdorctrl-enter(Ctrl+Enter on Windows/Linux, ⌘+Enter on macOS) and the composer's Comment button renders that keystroke. The comment tray's Send to Agent button, however, had no keyboard binding and no keystroke hint — so there was no keyboard-driven way to send queued comments to the agent.This adds that shortcut, using the exact same binding as submitting a comment, and renders the keystroke on the button.
How:
CODE_REVIEW_SUBMIT_KEYSTROKE(cmdorctrl-enter) incode_review, used by both the composer's Comment button and the new send path so they're literally the same binding.ui_builderaccent button to anActionButton(PrimaryTheme, which usestheme().accent()so it looks the same) withwith_keybinding(...), so it renders theCtrl ↵/⌘ ↵chip just like the Comment button. Disabled state + tooltip are kept in sync viasync_send_button.code_review:submit_review_commentseditable binding forcmdorctrl-enter, scoped to the existingCodeReviewView_NotEditingkeymap context so it can't fire while composing a comment (no conflict with the composer's owncmdorctrl-enter). It dispatches a newCodeReviewAction::SubmitReviewComments.CommentListView::can_sendand guard both the button's enabled state and the keyboard handler with it, so the shortcut is a no-op exactly when the button is disabled (no sendable comments / no destination / AI unavailable).Linked Issue
Reported via the factory-client Slack bug-triage thread (no GitHub issue). Spec was approved by the reporter in-thread.
Testing
Verified on the running app against
/workspace/repro-repo:Ctrl ↵shortcut (matching the Comment button).Ctrl+Enterwith focus in the comment tray (not composing) sends the queued comments to the agent (tray clears, an agent conversation opens).Ctrl+Enterwhile composing a comment still only saves the comment — it does not also send to the agent (the_NotEditingcontext gating works).cmdorctrl-s/cmdorctrl-f/fcode-review shortcuts and comment save/cancel are unaffected.Note: per the reporter's request, a dedicated regression/unit test was intentionally skipped for this change.
./script/formatandcargo clippy --all-features -- -D warningspass. The fullcargo nextestsuite could not be run in this cloud runner because compiling thewarpcrate's test target exceeds the environment's memory limit (OOM/SIGKILL); CI will run the test suite.Screenshots / Videos
Screenshot of the corrected button is posted in the Slack triage thread.
Agent Mode
CHANGELOG-IMPROVEMENT: Code review comments can now be sent to the agent with the keyboard (Ctrl/Cmd+Enter), and the shortcut is shown on the "Send to Agent" button.
Conversation: https://staging.warp.dev/conversation/1bc9ad74-95e9-4f6f-8dd0-cfcafe4fcacd
Run: https://oz.staging.warp.dev/runs/019ef812-8c8f-7be0-90c5-5d389eccb995
This PR was generated with Oz.