重构+新增: 前端God文件拆分+进度条completed计数器

- useStreamRenderer.ts: 流式Markdown块级渲染逻辑(220行)提取为composable

- EmptyState.vue: 空状态(无provider引导+示例问题)独立组件(134行)

- MentionPopover.vue: @实体联想浮层独立组件(132行)

- EnrichmentPanel.vue: @项目enrichment预览面板独立组件(144行)

- MessageList.vue: 1386→1148行(-238行)

- ChatInput.vue: 1155→1007行(-148行)

- AiChat进度条: completedTools计数器(AiToolCallCompleted+1, AiAgentRound重置)

- i18n: 进度条文案加已完成工具数(中英文)

- vue-tsc + vite build 通过
This commit is contained in:
2026-07-02 01:44:42 +08:00
parent 54ffc868b2
commit 266744b695
12 changed files with 728 additions and 463 deletions

View File

@@ -282,6 +282,7 @@ function handleStreamingEvent(event: AiChatEvent): boolean {
// Agent 循环新一轮:保存当前文本到上一条 assistant 消息,新建空 assistant 消息
flushCurrentText()
state.currentText = ''
state.completedTools = 0 // 新轮重置工具计数器
state.messages.push({
id: `ai-${nextMsgId()}` as MessageId,
role: 'assistant',
@@ -445,6 +446,7 @@ function handleToolEvent(event: AiChatEvent): boolean {
tc.status = 'completed'
tc.result = event.result
}
state.completedTools++ // 进度条计数器
state.pendingApprovals = state.pendingApprovals.filter(p => p.id !== event.id)
clearToolSlowTimer(event.id)
// AE-2025-06: 工具结束(无论审批通过后执行还是被拒),清审批超时计时器