Summary
In the Workshop chat composer, pressing Enter to confirm an IME composition
(e.g. converting kana to kanji while typing Japanese, or any other CJK IME)
sends the chat message instead of just confirming the conversion.
Steps to reproduce
- Open the Workshop chat.
- Switch to a Japanese (or other IME-based) input method.
- Type some text and start composing/converting (e.g. typing romaji that
converts to kana/kanji candidates).
- Press Enter to confirm the conversion.
Expected
Enter confirms the IME composition only; the message is not sent.
Actual
The message is sent immediately, often mid-composition, because the
composer's onKeyDown handler doesn't check whether an IME composition is
in progress.
Root cause
ChatInterface.tsx's "Enter sends message" handler checks only
e.key === "Enter" && !e.shiftKey, without checking
e.nativeEvent.isComposing (the standard way to detect an in-progress IME
composition in React's onKeyDown).
Suggested fix
Add an isComposing guard, e.g.:
if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
e.preventDefault();
if (!isAgentActive && !isBlocked) submitMessage();
return;
}
Happy to open a PR with this fix if useful.
Summary
In the Workshop chat composer, pressing Enter to confirm an IME composition
(e.g. converting kana to kanji while typing Japanese, or any other CJK IME)
sends the chat message instead of just confirming the conversion.
Steps to reproduce
converts to kana/kanji candidates).
Expected
Enter confirms the IME composition only; the message is not sent.
Actual
The message is sent immediately, often mid-composition, because the
composer's
onKeyDownhandler doesn't check whether an IME composition isin progress.
Root cause
ChatInterface.tsx's "Enter sends message" handler checks onlye.key === "Enter" && !e.shiftKey, without checkinge.nativeEvent.isComposing(the standard way to detect an in-progress IMEcomposition in React's
onKeyDown).Suggested fix
Add an
isComposingguard, e.g.:Happy to open a PR with this fix if useful.