Skip to content

fix(input): do not commit renames or dialog input on IME-confirming Enter (fixes #516) - #549

Merged
kahme247 merged 2 commits into
mainfrom
fix-issue-516-2026-11-23
Nov 23, 2026
Merged

kahme247 merged 2 commits into
mainfrom
fix-issue-516-2026-11-23

Conversation

@kahme247

@kahme247 kahme247 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #516: pressing Enter to confirm an IME conversion committed a rename,
alias edit or dialog input mid-composition.

The Enter that confirms an IME conversion still arrives as a keydown with
key === "Enter", so the sidebar alias/rename inputs and the ExtensionDialog
input treated it as a commit.

  • New lib/ime-enter.ts: isImeConfirmEnter() — true when the event is an
    IME confirmation, identified by either signal: isComposing, or
    keyCode === 229 (the IME composition key code). The 229 check covers
    macOS Safari, where WebKit delivers compositionend before the confirming
    Enter keydown (WebKit bug 165004), so isComposing is already false.
    This mirrors the guard ChatInput.tsx already uses for its composer.
  • Guard applied in components/SessionSidebar-rows.tsx (alias edit and
    session rename) and components/ExtensionDialog.tsx (input dialog).
  • New tests: lib/ime-enter.test.mjs (unit) and
    components/ExtensionDialog.input-ime.test.mjs (a keyCode-229 Enter does
    not submit; a plain Enter does).

Tests (fresh main c110474, bun test): the new tests pass; the targeted set
for all three issues (11 tests across 4 files) passes. tsc --noEmit clean.

Summary by CodeRabbit

  • Bug Fixes
    • Enter presses used to confirm text through an input method editor (IME) no longer submit input dialogs or commit project aliases and session renames. Ordinary Enter presses retain their existing behavior.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

A shared helper detects IME confirmation Enter events. The extension input dialog, project alias editor, and session rename editor now use it to skip submission or commit during IME confirmation. Tests cover helper detection and extension input behavior.

Changes: IME-safe Enter handling

Layer / File(s) Summary
IME confirmation detection
lib/ime-enter.ts, lib/ime-enter.test.mjs
Adds isImeConfirmEnter, which checks composition and key-code signals, and tests native and React-style event shapes.
Input handler integration
components/ExtensionDialog.tsx, components/SessionSidebar-rows.tsx, components/ExtensionDialog.input-ime.test.mjs
The extension input, project alias, and session rename handlers skip submission or commit when Enter confirms IME composition. The extension input test checks that key code 229 does not submit and key code 13 does.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: andrebrait

Merge Risk: Minimal · up to 41b08

Merge Risk: ⚪ Minimal · up to 41b08

This change stops the Enter that confirms an IME conversion from prematurely committing a sidebar alias edit, a session rename, or an extension dialog input. Normal Enter still commits, and no concrete merge-blocking risk was found.

Security architecture risk: Minimal · up to 8e10b

The change prevents accidental submissions and renames while users confirm text composition. Ordinary Enter still works, and the change adds no new access or deployment requirements.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the fix stops renames and dialog input from committing on an IME-confirming Enter. It also names the three affected inputs in general terms and references issue #516. …
Linked Issues check Passed [#516] Requirement: the Enter that confirms an IME conversion must not commit a session rename, project alias edit, or ExtensionDialog input. Requirement: detect this Enter with isComposing and with k…
Out of Scope Changes check Passed The changes are the new helper lib/ime-enter.ts, the guard in the three named inputs (per change summary and the confirmed ExtensionDialog.tsx import), and two test files. Each change serves #516. The…
Full details: Title check

Explanation

The title names the main change: the fix stops renames and dialog input from committing on an IME-confirming Enter. It also names the three affected inputs in general terms and references issue #516. The title is 86 characters, which is longer than a typical concise title, but it remains a single clear sentence that a teammate scanning history can understand.

Full details: Linked Issues check

Explanation

[#516] Requirement: the Enter that confirms an IME conversion must not commit a session rename, project alias edit, or ExtensionDialog input. Requirement: detect this Enter with isComposing and with keyCode 229, which covers macOS Safari (WebKit bug 165004).

Evidence at head:

  • lib/ime-enter.ts exports isImeConfirmEnter(). It returns true when isComposing is true or keyCode is 229. It reads nativeEvent first, then the event fields.
  • components/ExtensionDialog.tsx imports isImeConfirmEnter from @/lib/ime-enter. Per the change summary, it submits on Enter only when the event is not an IME confirmation.
  • Per the change summary, components/SessionSidebar-rows.tsx applies the same guard to the alias edit and session rename inputs. I did not read those call-site lines directly. The read was truncated, and the diff tool was unavailable.
  • Tests: lib/ime-enter.test.mjs covers the helper. components/ExtensionDialog.input-ime.test.mjs asserts that Enter with keyCode 229 does not submit and that Enter with keyCode 13 does submit.

The issue's suggested 100 ms grace window after compositionend is not implemented. The issue states that keyCode 229 covers the Safari case, so this omission does not leave a stated requirement unmet.

Non-coding items in the issue (reproduction steps, environment) do not apply.

Full details: Out of Scope Changes check

Explanation

The changes are the new helper lib/ime-enter.ts, the guard in the three named inputs (per change summary and the confirmed ExtensionDialog.tsx import), and two test files. Each change serves #516. The helper, the call sites, and the tests all implement the IME-safe Enter requirement. No unrelated change appears in the summary. Limitation: the SessionSidebar-rows.tsx diff could not be read directly, so this verdict relies on the change summary for that file.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6973a111-6d80-4d46-9a46-44c6c70b60cd
Commits

Reviewing files that changed from the base of the PR and between 743af31 and 8e10b49.

Files selected for processing: 5

  • components/ExtensionDialog.input-ime.test.mjs
  • components/ExtensionDialog.tsx
  • components/SessionSidebar-rows.tsx
  • lib/ime-enter.test.mjs
  • lib/ime-enter.ts

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

@kahme247
kahme247 merged commit a66be72 into main Nov 23, 2026
11 of 13 checks passed
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] IME confirmation Enter commits the session rename (and project alias / extension input) mid-composition

1 participant