Skip to content

fix: prevent IME Enter from submitting text fields across Orca - #25480

Merged
nwparker merged 7 commits into
mainfrom
nwparker/IME-enter-issues
Oct 5, 2026
Merged

nwparker merged 7 commits into
mainfrom
nwparker/IME-enter-issues

Conversation

@nwparker

@nwparker nwparker commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Pressing Enter to confirm Japanese, Chinese, or Korean text should not also create a file, save a name, send a comment, or select a command. Keep the field open until the user finishes typing and deliberately submits.

What Changed

  • Includes @kambarakun's File Explorer fix from fix(file-explorer): ignore IME confirm Enter in the inline name input #25038, retaining contributor attribution. Adds coverage for New File, New Folder, and Rename, and respects active composition when Escape has no event marker.
  • Applies the existing IME gesture tracker through Input, Textarea, CommandInput, and equivalent unstyled fields. This covers settings, names, issue/review pickers, comments, annotations, searches, and Native Chat questions. Existing field-level trackers are removed where the shared component now owns them.
  • Fixes tracker gaps: keyCode-only confirmation protects its unmarked follow-up, including after a Process/229 release, and continued typing releases that protection immediately even when animation frames are delayed.
  • Guards notebook execution and Markdown menu actions, which handle keyboard events outside those field components. Screen-submit shortcuts also recognize keyCode 229. Markdown retains deliberate save shortcuts when composition state lingers; overlays ignore IME-marked Escape before document-capture dismissal.

Why

The original File Explorer fix was sound but the same omissions appeared in many other fields. Protecting shared inputs prevents another round of per-field omissions. Reusing the existing tracker preserves both confirmation event orders, blur/remount cleanup, ordinary Enter, modifier submits, and Shift+Enter; a plain isComposing check misses the unmarked follow-up.

Linked Issue

Fixes #25035. Incorporates and extends #25038; that narrower PR does not need to land separately.

Visual Proof

Hidden Electron renderer, macOS, disposable folder workspace, Chromium IME composition via CDP. No native OS IME or foreground window was used.

Before: confirming 議事録 closes the input and creates the incomplete filename.

Before: premature file creation

After: the same confirmation leaves the name editable; typing .md and another Enter creates 議事録.md.

After: confirmation leaves the input open

Another affected surface: Save As remains open after confirming 報告, then saves 報告-final.md after further typing and deliberate Enter.

Save As after IME confirmation

Testing

  • Tested locally through hidden Electron/CDP; no manual native-keyboard test.
  • Automated regressions added/updated.

891 tests passed across 71 files on the branch after merging current main, including the existing terminal IME suites, Native Chat keyboard handlers, workspace metadata, command search, parent pickers, comments, the new shared-field and overlay tests, and CSV editing consumers added by current main. An independent review confirmed that the merged Textarea cell variant and CSV key handling remain compatible. Another 44 tests across seven neighboring rename/field files pass, including the editor-header test updated to distinguish confirmation redispatch from a later deliberate Enter.

ORCA_BACKGROUND_LAUNCH=1 pnpm run test:e2e tests/e2e/file-explorer-ime-enter.spec.ts --workers=1: all six real Electron tests passed. Each operation covers continued typing and a Process/229 release followed by an unmarked confirmation redispatch, then deliberate Enter without additional typing. They check the Explorer and disk. The first run exposed the delayed-frame carry bug on Rename; the fixed run passes all operations. The redispatch is replayed synchronously after key release so rendering timing cannot make the test flaky.

pnpm tc and pnpm run check:code-quality:changed pass. The E2E run rebuilt the Electron app in e2e mode and the CLI successfully. The full pnpm lint pipeline also passes. Final-head CI passed all five unit-test shards, relay integration, both packaging checks (including Windows), Electron E2E, and the aggregate verification checks. The separate, explicitly non-gating typecheck:e2e reports existing repository-wide type debt and missing cloud dependencies; no diagnostic names the new spec.

Review

Three independent sub-agent reviews and a second pass checked event ordering, consumer regressions, and coverage. Findings fixed: keyCode-only follow-up ownership, Process/229 release ordering, delayed-frame suppression after further typing, Markdown save handling, and overlay Escape capture. Regression tests cover these cases. Both actionable bot comments are addressed. Tests also exercise bubbling into command selection, lifecycle callbacks, blur, remounts, normal keys, modifier submits, and newlines. Existing command-input mocks were replaced with the real component where they would otherwise bypass the new protection.

Agent skill upstream boundary

  • Not applicable; no upstream skill content copied.

Notes

CI exposed a false-positive localization finding in a hook-preparation function newly added on main. Renaming its local confirm function to confirmHook avoids confusing internal hook-kind keys with browser-dialog text. Independent review confirmed this is a pure identifier rename; all eight related tests and localization coverage pass.

Changes are renderer event handling. Local/SSH execution routing, Git providers, file paths, and remote wire formats are unchanged. Folder workspaces are exercised by the Electron tests. Terminal and Native Chat retain their specialized input ownership. Mobile native onSubmitEditing paths were inspected and left unchanged. Native Windows/Linux/macOS IMEs and live SSH were not exercised. Overlay Escape protection relies on native IME markers; markerless Escape during active composition remains a preexisting overlay limitation. Hidden-renderer no-redispatch frame expiry is covered deterministically in unit tests.

Checklist

  • Focused on one keyboard behavior; most affected files only substitute the guarded field.
  • Explained the user-facing before/after, mechanism, and alternatives.
  • Before/after screenshots attached.
  • Self-reviewed for correctness, security, and performance.
  • Cross-platform, SSH, folder workspace, and provider impact considered.
  • Focused tests, full lint, typecheck, changed-code gate, Electron E2E, and all final-head CI checks pass.

kambarakun and others added 2 commits October 5, 2026 00:53
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]>
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c83e8466-714d-41b3-b0e9-d2f8127eb008
📥 Commits

Reviewing files that changed from the base of the PR and between d133e7f and 167259f.

📒 Files selected for processing (3)
  • src/renderer/src/components/editor/EditorPanelHeaderPath.test.tsx
  • src/renderer/src/lib/worktree-creation-hook-preparation.ts
  • tests/e2e/file-explorer-ime-enter.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The change adds shared IME-aware input and textarea components and applies them to renderer fields across the application. It updates keyboard handling in selected editors, command search, worktree fields, and File Explorer inline inputs. Tests cover IME confirmation, Enter redispatch, Escape handling, and ordinary key behavior. An end-to-end test covers File Explorer file creation, folder creation, and rename.

Fixed issue severity: Medium

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 16725

The IME regression tests and local helper rename present no identified merge blocker. Complete the pending CI checks before merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 16725

The inspected changes add input safeguards rather than new access or permissions. Broad reuse makes correct submission and cleanup important, and native input-method behavior has not been fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected exposure is existing renderer action callbacks, including file-name submission, issue creation, and link saving. Wrapping these callers introduces an event gate rather than a new action route; no increased identity, tenant, or service authority was established in this scope.

Security Findings and Attack Paths

  • inferred — A second unmarked Enter after consuming the pending token can reach an ordinary callback. This single-consumption behavior predates the PR, and supported native IMEs producing multiple unintended unmarked confirmations were not established. The inspected new consumers previously used raw inputs with unchanged action handlers, so this hypothesis does not demonstrate an introduced or worsened attack path.

Trust Boundaries and Controls

  • observed — IME ownership is an input-intent control, not an authentication boundary. Fields stop propagation for owned events, while the overlay helper prevents default dismissal for IME-marked Escape before forwarding ordinary Escape callbacks. These controls address separate event phases.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 67 functions across 63 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed #25035 requires New File, New Folder, and Rename to remain open during IME confirmation, and identifies IME Escape cancellation as a related case. InlineInputRow uses the shared IME gesture tracker …
Out of Scope Changes check ✅ Passed The shared-field migrations, keyboard-action guards, overlay handling, tests, and documentation address the same IME confirmation behavior described in #25035 and the PR's stated broader intent. The `…
Title check ✅ Passed The title clearly summarizes the main change: preventing IME-confirmation Enter events from submitting text fields across Orca.
Description check ✅ Passed The description covers the required sections with a clear explanation of the change and rationale, a linked issue, before-and-after visual proof, detailed testing results, review notes, scope consider…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9469a407-11bd-407c-bec6-65f7aed20813
📥 Commits

Reviewing files that changed from the base of the PR and between 67fc708 and ef5cf36.

📒 Files selected for processing (60)
  • docs/reference/ime-regression-checklist.md
  • src/renderer/src/components/LinearIssueTextEditor.tsx
  • src/renderer/src/components/TerminalSearch.tsx
  • src/renderer/src/components/automations/AutomationEditorPromptSection.tsx
  • src/renderer/src/components/automations/AutomationTimeField.tsx
  • src/renderer/src/components/browser-pane/annotate/MarkupOverlay.tsx
  • src/renderer/src/components/browser-pane/annotate/browser-page-annotation-tray.tsx
  • src/renderer/src/components/browser-pane/annotate/pending-browser-annotation-card.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserFind.tsx
  • src/renderer/src/components/cmd-j/PaletteFilterFieldOptions.tsx
  • src/renderer/src/components/diff-comments/DiffCommentCard.tsx
  • src/renderer/src/components/diff-comments/DiffCommentDraftCard.tsx
  • src/renderer/src/components/diff-comments/DiffCommentPopover.tsx
  • src/renderer/src/components/editor/EditorPanelHeaderPath.tsx
  • src/renderer/src/components/editor/IpynbViewer.tsx
  • src/renderer/src/components/editor/MarkdownPreviewAnnotationComposer.tsx
  • src/renderer/src/components/editor/PdfFind.tsx
  • src/renderer/src/components/editor/RichMarkdownLinkBubble.tsx
  • src/renderer/src/components/editor/rich-markdown-key-handler.test.ts
  • src/renderer/src/components/editor/rich-markdown-key-handler.ts
  • src/renderer/src/components/github-project/ProjectCellValueEditors.tsx
  • src/renderer/src/components/gitlab-item-dialog/gitlab-item-dialog-view.tsx
  • src/renderer/src/components/linear-issue-sub-issues.tsx
  • src/renderer/src/components/linear-item-drawer-comment-footer.tsx
  • src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx
  • src/renderer/src/components/new-workspace/ComposerParentWorktreePicker.test.tsx
  • src/renderer/src/components/new-workspace/ComposerParentWorktreePicker.tsx
  • src/renderer/src/components/new-workspace/ProjectCombobox.tsx
  • src/renderer/src/components/new-workspace/RunTargetField.tsx
  • src/renderer/src/components/pull-request-page/mentions/textarea.tsx
  • src/renderer/src/components/right-sidebar/AiVaultPanelHeader.tsx
  • src/renderer/src/components/right-sidebar/SearchQueryRow.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/active-content.tsx
  • src/renderer/src/components/right-sidebar/file-explorer-inline-input-ime-enter.test.tsx
  • src/renderer/src/components/right-sidebar/file-explorer-inline-input-row.tsx
  • src/renderer/src/components/right-sidebar/right-panel-comment-composer.tsx
  • src/renderer/src/components/right-sidebar/source-control/panel/header-toolbar.tsx
  • src/renderer/src/components/sidebar/RemoteFileBrowser.tsx
  • src/renderer/src/components/sidebar/WorkspaceKanbanSettingsMenu.tsx
  • src/renderer/src/components/sidebar/WorktreeDisplayNameField.tsx
  • src/renderer/src/components/sidebar/WorktreeIssueLinkField.tsx
  • src/renderer/src/components/sidebar/WorktreeMetaDialog.tsx
  • src/renderer/src/components/sidebar/WorktreeReviewLinkField.tsx
  • src/renderer/src/components/skills/SkillShareReleaseNotesField.tsx
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.tsx
  • src/renderer/src/components/tab-bar/use-tab-bar-quick-command-search-input.test.ts
  • src/renderer/src/components/tab-bar/use-tab-bar-quick-command-search-input.test.tsx
  • src/renderer/src/components/tab-bar/use-tab-bar-quick-command-search-input.ts
  • src/renderer/src/components/task-page/linear/IssueDialog.tsx
  • src/renderer/src/components/task-page/linear/ProjectFields.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx
  • src/renderer/src/components/ui/command.tsx
  • src/renderer/src/components/ui/input.tsx
  • src/renderer/src/components/ui/textarea.tsx
  • src/renderer/src/lib/ime-composition-keyboard-event.ts
  • src/renderer/src/lib/ime-text-field.test.tsx
  • src/renderer/src/lib/ime-text-field.tsx
  • src/renderer/src/lib/screen-submit-shortcut.test.ts
  • src/renderer/src/lib/screen-submit-shortcut.ts
  • tests/e2e/file-explorer-ime-enter.spec.ts
💤 Files with no reviewable changes (3)
  • src/renderer/src/components/new-workspace/ComposerParentWorktreePicker.test.tsx
  • src/renderer/src/components/tab-bar/use-tab-bar-quick-command-search-input.test.ts
  • src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@nwparker

nwparker commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Addressed both actionable review comments in 5619069, with failing-before/passing-after regressions for Process/229 release ordering and tests preserving Markdown save behavior. Three independent sub-agent reviews also found and fixed IME Escape dismissal in overlay capture handlers; a separate second pass found no blocking regression.

Current head incorporates main and passes 891 tests across 71 files plus the full project typecheck. CSV consumers added on main were reviewed and tested with the shared textarea guard. CI is still pending before merge.

The automated docstring-coverage suggestion is intentionally not applied: AGENTS.md requires concise comments only for non-obvious behavior. The shared guard and gesture expiry have targeted explanations; adding docstrings to every mechanically migrated field would conflict with that repository rule. Native OS candidate-window behavior remains an explicit validation gap; the attached proof and Electron tests use hidden Chromium composition through CDP.

@nwparker
nwparker merged commit e2da3a1 into main Oct 5, 2026
36 checks passed
nwparker added a commit that referenced this pull request Oct 27, 2026
…rward dialog (#34315)

The SSH port-forward dialog renders its four fields as raw inputs inside a
form with a submit button. IMEs that redispatch an unmarked Enter after
compositionend therefore trigger implicit submission with the half-typed
value. The pre-revert ImeEnterGuardedForm covered this form; #25480 moved
the guard into shared fields but did not reach these raw inputs, and the
#28609 lint rule only inspects Enter handlers, which these fields lack.

Render the fields with ImeInput so the shared gesture tracker swallows the
confirmation and its redispatch while ordinary Enter still submits.

Co-authored-by: Seiji Kohara <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: File Explorer New File / New Folder / Rename input submits on Japanese/CJK IME confirmation Enter

2 participants