You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): IME keys no longer cancel or send a pull request review reply - #41932
Replying to a review conversation in a pull request's Code tab, an Escape that closes an IME candidate window also closed the reply box, so the reader lost their place and focus mid-word (the text came back only on reopening it). A Ctrl/Cmd+Enter pressed mid-composition sent the unfinished reply. The reply box's key handler had no IME check, unlike the pull request's comment, review, description and title editors.
Fix
The reply box now ignores keys that belong to an IME composition (isComposing, or keyCode 229, which Safari reports after compositionend), so they neither cancel nor send.
Those keys also stop there. Otherwise an IME Escape left unhandled would reach the Pull requests page, which leaves on any Escape nothing claimed, and its check skips isComposing but not keyCode 229.
A plain Escape still closes the reply (or cancels dictation), and a plain Ctrl/Cmd+Enter still sends it.
Repro
Setup: Linux, Chromium, light theme, 1280×800, vp run dev --no-seed with fresh isolated data, a public fixture pull request with one review conversation. Base and head were served by the same server with only the changed file swapped.
Steps: Pull requests → open the pull request → Code → Reply on the conversation → type a reply → IME Escape (keyCode 229) in the reply box.
Before (3c3246e)
After (67aa60e)
Before: an IME Escape closed the reply box mid-reply
After: the reply box stays open with its text after an IME Escape
After the fix, an isComposing Escape also keeps the box, its text and focus, neither one reaches the page, and the page stays on Pull requests. A plain Escape still closes the reply.
Not shown: a real IME. The IME keys were dispatched as keyboard events with those fields set.
Verification
An AI agent ran each check below.
PullRequestReviewAnnotation.browser.test.tsx (new): Escape, Ctrl+Enter and Cmd+Enter, each with isComposing and with keyCode 229, keep the reply open with its text, send nothing, are not prevented, and never reach the page's Escape handler. A plain Escape then closes the reply as a handled key, and a plain Ctrl+Enter sends it once.
It fails on main and passes 3 of 3 here. Checking only isComposing, only keyCode 229, only Escape, or dropping the stop each makes it fail.
This PR changes the test suite by +1 test cases (browser +1, unit 0, server 0).
New browser test files: apps/web/src/components/pullRequest/PullRequestReviewAnnotation.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.
Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.
Reviewing files that changed from the base of the PR and between 67aa60e and a90e212.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The review reply shortcut handler now skips keyboard events during IME composition. A browser test checks composing-event behavior and confirms that ordinary Escape and submit shortcuts still work.
Changes: Review reply shortcuts
Layer / File(s)
Summary
Skip shortcuts during IME composition apps/web/src/components/pullRequest/PullRequestReviewAnnotation.tsx, apps/web/src/components/pullRequest/PullRequestReviewAnnotation.browser.test.tsx
submitKeys stops composing events and events with keyCode === 229 from reaching the existing shortcut handling. The browser test checks that these events do not cancel or submit a reply, and that ordinary Escape and Ctrl+Enter still work.
Reply shortcuts now ignore IME composition events so that Escape and Ctrl/Cmd+Enter no longer close or submit a reply mid-composition. Ordinary shortcuts are unchanged. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title follows the conventional commit format and names the main change: IME keys no longer cancel or send a pull request review reply. The raw summary and objectives confirm the reply box now igno…
Description check
The description follows the template's sections. Problem explains the Escape and Ctrl/Cmd+Enter bug with expected behavior. Change describes the IME check and the stop-propagation step. Scope explains…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title follows the conventional commit format and names the main change: IME keys no longer cancel or send a pull request review reply. The raw summary and objectives confirm the reply box now ignores IME composition keys (isComposing or keyCode 229) and the events stop before reaching the page's Escape handler.
Full details: Description check
Explanation
The description follows the template's sections. Problem explains the Escape and Ctrl/Cmd+Enter bug with expected behavior. Change describes the IME check and the stop-propagation step. Scope explains it is a bug fix and does not link an issue, and it does not say why no issue is needed. Verification lists a new browser test, the fail-on-main result, and check:changed, and it includes before/after screenshots. The template also asks for a model and harness line, and the description has one. The Scope section lacks an issue link or a reason for having none, which is the main gap.
Resolution
Optionally add a sentence to the Scope section explaining why no linked issue is needed for this small bug fix, or link the issue that shows the bug. Note that the Verification section states the test was run by an AI agent, which is acceptable.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Real web app, Linux Chromium, 1280×900, light theme, isolated databases and identical synthetic review data. Open Code → expand file → Reply → compose にほ after Draft → deliver IME Escape and Ctrl/Cmd+Enter. Repeat with post-composition keyCode 229 Escape and ordinary shortcuts. Composition uses CDP; keydown flags are scripted. Outbound replies are intercepted before the server.
Head preserves all four IME cases without sending or leaving the pull request. Ordinary Escape still cancels; ordinary Ctrl/Cmd+Enter still emits one request on both commits.
Native OS IME keyboard delivery and Safari itself were not exercised; Chromium composition and scripted keydown flags were used, including the keyCode 229 branch.
The separate navigation path for an unclaimed IME Escape was not exercised; the reply editor's IME cases kept the pull request visible on head.
Other submitKeys consumers, including comment editing and draft inline comments, were not exercised.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replying to a review conversation in a pull request's Code tab, an Escape that closes an IME candidate window also closed the reply box, so the reader lost their place and focus mid-word (the text came back only on reopening it). A Ctrl/Cmd+Enter pressed mid-composition sent the unfinished reply. The reply box's key handler had no IME check, unlike the pull request's comment, review, description and title editors.
Fix
isComposing, orkeyCode 229, which Safari reports aftercompositionend), so they neither cancel nor send.isComposingbut notkeyCode 229.Repro
Setup: Linux, Chromium, light theme, 1280×800,
vp run dev --no-seedwith fresh isolated data, a public fixture pull request with one review conversation. Base and head were served by the same server with only the changed file swapped.Steps: Pull requests → open the pull request → Code → Reply on the conversation → type a reply → IME Escape (
keyCode 229) in the reply box.3c3246e)67aa60e)After the fix, an
isComposingEscape also keeps the box, its text and focus, neither one reaches the page, and the page stays on Pull requests. A plain Escape still closes the reply.Not shown: a real IME. The IME keys were dispatched as keyboard events with those fields set.
Verification
An AI agent ran each check below.
PullRequestReviewAnnotation.browser.test.tsx(new): Escape, Ctrl+Enter and Cmd+Enter, each withisComposingand withkeyCode 229, keep the reply open with its text, send nothing, are not prevented, and never reach the page's Escape handler. A plain Escape then closes the reply as a handled key, and a plain Ctrl+Enter sends it once.isComposing, onlykeyCode 229, only Escape, or dropping the stop each makes it fail.vp run check:changedpasses.Generated with Claude Opus 5.5 in T3 Code Nightly