diff --git a/AgentCompany-New/src/renderer/src/pages/WorkPage.tsx b/AgentCompany-New/src/renderer/src/pages/WorkPage.tsx index 253e714a..254cf101 100644 --- a/AgentCompany-New/src/renderer/src/pages/WorkPage.tsx +++ b/AgentCompany-New/src/renderer/src/pages/WorkPage.tsx @@ -128,7 +128,7 @@ export function WorkPage({ snapshot, actions }: PageProps) { onOpen={(task) => setDetailTaskId(task.id)} /> )} - {view === "timeline" && } + {view === "timeline" && } setNewGoalOpen(false)} /> setNewProjectOpen(false)} /> @@ -329,7 +329,8 @@ function ListView({ ); } -function TimelineView({ tasks, goals }: { tasks: TaskRecord[]; goals: GoalRecord[] }) { +function TimelineView({ tasks, goals, projects }: { tasks: TaskRecord[]; goals: GoalRecord[]; projects: ProjectRecord[] }) { + const unlinked = tasks.filter((t) => !t.goalId); return (
By goal
@@ -337,6 +338,7 @@ function TimelineView({ tasks, goals }: { tasks: TaskRecord[]; goals: GoalRecord const linked = tasks.filter((task) => task.goalId === goal.id); const done = linked.filter((task) => task.status === TASK_STATUS.DONE).length; const pct = linked.length === 0 ? 0 : Math.round((done / linked.length) * 100); + const goalProjects = projects.filter((p) => p.goalId === goal.id); return (
@@ -346,9 +348,30 @@ function TimelineView({ tasks, goals }: { tasks: TaskRecord[]; goals: GoalRecord
+ {goalProjects.length > 0 && ( +
+ {goalProjects.map((p) => { + const projectTasks = linked.filter((t) => t.projectId === p.id); + const projectDone = projectTasks.filter((t) => t.status === TASK_STATUS.DONE).length; + return ( + + {truncate(p.name, 24)} {projectDone}/{projectTasks.length} + + ); + })} +
+ )}
); })} + {unlinked.length > 0 && ( +
+
+ Unlinked tasks + {unlinked.length} +
+
+ )}
); }