Skip to content

The open-source app everyone uses to manage agents at work

fix(ui): render sub-goals in goal detail tree

Tyler Wincebdc0480e621c
diff --git a/ui/src/components/GoalTree.tsx b/ui/src/components/GoalTree.tsx
index fe20ee6449..116b1668f2 100644
--- a/ui/src/components/GoalTree.tsx
+++ b/ui/src/components/GoalTree.tsx
@@ -92,7 +92,8 @@ function GoalNode({ goal, children, allGoals, depth, goalLink, onSelect }: GoalN
}
export function GoalTree({ goals, goalLink, onSelect }: GoalTreeProps) {
- const roots = goals.filter((g) => !g.parentId);
+ const goalIds = new Set(goals.map((g) => g.id));
+ const roots = goals.filter((g) => !g.parentId || !goalIds.has(g.parentId));
if (goals.length === 0) {
return <p className="text-sm text-muted-foreground">No goals.</p>;