diff --git a/frontend/src/components/css/chat-timeline-loading.less b/frontend/src/components/css/chat-timeline-loading.less index 2a68dc44..53fb8047 100644 --- a/frontend/src/components/css/chat-timeline-loading.less +++ b/frontend/src/components/css/chat-timeline-loading.less @@ -1,28 +1,3 @@ -@keyframes chatTimelineTypingBounce { - - 0%, - 60%, - 100% { - transform: translate3d(0, 0, 0); - } - - 30% { - transform: translate3d(0, -5px, 0); - } -} - -@keyframes chatTimelineLoadingFadeIn { - from { - opacity: 0; - transform: translateY(6px); - } - - to { - opacity: 1; - transform: translateY(0); - } -} - // A light sweep across in-progress text (the "光影" / shimmer effect). The base // is the muted secondary color and a brighter band slides across, signalling // "this step is still running" without the layout cost of a spinner. @@ -77,52 +52,3 @@ color: var(--td-text-color-secondary); } } - -.streaming-loading-node { - .tree-child-content { - position: relative; - } - - .loading-indicator { - display: flex; - align-items: center; - min-height: 24px; - padding: 0; - margin: 0; - position: relative; - animation: chatTimelineLoadingFadeIn 0.3s ease-out; - } - - .loading-typing { - position: absolute; - left: -42px; - top: 9px; - display: flex; - align-items: center; - gap: 4px; - - span { - width: 4px; - height: 4px; - border-radius: 50%; - background: var(--td-text-color-placeholder); - animation: chatTimelineTypingBounce 1.4s ease-in-out infinite; - // Composite each dot on its own layer so the bounce runs off the main - // thread and does not smear/ghost while the answer relayouts every token. - will-change: transform; - backface-visibility: hidden; - - &:nth-child(1) { - animation-delay: 0s; - } - - &:nth-child(2) { - animation-delay: 0.2s; - } - - &:nth-child(3) { - animation-delay: 0.4s; - } - } - } -} diff --git a/frontend/src/components/css/chat-timeline-loading.test.mjs b/frontend/src/components/css/chat-timeline-loading.test.mjs index 45620ae2..c9e9921e 100644 --- a/frontend/src/components/css/chat-timeline-loading.test.mjs +++ b/frontend/src/components/css/chat-timeline-loading.test.mjs @@ -7,12 +7,9 @@ import test from 'node:test' const here = dirname(fileURLToPath(import.meta.url)) const css = readFileSync(join(here, 'chat-timeline-loading.less'), 'utf8') -test('timeline loading uses shared gray bounce dots on the axis', () => { - assert.match(css, /\.streaming-loading-node\s*\{[\s\S]*left:\s*-42px/) - assert.match(css, /width:\s*4px/) - assert.match(css, /background:\s*var\(--td-text-color-placeholder\)/) - assert.match(css, /animation:\s*chatTimelineTypingBounce/) - assert.match(css, /animation-delay:\s*0\.2s/) +test('shared timeline styles do not add a detached loading row', () => { + assert.doesNotMatch(css, /\.streaming-loading-node/) + assert.doesNotMatch(css, /chatTimelineTypingBounce/) }) test('in-progress step titles get the streaming shimmer sweep', () => { diff --git a/frontend/src/views/chat/components/AgentStreamDisplay.style.test.mjs b/frontend/src/views/chat/components/AgentStreamDisplay.style.test.mjs index f1c8f163..896acd0f 100644 --- a/frontend/src/views/chat/components/AgentStreamDisplay.style.test.mjs +++ b/frontend/src/views/chat/components/AgentStreamDisplay.style.test.mjs @@ -58,9 +58,10 @@ test('tool rows use line icon names instead of legacy asset masks', () => { assert.doesNotMatch(source, /getToolIcon\(event\.tool_name\)/) }) -test('rag mode delegates pre-answer loading to pipeline and keeps dots while answer streams', () => { - assert.match(source, /if \(props\.ragMode\) return hasAnswerStarted\.value/) +test('rag mode delegates pre-answer loading to pipeline and adds no row after answer starts', () => { + assert.match(source, /if \(props\.ragMode \|\| hasAnswerStarted\.value\) return false/) assert.match(source, /v-if="!ragMode \|\| displayEvents\.length > 0 \|\| showAgentActivityIndicator"/) + assert.doesNotMatch(source, /ChatActivityIndicator/) }) test('rag mode keeps model thinking out of the answer stream component', () => { @@ -90,9 +91,10 @@ test('pending tool rows do not render an extra axis dot', () => { assert.doesNotMatch(source, /&\.action-pending\s*\{[\s\S]*&::after/) }) -test('agent mode keeps gray timeline dots for the full turn', () => { +test('agent mode only shows a native timeline placeholder before visible activity', () => { assert.match(source, /if \(isConversationDone\.value\) return false/) - assert.match(source, /if \(props\.ragMode\) return false/) - assert.match(source, /return true;\s*\}\);/) + assert.match(source, /return displayEvents\.value\.length === 0/) + assert.match(source, /class="action-card action-pending"/) + assert.match(source, /t\('chat\.thinkingAlt'\)/) assert.match(source, /chat-timeline-loading\.less/) }) diff --git a/frontend/src/views/chat/components/AgentStreamDisplay.vue b/frontend/src/views/chat/components/AgentStreamDisplay.vue index 5b082b26..aa4e3a56 100644 --- a/frontend/src/views/chat/components/AgentStreamDisplay.vue +++ b/frontend/src/views/chat/components/AgentStreamDisplay.vue @@ -419,11 +419,12 @@