Repository navigation
fix(ui): ignore the IME-composition Enter in name and notes inputs - #10711
makoto-developer wants to merge 1 commit into
Conversation
A CJK IME fires a keydown for the Enter that only confirms a conversion candidate. Five inputs committed on that keydown, saving a half-converted value while the user was still typing: - Project group name dialog (create/rename) — submitted the form implicitly - Host rename dialog - Worktree details dialog — display name, GH issue/PR, and the notes textarea, which saves on a plain Enter - Untitled file rename dialog — file name and folder - Editor header inline file rename They now use the existing isImeCompositionKeyDown() helper, matching the guards already in place for worktree titles, tabs, and the workspace name field.
📝 WalkthroughWalkthroughIME-aware keydown guards were added to editor rename controls, host and project-group rename dialogs, and worktree metadata inputs. These guards return early or prevent default form submission for composition events and Enter events reported with keyCode 229. New Vitest tests cover composing Enter, keyCode 229, and normal Enter behavior across each affected component. 🚥 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 |
|
Thank you for the IME composition fix. Your original 10-file Enter patch is preserved byte-for-byte (stable patch ID 13a5659c316e653c8a2b124af74c1d44a969cb42) as the first commit of #11067, with you retained as its author. That PR now adds a separate follow-up protecting Radix's capture-phase Escape handling during composition; the combined branch passes the focused 34-case suite and all 22 GitHub checks. Closing this PR as superseded by #11067 so the contributor patch and the required follow-up land together. |
Restore IME Enter protection in workspace details by reusing the existing composition tracker. Reset Notes ownership at textarea detachment and preserve sizing behavior. Repair isolated native test-window delivery without changing the production foreground policy or original native input assertions. Fixes #24097 Related contributor history: #10711, #11067, #13128, #13282. Original implementation and macOS recordings: @setodeve, commit b30f095. Verified on required stock Linux X11/Wayland checks and independent frozen-source review. Co-authored-by: setodeve <[email protected]>
Summary
CJK IMEs (Japanese/Chinese/Korean) fire a
keydownfor the Enter that only confirms a conversion candidate. Five inputs committed on that keydown, so they saved a half-typed value while the user was still composing:<form>, so the composition Enter submitted it implicitly.All five now use the existing
isImeCompositionKeyDown()helper — the same guard already applied to worktree titles (#7081), tabs, and the workspace name field (#9526). It readsnativeEvent.isComposingwith akeyCode === 229fallback for IMEs that do not set the flag on keydown.ProjectGroupNameDialogdiffers slightly: it cancels the composition Enter withpreventDefault()so the form's implicit submission never fires, rather than returning early from a submit handler.Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm build*.ime-enter.test.tsxfiles (18 cases). Each covers both IME signals (isComposingandkeyCode === 229) and keeps a plain-Enter control case, so a regression that drops the guard — or one that swallows a real Enter — fails the suite.Pre-existing failure unrelated to this PR:
verify:localization-coverageflags unlocalized "Ghostty" keywords already onmain.AI Review Report
Reviewed with Claude Code. Checks and findings:
WorktreeMetaDialogkeeps its existingisScreenSubmitShortcut()call, which already resolves ⌘/Ctrl per platform — the guard runs before it and does not alter that resolution.keyCode === 229could in theory suppress a legitimate Enter. It cannot here — 229 is only reported while an IME owns the key event, and the plain-Enter control tests confirm the normal path still commits.Security Audit
No new input parsing, command execution, path handling, auth, secret, dependency, or IPC surface. The change only decides whether an existing save handler runs for a given keydown. Saved values continue through the same validation as before.
Notes
Reproducing needs a CJK IME: type a Japanese word, press Enter to confirm the conversion, and observe that the value is no longer committed mid-composition.
ELI5
With Japanese/Chinese/Korean keyboards, pressing Enter only to confirm a conversion candidate also submitted name/notes fields. Orca ignores that composition Enter so you finish typing before save.