fix(export): show completed sessions progress in task card

This commit is contained in:
tisonhuang
2026-03-04 20:36:03 +08:00
parent 4568795081
commit ab6db27ea7

View File

@@ -871,6 +871,13 @@ const TaskCenterModal = memo(function TaskCenterModal({
const normalizedProgressCurrent = normalizedProgressTotal > 0 const normalizedProgressCurrent = normalizedProgressTotal > 0
? Math.max(0, Math.min(normalizedProgressTotal, task.progress.current)) ? Math.max(0, Math.min(normalizedProgressTotal, task.progress.current))
: 0 : 0
const completedSessionTotal = normalizedProgressTotal > 0
? normalizedProgressTotal
: task.payload.sessionIds.length
const completedSessionCount = Math.min(
completedSessionTotal,
(task.settledSessionIds || []).length
)
const currentSessionRatio = task.progress.phaseTotal > 0 const currentSessionRatio = task.progress.phaseTotal > 0
? Math.max(0, Math.min(1, task.progress.phaseProgress / task.progress.phaseTotal)) ? Math.max(0, Math.min(1, task.progress.phaseProgress / task.progress.phaseTotal))
: null : null
@@ -891,8 +898,8 @@ const TaskCenterModal = memo(function TaskCenterModal({
/> />
</div> </div>
<div className="task-progress-text"> <div className="task-progress-text">
{normalizedProgressTotal > 0 {completedSessionTotal > 0
? `${Math.floor(normalizedProgressCurrent)} / ${normalizedProgressTotal}` ? `已完成 ${completedSessionCount} / ${completedSessionTotal}`
: '处理中'} : '处理中'}
{task.status === 'running' && currentSessionRatio !== null {task.status === 'running' && currentSessionRatio !== null
? `(当前会话 ${Math.round(currentSessionRatio * 100)}%` ? `(当前会话 ${Math.round(currentSessionRatio * 100)}%`