Skip to content

fix(web): IME keys no longer cancel or send a pull request review reply - #41932

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-pr-review-reply-ime-keys
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-pr-review-reply-ime-keys

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

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
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.
  • vp run check:changed passes.

Generated with Claude Opus 5.5 in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: maria-rcks

Merge Risk: Minimal · previous review 67aa6

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b761bf8 and 67aa60e.

Files selected for processing: 2

  • apps/web/src/components/pullRequest/PullRequestReviewAnnotation.browser.test.tsx
  • apps/web/src/components/pullRequest/PullRequestReviewAnnotation.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

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.

Interaction Before · 3555296ca0 After · a90e212d68
IME Escape Before: reply closes After: reply remains open
IME Ctrl+Enter Before: one reply request After: zero reply requests
Seven-case recording Before video After video

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.

Driver and seed · App launcher · Launcher helper · Observations

Not shown:

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

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 24, 2026
@juliusmarminge
juliusmarminge merged commit 3dd4f14 into pingdotgg:main Nov 24, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants