新增: 后台任务卡徽章+轮次投影(convRounds), 可恢复分区(parked), reattachToMain i18n 补键(#12)

This commit is contained in:
lxy
2026-10-06 12:13:33 +08:00
parent 70d6e98f82
commit 04db8c0d3b
11 changed files with 250 additions and 32 deletions
+5 -1
View File
@@ -10,7 +10,7 @@ import { emit } from '@tauri-apps/api/event'
import { useAppSettingsStore } from '@/stores/appSettings'
import { state } from '@/stores/ai'
import { t } from '@/i18n/i18n-helpers'
import { nextMsgId, findToolCall, startApprovalTimer, clearToolSlowTimer, getLastDelta, setLastDelta, flushCurrentText, addPendingApproval } from './aiShared'
import { nextMsgId, findToolCall, startApprovalTimer, clearToolSlowTimer, getLastDelta, setLastDelta, flushCurrentText, addPendingApproval, setConvRound } from './aiShared'
import { resetTextIdleTimer, clearTextIdleTimer, pendingDirAuths, pushPendingDirAuth } from './useAiPendingState'
import { clearStreamWatchdog } from './useAiStream'
import type { AiChatEvent, AiMessage, MessageId } from '@/api/types'
@@ -57,6 +57,10 @@ export function handleStreamingEvent(event: AiChatEvent): boolean {
})
// round>0 才更新进度条(round=0 是审批通过后「隔开新一轮」的占位,实际轮次未推进,防闪烁)
if (event.round > 0) state.agentRound = event.round
// #14 桌面任务卡:per-conv 轮次追踪,前台会话在此写(取 max 防事件乱序回退);
// 后台会话在 useAiEvents 非 current 分支的 return 前补写(彼处 AiAgentRound
// 原本直接穿透丢弃,任务卡需要后台轮次才能显示「进行中 N 轮」)
if (event.round > 0) setConvRound(event.conversation_id || state.activeConversationId, event.round)
return true
}