From 51310da5496048ef3edaca593add7c3fc9c97906 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Tue, 10 Mar 2026 12:27:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=9A=E8=AF=9D=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E5=90=8E=EF=BC=8C=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=80=9D=E8=80=83=E5=8F=AF=E8=83=BD=E8=BF=98=E4=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=80=9D=E8=80=83=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chat/live-message-block.tsx | 5 ++++- src/components/chat/welcome-input-panel.tsx | 11 +++++++++-- src/components/message/message-list-view.tsx | 17 +++++++++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/components/chat/live-message-block.tsx b/src/components/chat/live-message-block.tsx index 7fc580d..2a9b08d 100644 --- a/src/components/chat/live-message-block.tsx +++ b/src/components/chat/live-message-block.tsx @@ -9,10 +9,12 @@ import { Message, MessageContent } from "@/components/ai-elements/message" interface LiveMessageBlockProps { message: LiveMessage + isStreaming?: boolean } export const LiveMessageBlock = memo(function LiveMessageBlock({ message, + isStreaming = true, }: LiveMessageBlockProps) { const t = useTranslations("Folder.chat.liveMessageBlock") const sharedT = useTranslations("Folder.chat.shared") @@ -20,10 +22,11 @@ export const LiveMessageBlock = memo(function LiveMessageBlock({ const adapted = useMemo( () => adaptLiveMessageFromAcp(message, { + isLiveStreaming: isStreaming, toolCallFailedText: sharedT("toolCallFailed"), planUpdatedText: sharedT("planUpdated"), }), - [message, sharedT] + [message, isStreaming, sharedT] ) return ( diff --git a/src/components/chat/welcome-input-panel.tsx b/src/components/chat/welcome-input-panel.tsx index bf3428a..c7444b5 100644 --- a/src/components/chat/welcome-input-panel.tsx +++ b/src/components/chat/welcome-input-panel.tsx @@ -97,6 +97,7 @@ type WelcomeThreadItem = key: string kind: "live" message: LiveMessage + isStreaming: boolean } const WelcomeHistoryMessage = memo(function WelcomeHistoryMessage({ @@ -811,14 +812,20 @@ export function WelcomeInputPanel({ key: `live-${conn.liveMessage.id}`, kind: "live", message: conn.liveMessage, + isStreaming: connStatus === "prompting", }) } return items - }, [history, showLive, conn.liveMessage]) + }, [history, showLive, conn.liveMessage, connStatus]) const renderThreadItem = useCallback((item: WelcomeThreadItem) => { if (item.kind === "live") { - return + return ( + + ) } return }, []) diff --git a/src/components/message/message-list-view.tsx b/src/components/message/message-list-view.tsx index 91cc3e2..d6c299f 100644 --- a/src/components/message/message-list-view.tsx +++ b/src/components/message/message-list-view.tsx @@ -66,6 +66,7 @@ type ThreadRenderItem = key: string kind: "live" message: LiveMessage + isStreaming: boolean } function fallbackExtractUserResources( @@ -315,11 +316,18 @@ export function MessageListView({ key: `live-${liveMessage.id}`, kind: "live", message: liveMessage, + isStreaming: connStatus === "prompting", }) } return items - }, [resolvedGroups, resolvedPendingGroups, showLiveMessage, liveMessage]) + }, [ + resolvedGroups, + resolvedPendingGroups, + showLiveMessage, + liveMessage, + connStatus, + ]) const renderThreadItem = useCallback((item: ThreadRenderItem) => { switch (item.kind) { @@ -330,7 +338,12 @@ export function MessageListView({ case "typing": return case "live": - return + return ( + + ) default: return null }