发布 v1.10 #5
@@ -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<ChatTimelineStatusItem | undefined>(() => {
|
||||
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')"
|
||||
>
|
||||
<div
|
||||
v-if="expanded && (processItems.length > 0 || continuingStatus)"
|
||||
v-if="expanded && processItems.length > 0"
|
||||
:id="processId"
|
||||
class="chat-timeline-turn__process"
|
||||
>
|
||||
@@ -362,10 +329,6 @@ function handleNestedLayoutToggle() {
|
||||
@thinking-toggle="handleNestedLayoutToggle"
|
||||
/>
|
||||
</template>
|
||||
<ChatTimelineItemView
|
||||
v-if="continuingStatus"
|
||||
:item="continuingStatus"
|
||||
/>
|
||||
</div>
|
||||
</Transition>
|
||||
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user