From 462f5741545586f563c592fd6c2374ec32fec351 Mon Sep 17 00:00:00 2001 From: Rin Date: Thu, 8 Jan 2026 04:27:20 +0800 Subject: [PATCH] fix(stage-ui): fix placeholder check logic (close #898) (#909) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .../stage-ui/src/components/scenarios/chat/history.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/stage-ui/src/components/scenarios/chat/history.vue b/packages/stage-ui/src/components/scenarios/chat/history.vue index 870162f3c..f514d89c1 100644 --- a/packages/stage-ui/src/components/scenarios/chat/history.vue +++ b/packages/stage-ui/src/components/scenarios/chat/history.vue @@ -48,6 +48,13 @@ onMounted(scrollToBottom) const streaming = computed(() => props.streamingMessage ?? { role: 'assistant', content: '', slices: [], tool_results: [], createdAt: Date.now() }) const showStreamingPlaceholder = computed(() => (streaming.value.slices?.length ?? 0) === 0 && !streaming.value.content) const streamingTs = computed(() => streaming.value?.createdAt) +function shouldShowPlaceholder(message: ChatHistoryItem) { + const ts = streamingTs.value + if (ts == null) + return false + + return message.context?.createdAt === ts || message.createdAt === ts +} const renderMessages = computed(() => { if (!props.sending) return props.messages @@ -80,7 +87,7 @@ const renderMessages = computed(() => {