diff --git a/frontend/src/components/TaskTree/TaskFlowView.tsx b/frontend/src/components/TaskTree/TaskFlowView.tsx index 2dd6834..3813d18 100644 --- a/frontend/src/components/TaskTree/TaskFlowView.tsx +++ b/frontend/src/components/TaskTree/TaskFlowView.tsx @@ -102,10 +102,10 @@ export const TaskFlowView = memo(function TaskFlowView({ tasks, onAction, curren const { allMains, childMap } = useMemo(() => { ALL_TASKS.clear(); if (tasks.length) collectAll(tasks); const all = Array.from(ALL_TASKS); - // 🔧 仅收集根级主干节点(parent_task_id IS NULL),杜绝 TRANSFER 子节点双重渲染 + // 🚀 收集所有主线任务(全部进入中央垂直主轴) const mains: TaskResponse[] = []; for (const t of all) { - if (!t.parent_task_id && isMain(t)) mains.push(t); + if (isMain(t)) mains.push(t); } mains.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime()); // 🚀 构建全局 childMap(按 parent_task_id 索引直接子节点,保留真实树结构) @@ -162,7 +162,8 @@ export const TaskFlowView = memo(function TaskFlowView({ tasks, onAction, curren {/* ─── 统一垂直时间线布局(焦点/全景共用) ─── */}
{visibleMains.map(mainTask => { - const directChildren = childMap[mainTask.id] || []; + // 🔧 侧翼严格过滤:主线归主轴,仅 SPAWN 协助分支进入左右翼 + const directChildren = (childMap[mainTask.id] || []).filter(c => !isMain(c)); const hasLegacyActive = directChildren.some(c => !isMain(c) && !active(mainTask.status)); const leftDirect = directChildren.filter((_, i) => i % 2 === 0); const rightDirect = directChildren.filter((_, i) => i % 2 === 1);