Repository navigation
fix(new-workspace): ignore IME composition Enter in workspace name field - #9526
Merged
AmethystLiang merged 2 commits intoJul 20, 2026
Merged
Conversation
An Enter that only commits a CJK IME candidate (Korean/Japanese/Chinese) was handled as a real Enter by the smart workspace name field, moving focus mid-composition. Chromium then re-commits the composing character into the controlled input, duplicating the last syllable (e.g. typing a Korean name and pressing Enter turned it into the name plus a repeated final syllable). Guard the Enter branch with the existing isImeCompositionKeyDown helper, matching WorktreeTitleInlineRename and the other Enter handlers that already check nativeEvent.isComposing / keyCode 229.
Contributor
📝 WalkthroughWalkthroughSmartWorkspaceNameField now detects IME composition during Enter keydown events and exits before selection or focus logic runs. A new Vitest/React test suite mocks required dependencies, manages a DOM root per test, dispatches Enter events, and verifies behavior for 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
AmethystLiang
self-requested a review
July 20, 2026 07:02
…anch Add a differential pair (composition vs plain Enter with the source popover open and a highlighted row) proving the guard short-circuits before the row-select branch, not just the onPlainEnter fall-through. Co-authored-by: Orca <[email protected]>
AmethystLiang
approved these changes
Jul 20, 2026
Contributor
|
Thanks for the PR! PR approved and landing soon. Will be in the next release. Usually within 24 hours. Can also get on the RC updates (press "shift" when click "check update") if you need it sooner :-) |
5 tasks done
6 tasks
4 of 5 tasks
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…eld (stablyai#9526) Co-authored-by: Orca <[email protected]> Co-authored-by: Jinjing <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #9525
Summary
Typing a CJK workspace name (Korean/Japanese/Chinese) in the create-worktree dialog and pressing Enter while the last syllable is still composing duplicates that syllable —
배포becomes배포포, and the wrong name flows into the created workspace/branch.Root cause: the Enter handler in
SmartWorkspaceNameFieldtreats the IME-composition Enter (the keypress that only finalizes the candidate) as a real Enter and runsonPlainEnter(), which moves focus to the Agent combobox. Moving focus mid-composition makes Chromium re-commit the composing character into the controlled input, appending it a second time.Fix: guard the Enter branch with the existing shared helper
isImeCompositionKeyDown()(nativeEvent.isComposing || keyCode === 229) — the exact pattern this codebase already uses inWorktreeTitleInlineRename,AddRepoRemoteStep,AddRepoCloneStep,JiraIssueWorkspace, and the TaskPage Enter handlers. The smart workspace-name field was the one Enter-commit path missing it. After the fix, the first Enter finalizes the composition (field keeps the correct text, focus stays put) and the next Enter advances focus as before — matching the inline-rename field's behavior.Related: #8038 tracks the same missing-guard family in the desktop terminal. Tab/native focus traversal was verified unaffected (the browser-native focus move lets the IME finalize correctly; only the JS-initiated focus move triggered the re-commit).
Screenshots
Before (Orca v1.4.146 stable, macOS Korean 2-Set IME) — typing
테스트, pressing Enter mid-composition yields테스트트:orca-ime-bug-repro.mp4
After (this branch, dev build, same IME) — same input, name stays
테스트, focus advances on the following Enter:orca-ime-fix-after.mp4
Testing
pnpm typecheck— clean (node, cli, web)pnpm test— 32,326 passed, 56 skipped, 1 baseline-only failure (see below)pnpm lint— my files clean; 2 baseline-only errors (see below)pnpm build— fails locally on an environment limitation only (see below)SmartWorkspaceNameField.ime-enter.test.tsx(happy-dom render of the real component):isComposing: true→onPlainEnterNOT calledkeyCode === 229(IMEs that skipisComposingon keydown) →onPlainEnterNOT calledonPlainEntercalled once (no regression)mainand pass with this change.Baseline-only failures — this branch differs from
mainby exactly the two files in this diff (git diff main --name-only), so all of the following reproduce identically on cleanmain:switch-exhaustiveness-checkinsrc/main/daemon/daemon-server.ts:680andsrc/renderer/src/components/skills/skill-freshness-group.tsx:101(the latter already noted as baseline in Fix native Windows PTY startup query handling #9500).src/renderer/src/lib/i18n-jsx-spacing-guard.test.ts— "keeps an explicit space after 'Filter pull requests' in components/github/PRFilterSections.tsx" (same family as the recent fix(ui): restore spaces around orca.yaml in trust dialog #9511/fix(ui): restore missing spaces in i18n JSX fragment copy #9513 spacing fixes).native/computer-use-macosrequiresswift-tools-version: 6.0; my local toolchain is Swift 5.10, so the native step fails before reaching any code in this diff.AI Review Report
Reviewed the diff with my AI coding agent. Main risks checked and results:
KeyboardEvent.isComposingplus thekeyCode === 229fallback; no platform branches, no shortcuts/labels/paths/shell involvement. Behavior on Linux (IBus) and Windows (IME) IMEs follows the same keydown contract; non-IME input is unaffected becauseisComposingis false andkeyCodeis the real key.WorktreeTitleInlineRename.Security Audit
Notes
isImeCompositionKeyDownhelper is intentionally reused rather than a new predicate, keeping IME-Enter semantics consistent across the app.