Skip to content

Enter during IME composition sends the message (Japanese/Chinese/Korean input) #81

Description

@kote2kote

Bug

When typing with an IME (Japanese, Chinese, Korean input methods), pressing Enter to confirm a text conversion is interpreted as a send action. Every conversion confirmation sends a half-written message, which makes the chat input nearly unusable for CJK users.

Filing as an issue per the maintainer guidance in #73 (and #31, which reported the same bug as a PR).

Steps to reproduce

  1. Open the chat input with a Japanese IME active (e.g. macOS standard Japanese input).
  2. Type some text — the IME shows it as an underlined pre-edit with conversion candidates.
  3. Press Enter to confirm the conversion.
  4. The message is sent immediately, even though the user was still composing.

Reproduced on macOS with Chrome and Arc (see also the reports from other users in #31). Safari has an additional quirk, noted below.

Root cause

The onKeyDown handlers in packages/workshop-frontend/src/ChatInterface.tsx treat any unmodified Enter as submit without checking whether an IME composition is active. Three inputs are affected:

  • the main chat message input (the e.key === "Enter" && !e.shiftKey branch)
  • the chat list rename input
  • the chat title edit input

Suggested fix

Guard each affected onKeyDown at the top with the standard IME check:

if (e.nativeEvent.isComposing || e.keyCode === 229) return;

The keyCode === 229 fallback matters for Safari/WebKit, which can dispatch compositionend before the confirming Enter keydown (WebKit bug 165004) — by the time the handler runs, isComposing is already false.

The (now closed) #73 contains a working implementation of exactly this, covering all three inputs, with tsc --noEmit passing — feel free to lift it from there or have your agents re-derive it.

Expected behavior

  • With an IME: Enter confirms the conversion; a subsequent Enter sends the message.
  • Without an IME: unchanged (Enter sends, Shift+Enter inserts a newline, slash-command picker behavior intact).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions