From 407b85c8a9772feeda2a83a6c26761d4e852d67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AD=90=E9=BB=98?= <925456043@qq.com> Date: Thu, 20 Aug 2026 11:24:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=20Timeline=20?= =?UTF-8?q?=E5=90=88=E6=88=90=E5=A4=84=E7=90=86=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 仅依据真实思考、工具和状态事件展示处理过程 - 更新快速工具调用状态测试 --- .../chat-timeline/ChatTimelineTurn.vue | 39 +------------------ .../__tests__/ChatTimelineTurn.test.ts | 9 ++--- 2 files changed, 5 insertions(+), 43 deletions(-) diff --git a/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/ChatTimelineTurn.vue b/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/ChatTimelineTurn.vue index e4324aec..cd9cd4ad 100644 --- a/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/ChatTimelineTurn.vue +++ b/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/ChatTimelineTurn.vue @@ -5,7 +5,6 @@ import type { ChatImageLoader, ChatTimelineItem, ChatTimelineMessageItem, - ChatTimelineStatusItem, ChatTimelineToolApprovalPayload, } from './types'; @@ -138,38 +137,6 @@ const hasPendingApproval = computed(() => (item.status === 'approving' || item.status === 'pending_approval'), ), ); -const hasActiveProcessIndicator = computed(() => - props.items.some((item) => { - if (item.type === 'tool') { - return ['approving', 'pending_approval', 'running'].includes(item.status); - } - if (item.type === 'status') { - return item.status === 'running'; - } - return ( - item.type === 'message' && - item.parts.some( - (part) => part.type === 'thinking' && part.status === 'thinking', - ) - ); - }), -); -const continuingStatus = computed(() => { - if (!turnActive.value || hasActiveProcessIndicator.value) { - return undefined; - } - return { - id: `chat-turn-continuing-${props.roundId}`, - icon: 'none', - label: '正在继续处理', - presentation: 'inline', - roundId: props.roundId, - status: 'running', - statusKey: `chat-turn-continuing:${props.roundId}`, - turnStartedAt: turnStartedAt.value, - type: 'status', - }; -}); const canCollapse = computed( () => turnSucceeded.value && @@ -327,7 +294,7 @@ function handleNestedLayoutToggle() { @after-leave="emit('layoutChanged')" >
@@ -362,10 +329,6 @@ function handleNestedLayoutToggle() { @thinking-toggle="handleNestedLayoutToggle" /> -
diff --git a/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/__tests__/ChatTimelineTurn.test.ts b/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/__tests__/ChatTimelineTurn.test.ts index 292b7cb7..02201f13 100644 --- a/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/__tests__/ChatTimelineTurn.test.ts +++ b/easyflow-ui-admin/packages/effects/common-ui/src/components/chat-timeline/__tests__/ChatTimelineTurn.test.ts @@ -96,10 +96,10 @@ describe('chat timeline turn', () => { expect( wrapper.findAll('.chat-timeline-item__assistant-avatar'), ).toHaveLength(0); - expect(wrapper.text()).toContain('正在继续处理'); + expect(wrapper.text()).not.toContain('正在继续处理'); }); - it('keeps continuous feedback around a fast automatic tool call', async () => { + it('shows the running and completed states of an automatic tool call', async () => { const assistant: ChatTimelineItem = { id: 'assistant-fast-tool', parts: [ @@ -132,19 +132,18 @@ describe('chat timeline turn', () => { }, }); - expect(wrapper.text()).toContain('正在继续处理'); + expect(wrapper.text()).not.toContain('调用中'); await wrapper.setProps({ items: [assistant, runningTool] }); expect(wrapper.text()).toContain('调用中'); - expect(wrapper.text()).not.toContain('正在继续处理'); await wrapper.setProps({ items: [assistant, { ...runningTool, status: 'success' }], }); expect(wrapper.text()).toContain('已完成'); - expect(wrapper.text()).toContain('正在继续处理'); + expect(wrapper.text()).not.toContain('正在继续处理'); }); it('updates the running duration every second and freezes it on success', async () => {