From 2e069d081996638a2964c2f9f5395fbbbacd30bc Mon Sep 17 00:00:00 2001 From: cgoing Date: Fri, 21 Mar 2025 13:33:55 +0900 Subject: [PATCH 1/2] fix: prevent duplicate submissions during IME composition --- src/components/thread/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/thread/index.tsx b/src/components/thread/index.tsx index fd46266..1e20b75 100644 --- a/src/components/thread/index.tsx +++ b/src/components/thread/index.tsx @@ -339,7 +339,12 @@ export function Thread() { value={input} onChange={(e) => setInput(e.target.value)} onKeyDown={(e) => { - if (e.key === "Enter" && !e.shiftKey && !e.metaKey) { + if ( + e.key === "Enter" && + !e.shiftKey && + !e.metaKey && + !e.nativeEvent.isComposing + ) { e.preventDefault(); const el = e.target as HTMLElement | undefined; const form = el?.closest("form"); From b497867ffa90d3046d5c8f3cbc70ab0724d86a79 Mon Sep 17 00:00:00 2001 From: cgoing Date: Fri, 21 Mar 2025 14:01:06 +0900 Subject: [PATCH 2/2] fix: adjust user message bubble width to fit content --- src/components/thread/messages/human.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/thread/messages/human.tsx b/src/components/thread/messages/human.tsx index a394874..e6ca4c5 100644 --- a/src/components/thread/messages/human.tsx +++ b/src/components/thread/messages/human.tsx @@ -84,7 +84,7 @@ export function HumanMessage({ onSubmit={handleSubmitEdit} /> ) : ( -

+

{contentString}

)}