diff --git a/apps/web/src/components/gen-ui/accepted-plan-step.tsx b/apps/web/src/components/gen-ui/accepted-plan-step.tsx index aed9f396..05bc095b 100644 --- a/apps/web/src/components/gen-ui/accepted-plan-step.tsx +++ b/apps/web/src/components/gen-ui/accepted-plan-step.tsx @@ -12,6 +12,9 @@ import { cn } from "@/lib/utils"; import { Button } from "../ui/button"; import { Badge } from "../ui/badge"; import { HumanResponse } from "@langchain/langgraph/prebuilt"; +import { TaskPlan } from "@open-swe/shared/open-swe/types"; +import { getActivePlanItems } from "@open-swe/shared/open-swe/tasks"; +import { InlineMarkdownText } from "../thread/markdown-text"; type PlanItem = { index: number; @@ -20,6 +23,7 @@ type PlanItem = { }; type AcceptedPlanStepProps = { + taskPlan?: TaskPlan; planTitle?: string; planItems?: PlanItem[]; interruptType?: HumanResponse["type"]; @@ -27,12 +31,14 @@ type AcceptedPlanStepProps = { }; export function AcceptedPlanStep({ + taskPlan, planTitle, planItems = [], interruptType, collapse: collapseProp = true, }: AcceptedPlanStepProps) { const [collapsed, setCollapsed] = useState(collapseProp); + const activeTaskPlan = taskPlan ? getActivePlanItems(taskPlan) : planItems; const getStatusText = () => { if (interruptType === "edit") { @@ -68,7 +74,7 @@ export function AcceptedPlanStep({ ); }; - const totalCount = planItems.length; + const totalCount = activeTaskPlan.length; return (
- {totalCount} steps + {totalCount} step{totalCount === 1 ? "" : "s"}
)}{item.plan} -
+