From 7058f9e2b51e6bc69375e4f7e6f845a600efbde7 Mon Sep 17 00:00:00 2001 From: Takeshi Kondo <10370988+chaspy@users.noreply.github.com> Date: Tue, 11 Aug 2026 12:09:09 +0900 Subject: [PATCH] Don't submit chat input on Enter during IME composition When typing with an IME (Japanese, Chinese, Korean, etc.), pressing Enter to confirm a text conversion would send the message instead of just committing the composition. Check KeyboardEvent.isComposing on the chat send, slash-command picker, and chat rename Enter handlers. Co-Authored-By: Claude Fable 5 --- packages/workshop-frontend/src/ChatInterface.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/workshop-frontend/src/ChatInterface.tsx b/packages/workshop-frontend/src/ChatInterface.tsx index 545892d7..12582fc4 100644 --- a/packages/workshop-frontend/src/ChatInterface.tsx +++ b/packages/workshop-frontend/src/ChatInterface.tsx @@ -3175,7 +3175,8 @@ export const ChatInput = ({ slashCommandPicker.dismiss(); return; } - if (slashCommandPicker.open && e.key === "Enter" && !e.shiftKey) { + if (slashCommandPicker.open && e.key === "Enter" && !e.shiftKey && + !e.nativeEvent.isComposing) { e.preventDefault(); if (slashCommandPicker.selectable && slashCommandPicker.activeChoice) { slashCommandPicker.select(slashCommandPicker.activeChoice); @@ -3223,8 +3224,9 @@ export const ChatInput = ({ return; } } - // Enter sends message (unless Shift is held) - if (e.key === "Enter" && !e.shiftKey) { + // Enter sends message (unless Shift is held or an IME + // composition is in progress) + if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) { e.preventDefault(); if (!isAgentActive && !isBlocked) submitMessage(); return; @@ -6538,7 +6540,7 @@ function ChatInterface({ onChange={(e) => setRenamingInput(e.target.value)} onClick={(e) => e.stopPropagation()} onKeyDown={(e) => { - if (e.key === "Enter") { + if (e.key === "Enter" && !e.nativeEvent.isComposing) { e.preventDefault(); handleSaveListRename(chat.id); } else if (e.key === "Escape") {