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 }