新增: 后台任务卡徽章+轮次投影(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
+3 -1
View File
@@ -9,7 +9,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, convStates, clearApprovalTimer, flushCurrentText, clearAllToolSlowTimers, friendlyError, notifyConversationChanged, clearLastDelta, discardConvPendingApprovals, notifyQueueCleared } from './aiShared'
import { nextMsgId, convStates, clearApprovalTimer, flushCurrentText, clearAllToolSlowTimers, friendlyError, notifyConversationChanged, clearLastDelta, discardConvPendingApprovals, notifyQueueCleared, clearConvRound } from './aiShared'
import { clearTextIdleTimer, pendingMaxRounds, pendingHelp, pendingDirAuths, pendingTaskParked, pendingTaskProgress } from './useAiPendingState'
import { clearStreamWatchdog, clearResumeAttempts } from './useAiStream'
import { setStreaming } from './streamingGuard'
@@ -74,6 +74,8 @@ function cleanupTerminatedConversation(convId: string, reason: 'AiCompleted' | '
}
setStreaming(false, { convId: convId || null, reason })
state.agentRound = 0 // 结束/中断/求助,复位轮次(隐藏进度条)
// #14 桌面任务卡:终态即清 per-conv 轮次(前台会话终态收敛,与后台分支 clearConvRound 对齐)
clearConvRound(convId)
// convStates 收敛:AiError 保留 error 项(停止按钮显「重试」态),其余删项回 idle
if (reason === 'AiError') {
if (convId) convStates.set(convId, 'error')