From aa1ff9a6df96c0b37d15382a299b25685931f5a5 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Tue, 10 Mar 2026 14:10:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=9A=E8=AF=9D=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chat/welcome-input-panel.tsx | 7 ++++++- src/components/message/live-turn-stats.tsx | 22 +++++++++++++------- src/components/message/message-list-view.tsx | 7 +++++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/components/chat/welcome-input-panel.tsx b/src/components/chat/welcome-input-panel.tsx index c7444b5..8268d05 100644 --- a/src/components/chat/welcome-input-panel.tsx +++ b/src/components/chat/welcome-input-panel.tsx @@ -932,7 +932,12 @@ export function WelcomeInputPanel({ overscan={10} /> - {showLive && } + {showLive && connStatus === "prompting" && ( + + )} Date.now() - message.startedAt) @@ -280,21 +284,23 @@ export function LiveTurnStats({ message }: LiveTurnStatsProps) { // Count tool calls from live content let toolCallCount = 0 - let isThinking = false + let hasThinkingBlock = false for (const block of message.content) { if (block.type === "tool_call") { toolCallCount++ } else if (block.type === "thinking") { - isThinking = true + hasThinkingBlock = true } } - // If the last block is thinking, mark as currently thinking + // Only active streams should show thinking/streaming state. const lastBlock = message.content[message.content.length - 1] - if (lastBlock?.type === "thinking") { - isThinking = true - } + const isThinking = + isStreaming && + hasThinkingBlock && + message.content.length <= 1 && + lastBlock?.type === "thinking" const elapsedLabel = elapsed >= 60_000 @@ -304,7 +310,7 @@ export function LiveTurnStats({ message }: LiveTurnStatsProps) { return (
- {isThinking && message.content.length <= 1 ? ( + {isThinking ? ( {t("thinking")} ) : ( {t("streaming")} diff --git a/src/components/message/message-list-view.tsx b/src/components/message/message-list-view.tsx index d6c299f..ad7ad3d 100644 --- a/src/components/message/message-list-view.tsx +++ b/src/components/message/message-list-view.tsx @@ -402,8 +402,11 @@ export function MessageListView({ overscan={10} /> - {showLiveMessage && liveMessage && ( - + {showLiveMessage && liveMessage && connStatus === "prompting" && ( + )}