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): an IME Escape no longer closes the theme editor or ends inspection - #42332
In the floating theme editor (Settings → Appearance → Create theme or Edit theme), pressing Escape to cancel an IME candidate window while typing in a field closed the editor, dropping unsaved changes. The panel's Escape handler had no composition check. Three other Escape paths in the editor had the same gap:
While Inspect app colors was on, its document capture listener took the IME Escape, ended inspection and prevented the key.
The Custom CSS editor guarded isComposing but not keyCode 229, so it prevented that key and turned off Tab indentation.
The color picker popover, portaled outside the panel, closed and reverted the color edit. Base UI's dismiss skips composing keys and its compositionend window, but treats a bare keyCode 229 as a dismiss request.
All four now ignore IME keys (isComposing, or keyCode === 229), as in #41784 and #41837. The panel still stops propagation of an IME Escape, and the picker cancels a 229 dismiss. A plain Escape closes the editor, leaves inspection, or reverts and closes the picker as before.
How input reached the app: the accent color was typed through the real app in headless Chromium. No OS IME was available, so the IME Escape is a keydown with the shapes browsers send during composition (a bare keyCode 229, then isComposing: true), dispatched on the field from page script. The plain Escape is a real key press.
Before (main)
After
After the fix, a plain Escape still closes the editor:
Tested:
Extended four existing cases in ThemeEditorPanel.browser.test.tsx. The editor and inspection tests cover three IME Escape shapes, starting with a bare keyCode 229, and verify each stays unprevented. The Custom CSS test checks that a bare 229 stays unprevented. The picker test checks that a bare 229 keeps the popover open and preserves the edit. All four fail on main and pass with this change; all 8 cases in the file pass.
vp run check:changed: format, lint, knip, typecheck, tests and React compiler pass.
Prepared with Claude Opus 5.5 in T3 Code (Claude Code harness).
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Reviewing files that changed from the base of the PR and between 3838428 and 1a516b1.
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
Theme editor Escape handlers now ignore composing events and events with keyCode 229. Browser tests verify that these events do not close the editor or Settings, end inspection, revert picker edits, or prevent the Custom CSS Escape event.
Changes: IME Escape handling
Layer / File(s)
Summary
Guard Escape handling across theme editors apps/web/src/components/settings/ThemeEditorPanel.tsx, apps/web/src/components/settings/ThemeColorPicker.tsx, apps/web/src/components/settings/ThemeCssEditor.tsx, apps/web/src/components/settings/ThemeEditorPanel.browser.test.tsx
Theme editor, inspection, picker, and Custom CSS handlers ignore composing or keyCode 229 Escape events. Browser tests cover those interactions and verify regular Escape behavior remains in place.
This change stops IME Escape key presses from closing the theme editor, ending inspection, or reverting color edits, while plain Escape behaves as before. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: an IME Escape no longer closes the theme editor or ends color inspection. The changeset covers that behavior in ThemeEditorPanel, ThemeCssEditor, and ThemeColorPicker,…
Description check
The description follows the template. It has a Problem section with the reproduction context, a Change section that explains the fix across the four paths, a Scope section that cites related PRs #4178…
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 names the main change: an IME Escape no longer closes the theme editor or ends color inspection. The changeset covers that behavior in ThemeEditorPanel, ThemeCssEditor, and ThemeColorPicker, and the title states it in a conventional commit format. It is a bit long at 76 characters, but it is specific and accurate.
Full details: Description check
Explanation
The description follows the template. It has a Problem section with the reproduction context, a Change section that explains the fix across the four paths, a Scope section that cites related PRs #41784 and #41837 as the pattern but does not link an issue or explain why no issue exists, and a Verification section with specific tests, results, and before/after screenshots. The Scope section is the only gap. It should link the bug report or state why no issue is needed, since the template asks for this. The template's model attribution line is present.
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; 9 remain after this review.
On both commits, open Settings → Appearance → Create theme and enter Aurora. Select Japanese–Romaji Hiragana, type kana (かな candidate window), and press physical Escape in Theme name, Theme name with inspection enabled, expanded Custom CSS, and the Accent picker after setting #e11d48. Repeat ordinary Escape from fresh editors on the U.S. layout. Finally replay bare Escape/keyCode=229/isComposing=false into CSS and picker fields.
Native environment for both sides: macOS 26.6.2, Apple silicon, headed Chrome 156.0.8078.4, dark appearance, 1400×650 viewport, separate fresh databases and synthetic demo projects. Every native composing Escape arrived as key=Escape, keyCode=229, isComposing=true. Videos record the browser viewport receiving physical macOS keystrokes; native candidate windows appear in the supporting stills.
Ordinary Escape behaved identically on both commits: it closed the editor, ended inspection while retaining the editor, disabled CSS Tab indentation while retaining the editor, and closed the picker while reverting Accent to its dark-theme starting value #346bf1. A single composing Escape dismisses the candidate list while leaving marked かな text; the unsaved Aurora prefix survives on head.
Input-source settings were restored and verified against their original selected and enabled values.
Supplemental scenario
Linux Chromium, light appearance, 1280×800. This replays the exact recorded macOS composing event rather than generating a native IME candidate. scenarios:prove exited 0: the scenario failed on base and passed on head.
Native Safari IME event delivery was not verified. Its bare keyCode 229 shape was replayed in the real Chromium app, establishing handler behavior rather than Safari's generation of the event.
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:S10-29 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
3 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.
In the floating theme editor (Settings → Appearance → Create theme or Edit theme), pressing Escape to cancel an IME candidate window while typing in a field closed the editor, dropping unsaved changes. The panel's Escape handler had no composition check. Three other Escape paths in the editor had the same gap:
isComposingbut notkeyCode229, so it prevented that key and turned off Tab indentation.compositionendwindow, but treats a barekeyCode229 as a dismiss request.All four now ignore IME keys (
isComposing, orkeyCode === 229), as in #41784 and #41837. The panel still stops propagation of an IME Escape, and the picker cancels a 229 dismiss. A plain Escape closes the editor, leaves inspection, or reverts and closes the picker as before.How input reached the app: the accent color was typed through the real app in headless Chromium. No OS IME was available, so the IME Escape is a
keydownwith the shapes browsers send during composition (a barekeyCode229, thenisComposing: true), dispatched on the field from page script. The plain Escape is a real key press.main)After the fix, a plain Escape still closes the editor:
Tested:
ThemeEditorPanel.browser.test.tsx. The editor and inspection tests cover three IME Escape shapes, starting with a barekeyCode229, and verify each stays unprevented. The Custom CSS test checks that a bare 229 stays unprevented. The picker test checks that a bare 229 keeps the popover open and preserves the edit. All four fail onmainand pass with this change; all 8 cases in the file pass.vp run check:changed: format, lint, knip, typecheck, tests and React compiler pass.Prepared with Claude Opus 5.5 in T3 Code (Claude Code harness).
🤖 Generated with Claude Code