Skip to content

fix(ui): ignore the IME-composition Enter in name and notes inputs - #10711

Closed
makoto-developer wants to merge 1 commit into
stablyai:mainfrom
makoto-developer:fix/ime-composition-enter-guards
Closed

makoto-developer wants to merge 1 commit into
stablyai:mainfrom
makoto-developer:fix/ime-composition-enter-guards

Conversation

@makoto-developer

@makoto-developer makoto-developer commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

CJK IMEs (Japanese/Chinese/Korean) fire a keydown for 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:

  • Project group name dialog (New/Rename Project Group) — the field sits in a <form>, so the composition Enter submitted it implicitly.
  • Host rename dialog
  • Worktree details dialog — display name, GH issue, GH PR, and the notes textarea. The textarea saves on a plain Enter and closes the dialog, so a Japanese note could not get past its first conversion.
  • Untitled file rename dialog — file name and folder fields.
  • Editor header inline file rename

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 reads nativeEvent.isComposing with a keyCode === 229 fallback for IMEs that do not set the flag on keydown.

ProjectGroupNameDialog differs slightly: it cancels the composition Enter with preventDefault() so the form's implicit submission never fires, rather than returning early from a submit handler.

Screenshots

No visual change.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added 5 *.ime-enter.test.tsx files (18 cases). Each covers both IME signals (isComposing and keyCode === 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-coverage flags unlocalized "Ghostty" keywords already on main.

AI Review Report

Reviewed with Claude Code. Checks and findings:

  • Cross-platform (macOS/Linux/Windows): IME composition state is reported by Chromium on all three platforms; the guard adds no platform branch and touches no shortcut, label, path, or shell behavior. WorktreeMetaDialog keeps its existing isScreenSubmitShortcut() call, which already resolves ⌘/Ctrl per platform — the guard runs before it and does not alter that resolution.
  • SSH / remote / folder workspaces: all five inputs are renderer-local; no IPC, git, or host-dependent path is involved.
  • Agent / integration / git provider neutrality: no provider-specific code touched.
  • Performance: one boolean check at the top of existing keydown handlers.
  • UI quality: no rendered output changes; Escape during composition now cancels the conversion instead of the dialog, which matches the guards already shipped for worktree titles.
  • Risk considered: guarding on keyCode === 229 could 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.

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.
@makoto-developer
makoto-developer marked this pull request as ready for review July 26, 2026 07:30
@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

IME-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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title accurately summarizes the IME Enter handling fix across name and notes inputs.
Description check ✅ Passed The description matches the required template and covers summary, screenshots, testing, review, security, and notes.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin

OrcaWin commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@OrcaWin OrcaWin closed this Jul 28, 2026
nwparker pushed a commit that referenced this pull request Oct 4, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants