From d2212221ebc40bd67ff7e84b09c6088d0185b921 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Wed, 3 Jun 2026 16:40:41 +0800 Subject: [PATCH] feat(chat): enhance request info button integration and toolbar logic - Added a conditional rendering for the `ChatRequestInfoButton` to prevent duplication in the toolbar when a completed answer with content is displayed. - Introduced a new computed property, `hasDoneAnswerContent`, to track whether a completed answer is rendered, improving the user interface and experience in the chat component. - Updated the toolbar logic to ensure it only displays the request info button when appropriate, enhancing clarity and usability for users. --- .../chat/components/AgentStreamDisplay.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/chat/components/AgentStreamDisplay.vue b/frontend/src/views/chat/components/AgentStreamDisplay.vue index 9a4d948c..52e50ee5 100644 --- a/frontend/src/views/chat/components/AgentStreamDisplay.vue +++ b/frontend/src/views/chat/components/AgentStreamDisplay.vue @@ -253,6 +253,11 @@ + @@ -330,7 +335,7 @@ -
+
@@ -931,6 +936,16 @@ const isConversationDone = computed(() => { return !!doneAnswer; }); +// Whether a completed answer with content is rendered (its toolbar hosts the +// request-info button inline, so the standalone toolbar should not duplicate it) +const hasDoneAnswerContent = computed(() => { + const stream = eventStream.value; + if (!stream || stream.length === 0) return false; + return stream.some( + (e: any) => e.type === 'answer' && e.done && e.content && e.content.trim() + ); +}); + // Find the final content to display (last thinking or answer) const finalContent = computed(() => { const stream = eventStream.value;