Skip to content

fix(vscode): send review comments on second Cmd+Enter - #13706

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-second-cmd-enter-send-all-comments
Sep 2, 2026
Merged

marius-kilocode merged 1 commit into
mainfrom
fix-second-cmd-enter-send-all-comments

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

A fast second Cmd+Enter in an Agent Manager diff comment could reach the old editor before focus moved to the review panel. It added a duplicate comment instead of sending the saved comments.

Why This Change Was Made

Restore focus immediately with preventScroll rather than waiting for two animation frames. Consume the add/save key event so the first press cannot also trigger send-all. Keep the existing chat draft and send guards unchanged.

User Impact

The first Cmd+Enter saves the current comment. The second sends all saved comments once, including rapid consecutive presses. Ctrl+Enter follows the same flow; Shift+Enter still inserts a newline.

Evidence

  • Both rapid-keyboard regression cases failed before the fix and pass after it. They assert no send on the first press, one complete batch on the second, and no duplicate batch on a third press.
  • All 10 diff browser tests and 55 focused unit tests passed. Typecheck, lint, compile, formatting, knip, and the Kilo marker guard passed.
  • Verified the inline review in isolated VS Code with two fixture comments: the first press restored panel focus immediately; the second submitted both comments and cleared the review annotations. The isolated test instance was stopped afterward.
  • The browser regression uses synthetic consecutive key events in one frame to make the timing failure deterministic. It exercises the real review component and does not require a live model response.

After submitting the two fixture comments, the diff remains visible without pending annotations:

Agent Manager diff after both review comments were submitted, with no pending comment annotations

@kilo-code-bot

kilo-code-bot Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • .changeset/fix-review-comment-shortcut.md
  • packages/kilo-vscode/tests/diff-scroll-preservation.spec.ts
  • packages/kilo-vscode/webview-ui/diff-viewer/review-annotations.ts
  • packages/kilo-vscode/webview-ui/diff-viewer/review-setup.ts

Reviewed by grok-4.6 · Input: 142.7K · Output: 10.1K · Cached: 441.9K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit b391948 into main Sep 2, 2026
25 of 26 checks passed
@marius-kilocode
marius-kilocode deleted the fix-second-cmd-enter-send-all-comments branch September 2, 2026 17:15
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.

2 participants