From d918691fabf7d8ce38efc4cd7d388417531eef33 Mon Sep 17 00:00:00 2001 From: Michael Charles Aubrey Date: Wed, 12 Aug 2026 15:56:26 +0900 Subject: [PATCH] fix(web): keep thread rename open during IME composition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both thread rename inputs committed on any Enter keydown, including the Enter that confirms an IME candidate. Renaming a thread with a Japanese, Chinese, or Korean IME therefore saved the title mid-compose and closed the input, truncating everything not yet converted: typing かいけい and pressing Enter to pick 会計 saved the thread as "会計" with no way to finish the intended title. Guard both handlers with the composition check the thread search input in Sidebar.tsx already uses, so Enter reaches the IME while a candidate is pending and only commits once composition has ended. isComposing alone is not sufficient because some platform and IME combinations leave it false mid-composition while keyCode stays 229. Refs #6280 --- apps/web/src/components/Sidebar.tsx | 1 + apps/web/src/components/chat/ChatHeader.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 840e4918bfa..1c20715681f 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -934,6 +934,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { const handleRenameKeyDown = useCallback( (event: ReactKeyboardEvent) => { event.stopPropagation(); + if (event.nativeEvent.isComposing || event.keyCode === 229) return; if (event.key === "Enter") { event.preventDefault(); renameCommittedRef.current = true; diff --git a/apps/web/src/components/chat/ChatHeader.tsx b/apps/web/src/components/chat/ChatHeader.tsx index db13419962f..643cf95ee88 100644 --- a/apps/web/src/components/chat/ChatHeader.tsx +++ b/apps/web/src/components/chat/ChatHeader.tsx @@ -203,6 +203,7 @@ export const ChatHeader = memo(function ChatHeader({ ); const handleRenameKeyDown = useCallback( (event: ReactKeyboardEvent) => { + if (event.nativeEvent.isComposing || event.keyCode === 229) return; if (event.key === "Enter") { renameCommittedRef.current = true; commitRename(event.currentTarget.value);