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 - #41955
Typing a Japanese, Chinese or Korean theme name in the theme editor and pressing Escape to cancel the IME conversion closes the whole theme editor and throws away the unsaved theme. While inspecting app colors, the same IME Escape also ends inspection. In the Custom CSS editor on Safari, it turns off Tab indenting, so the next real Escape closes the editor one press early. All three Escape handlers act on every Escape, including the ones the IME is using.
Fix
The panel, the inspection listener in ThemeEditorPanel.tsx, and the Custom CSS textarea in ThemeCssEditor.tsx now return early on isComposing || keyCode === 229. This is the same guard used in FileBrowserPanel.tsx and TypographySettings.tsx (#32768). They return without stopping the event, and Base UI's Settings dialog already ignores composing Escapes, so Settings stays open too. A plain Escape works as before: one press leaves inspection, the next closes the editor without closing Settings, and the Custom CSS two-step Escape from #41692 is unchanged. On Safari, the Custom CSS editor also no longer indents or adds a newline when the IME uses Tab or Enter.
Evidence
Setup: Linux, Chromium in the T3 Code Browser panel, isolated vp run dev --no-seed server, 1280×800 viewport. Base d73e41a3fa37, head 0805253d1338.
Steps: Settings → Appearance → Create theme → type Aurora にほん in Theme name → send the IME Escape events: a keydown Escape with isComposing: true (Chrome and Firefox), then a compositionend followed by a keydown Escape with keyCode: 229 (Safari).
Before (base)
After (head)
After those captures, a real Escape key press on head closed the theme editor and left Settings open.
Tests (run by an AI agent):
The three existing Escape tests in ThemeEditorPanel.browser.test.tsx (panel close, leaving inspection, and the Custom CSS two-step) now send both IME Escape events before their plain Escapes.
All three fail on base. Removing either half of the panel guard or the inspection guard fails the matching tests. Reverting the Custom CSS guard fails only the Custom CSS test.
On head the file passed 8 of 8 in each of 3 runs, and vp run check:changed passes.
Not shown: I didn't type through a real OS IME. The Browser panel has no IME on Linux, so the events were sent in the page with the same fields a real IME produces. No mobile version of this editor exists.
No actionable comments were generated in the recent review.
Walkthrough
Escape handlers in the theme CSS editor, theme editor, and app-color inspection now ignore IME composition events, including events with key code 229. Browser tests verify that IME Escape events do not close the editor or exit inspection.
Changes: IME-aware Escape handling
Layer / File(s)
Summary
Guard Escape handling during IME composition apps/web/src/components/settings/ThemeCssEditor.tsx, apps/web/src/components/settings/ThemeEditorPanel.tsx, apps/web/src/components/settings/ThemeEditorPanel.browser.test.tsx
Escape handlers ignore composing events and events with key code 229. Browser tests check that IME Escape events leave the editor open and inspection active before regular Escape events perform their existing actions.
pingdotgg/t3code#25130: Changes Escape handling in the theme editor and during color inspection, which are also updated here.
pingdotgg/t3code#41692: Changes Escape handling in the Custom CSS textarea, which is also updated here.
Suggested reviewers:macroscopeapp, juliusmarminge
Merge Risk: Minimal · up to 08052
This change stops an IME Escape from closing the theme editor or ending color inspection. Plain Escape behavior is unchanged. The change is small and low risk, and the tests exercise the new behavior.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(web): an IME Escape no longer closes the theme editor" follows conventional commit style and names the main change. The changeset adds an IME composition guard (isComposing or keyCode 2…
Description check
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and the title follows the conventional commit guidance. The Problem section states the bug an…
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 "fix(web): an IME Escape no longer closes the theme editor" follows conventional commit style and names the main change. The changeset adds an IME composition guard (isComposing or keyCode 229) to the theme editor panel, the app-color inspection listener, and the Custom CSS textarea. The title covers the primary bug (IME Escape closing the editor). It does not mention the inspection or Custom CSS parts, which is expected for a title.
Full details: Description check
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and the title follows the conventional commit guidance. The Problem section states the bug and reproduction steps. The Change section explains the guard and why it matches existing code in FileBrowserPanel.tsx and TypographySettings.tsx. The Scope section links #32768 and #41692 as related context, but it does not explicitly link an issue that shows the bug or say why no issue is needed. The Verification section lists focused tests, results on base and head, and what was not checked. The Scope gap is minor, so the description is mostly complete.
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.
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.
1 participant
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.
Problem
Typing a Japanese, Chinese or Korean theme name in the theme editor and pressing Escape to cancel the IME conversion closes the whole theme editor and throws away the unsaved theme. While inspecting app colors, the same IME Escape also ends inspection. In the Custom CSS editor on Safari, it turns off Tab indenting, so the next real Escape closes the editor one press early. All three Escape handlers act on every Escape, including the ones the IME is using.
Fix
The panel, the inspection listener in
ThemeEditorPanel.tsx, and the Custom CSS textarea inThemeCssEditor.tsxnow return early onisComposing || keyCode === 229. This is the same guard used inFileBrowserPanel.tsxandTypographySettings.tsx(#32768). They return without stopping the event, and Base UI's Settings dialog already ignores composing Escapes, so Settings stays open too. A plain Escape works as before: one press leaves inspection, the next closes the editor without closing Settings, and the Custom CSS two-step Escape from #41692 is unchanged. On Safari, the Custom CSS editor also no longer indents or adds a newline when the IME uses Tab or Enter.Evidence
Setup: Linux, Chromium in the T3 Code Browser panel, isolated
vp run dev --no-seedserver, 1280×800 viewport. Based73e41a3fa37, head0805253d1338.Steps: Settings → Appearance → Create theme → type
Aurora にほんin Theme name → send the IME Escape events: akeydownEscape withisComposing: true(Chrome and Firefox), then acompositionendfollowed by akeydownEscape withkeyCode: 229(Safari).After those captures, a real Escape key press on head closed the theme editor and left Settings open.
Tests (run by an AI agent):
ThemeEditorPanel.browser.test.tsx(panel close, leaving inspection, and the Custom CSS two-step) now send both IME Escape events before their plain Escapes.vp run check:changedpasses.Not shown: I didn't type through a real OS IME. The Browser panel has no IME on Linux, so the events were sent in the page with the same fields a real IME produces. No mobile version of this editor exists.
Generated with Claude Opus 5.5 in T3 Code Nightly