diff --git a/frontend/src/components/css/chat-message-shared.less b/frontend/src/components/css/chat-message-shared.less index 3430ce6d..f0e560dd 100644 --- a/frontend/src/components/css/chat-message-shared.less +++ b/frontend/src/components/css/chat-message-shared.less @@ -89,6 +89,35 @@ } } +/* Count sits on the download glyph like the settings list badges: muted + surface + secondary type, not TDesign's brand-pink t-badge. */ +.answer-toolbar__artifact { + position: relative; + display: inline-flex; + flex-shrink: 0; +} + +.answer-toolbar__artifact-count { + position: absolute; + top: 1px; + right: 1px; + z-index: 1; + display: inline-flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + min-width: 14px; + height: 14px; + padding: 0 3px; + border-radius: 7px; + background: var(--td-bg-color-secondarycontainer); + color: var(--td-text-color-secondary); + font-size: 10px; + font-weight: 600; + line-height: 1; + pointer-events: none; +} + .answer-toolbar__follow-up-loading { display: inline-flex; align-items: center; diff --git a/frontend/src/views/chat/components/AgentStreamDisplay.vue b/frontend/src/views/chat/components/AgentStreamDisplay.vue index 2724a6fc..7875c9f8 100644 --- a/frontend/src/views/chat/components/AgentStreamDisplay.vue +++ b/frontend/src/views/chat/components/AgentStreamDisplay.vue @@ -340,19 +340,14 @@ assistant message recorded any generated files. Agent mode is the primary path for skills, so this is where the button is most likely to appear. --> - + - + + @@ -560,6 +555,7 @@ import { unwrapFinalAnswerWrappers, thinkingEqualsAnswer } from '@/utils/finalAn import { getAgentToolIconName } from '@/utils/agent-tool-icons'; import { getQueryText, getWikiPageText } from '@/utils/agent-tool-display'; import { previewShellCommand } from '@/utils/shellExecResult'; +import type { DisplayType } from '@/types/tool-results'; import { parseWikiToolReferences } from '@/utils/wikiToolReferences'; import { buildManualMarkdown, @@ -1045,8 +1041,8 @@ const formatToolResultContent = (value: unknown): string => { const isMcpTool = (toolName?: string | null): boolean => String(toolName || '').startsWith('mcp_'); -const resolveToolDisplayType = (event: any): string | undefined => { - if (event?.display_type) return event.display_type +const resolveToolDisplayType = (event: any): DisplayType | undefined => { + if (event?.display_type) return event.display_type as DisplayType if (event?.tool_name === 'shell_exec') return 'shell_exec' return undefined }; diff --git a/frontend/src/views/chat/components/answerToolbarCompletion.test.mjs b/frontend/src/views/chat/components/answerToolbarCompletion.test.mjs index 9feb4e98..a6adb75b 100644 --- a/frontend/src/views/chat/components/answerToolbarCompletion.test.mjs +++ b/frontend/src/views/chat/components/answerToolbarCompletion.test.mjs @@ -23,6 +23,17 @@ test('agent actions reuse the fully-rendered answer state', () => { assert.match(agentStream, /v-if="answerFullyRendered && event\.done/) }) +test('artifact download uses a muted count overlay instead of t-badge', () => { + assert.match(botMessage, /class="answer-toolbar__artifact"/) + assert.match(agentStream, /class="answer-toolbar__artifact"/) + assert.match(botMessage, /class="answer-toolbar__artifact-count"/) + assert.match(agentStream, /class="answer-toolbar__artifact-count"/) + assert.match(sharedStyles, /answer-toolbar__artifact-count/) + assert.match(sharedStyles, /td-bg-color-secondarycontainer/) + assert.doesNotMatch(botMessage, / { assert.match(chatView, /:follow-up-loading="Boolean\(session\.suggestionLoading/) assert.match(botMessage, /class="answer-toolbar__follow-up-loading"/) diff --git a/frontend/src/views/chat/components/botmsg.vue b/frontend/src/views/chat/components/botmsg.vue index 048b44bd..32c72e9c 100644 --- a/frontend/src/views/chat/components/botmsg.vue +++ b/frontend/src/views/chat/components/botmsg.vue @@ -56,19 +56,14 @@ assistant message actually recorded any generated files. Emptiness is the default: the button stays hidden for conversational messages that never touched a skill. --> - + - + +