auto-sync: 2026-05-18 11:54:19

This commit is contained in:
cfdaily
2026-05-18 11:54:19 +08:00
parent 8f88a92704
commit aa42ed5c7a
@@ -281,6 +281,19 @@ export default function EdictBoard() {
{ key: 'blocked', label: '阻塞', icon: '🚧' },
];
// 构建子 Task 索引:parent_id → { total, done, activeStage }
const subtaskIndex: Record<string, { total: number; done: number; activeStage: string | null }> = {};
tasks.forEach(t => {
if (t.parent_task) {
if (!subtaskIndex[t.parent_task]) subtaskIndex[t.parent_task] = { total: 0, done: 0, activeStage: null };
subtaskIndex[t.parent_task].total++;
if (t.status === 'done') subtaskIndex[t.parent_task].done++;
if (['working', 'claimed', 'review'].includes(t.status) && !subtaskIndex[t.parent_task].activeStage) {
subtaskIndex[t.parent_task].activeStage = t.stage || t.status;
}
}
});
let filtered = tasks.filter(t => !t.parent_task); // 只显示顶层 Task
if (statusFilter !== 'all') filtered = filtered.filter(t => t.status === statusFilter);
if (searchQuery.trim()) {