Repository navigation
fix(file-explorer): ignore IME confirm Enter in the inline name input - #25038
kambarakun wants to merge 1 commit into
Conversation
The File Explorer's New File / New Folder / Rename input submitted on every Enter keydown, including the Enter that only confirms a CJK IME conversion, so a name typed with a Japanese, Chinese or Korean input method was created or renamed half-typed. Escape, which the IME uses to cancel a conversion, dismissed the input the same way. Route the input through the shared IME Enter gesture tracker so the marked confirm Enter and its unmarked follow-up are both ignored, and clear the tracker on blur and when the keyed input element is replaced. Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- IME confirm Enter no longer submits the File Explorer name input —
InlineInputRownow guards its keydown with the shareduseImeEnterGestureOwnership()tracker plusisImeCompositionKeyDown(), and feeds the trackercompositionstart/compositionend/keyup. The submit and cancel callbacks are untouched, so behavior for a normal Enter / Escape is unchanged (src/renderer/src/components/right-sidebar/file-explorer-inline-input-row.tsx:154). - Ownership lifetime is bounded — the tracker is reset in the ref callback (covering a keyed remount that skips blur) and on blur, matching the recipe in
docs/reference/ime-regression-checklist.md. - Five regression tests — marked confirms are ignored before a plain Enter submits with the full value, the unmarked redispatch is swallowed in both macOS and Windows/Linux event orders, and blur / keyed-remount release ownership. Test 1, 2, and 5 are exact-assertion tests that fail without the production change; I ran the file locally and all 5 pass.
The wiring matches the existing reference call site in ComposerParentWorktreePicker.tsx:312, so this is a reuse of the shared state machine rather than a second one. The residual keyCode-229-after-compositionend gap the author documented lives in the tracker's arming rule and is identical on main; correctly left out of this one-input fix.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change makes the File Explorer inline input ignore IME confirmation Enter and Escape, and it comes with focused tests. No concrete merge-blocking risk was found. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |

ELI5
When you name a file in the File Explorer with a Japanese, Chinese or Korean keyboard, you first type the sounds, pick the right characters, and press Enter to say "yes, these characters". Orca treated that Enter as "I'm done, create the file", so the file was created before the name was finished. Now that Enter only confirms the characters, and the next Enter creates the file.
What Changed
議事録and confirming it there was no chance to add.md— a file named議事録already existed and the input was gone. An Escape that cancels a conversion dismissed the input the same way.InlineInputRow(file-explorer-inline-input-row.tsx) acted on everyEnter/Escapekeydown. It now asks the existing shared tracker,useImeEnterGestureOwnership()together withisImeCompositionKeyDown(), before acting, and feeds the trackerkeyupandcompositionstart/compositionend. The tracker is reset on blur and whenever the keyed<input>element is replaced, so ownership cannot leak into the next input.One production file (+17/−1) and one new test file. No new helper and no second composition state machine.
Why
People who type with an IME cannot give a file a name with an extension (or any name that needs more than one conversion) without the input firing early. This is the same bug class that #7081 fixed for the worktree / tab / window rename inputs (#6980); this input was missed.
Alternative considered: a plain
isComposingguard on the keydown. It is smaller, but some input methods deliver the confirmation Enter twice and only mark the first one, so the unmarked follow-up would still submit. The shared gesture tracker already covers that, anddocs/reference/ime-regression-checklist.mdasks callers to reuse it rather than add another state machine, so the input is wired to it the same way #22627 does.Linked Issue
Fixes #25035
Visual Proof
Captured from a hidden Electron window (e2e build,
ORCA_BACKGROUND_LAUNCH=1, disposable repo). The script opens New File, drives a Chromium IME composition over CDP (Input.imeSetComposition,ぎじろく→議事録), then sends the confirmation Enter as a keydown marked with keyCode 229. Same script for both runs; only the production file differs.Before (
main)After (this PR)
What each run recorded:
main)議事録議事録.mdand a normal Enter議事録.mdcreated, input closedLimit: the captures exercise Chromium's composition pipeline, not a native OS input method. Separately, both sides were checked by hand on macOS with a Japanese IME: the bug in the installed app (1.4.219), and the fix in a dev build of this branch. Windows and Linux were not tried.
No media is committed to this branch. The two screenshots are served from an assets-only branch on my fork, pinned by commit SHA.
Testing
Hand-tested on macOS with a Japanese IME in a dev build of this branch (
pnpm dev, local git worktree): the confirmation Enter no longer submits the File Explorer name input. The same build was also exercised through the scripted hidden-window run above.New
file-explorer-inline-input-ime-enter.test.tsx(5 tests):keyup, and before it) until the carry expires;compositionendnever arrives;With the production change reverted, 3 of the 5 fail; the other two cover the tracker's lifetime (blur, keyed remount), which only exists after the change.
Run locally on macOS at 4109946:
pnpm test src/renderer/src/components/right-sidebar/file-explorer-inline-input-ime-enter.test.tsx src/renderer/src/components/right-sidebar/file-explorer-inline-input-outside-click.test.tsx src/renderer/src/components/right-sidebar/file-explorer-inline-rename-flow.test.tsx src/renderer/src/lib/ime-composition-keyboard-event.test.ts pnpm tc pnpm lint pnpm run check:code-quality:changedResults: 4 files / 24 tests passed; typecheck, lint and the changed-code quality gate passed. The full
pnpm testandpnpm buildwere not run locally (the e2e-mode build used for the captures succeeded), so those are left to CI. Windows, Linux and SSH were not run; the Windows / Linux event order is covered by the component test only.AI Disclosure
Produced with Claude Code under my direction: Claude Fable 5.1 for investigation, planning and review, Claude Opus for the implementation. The agent also captured the evidence above and drafted this description.
Review
Review summary from the AI agent (Claude Fable 5.1, reviewing the Opus implementation):
Independent reviews run locally on 4109946 before requesting review: Codex (read-only) and the CodeRabbit CLI. Both raised the same single point and nothing else. If an Enter marked only by keyCode 229 arrives after
compositionend, so that neither the event nor the tracker says "composing", and an unmarked Enter follows, the first one is ignored but does not arm the carry, and the second one submits. That is true of the code as written. It is the shared tracker's arming rule rather than this call site:ComposerParentWorktreePickeronmainis wired the same way. I left it unchanged for two reasons. I have no trace of an input method producing that order in Electron. And arming on a bare Enter/229 would instead swallow the real Enter for an input method that reports a non-composing Enter as 229 and then redispatches it. Changing that rule affects every caller and needs native traces, so it does not belong in a one-input fix. Happy to follow up separately if you want it.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Mobile is not affected (desktop renderer component only). No settings, persisted state or wire format is involved, so there is no backwards-compatibility surface.
X: @kambarakun
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code