From df30c65b4c1784b8ef2a28b33fbd9d66337ae64d Mon Sep 17 00:00:00 2001 From: bracesproul Date: Fri, 7 Mar 2025 13:48:40 -0800 Subject: [PATCH] better ui for rendering plan --- agent/uis/open-code/plan/index.tsx | 94 +++++++++++++++++++----------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/agent/uis/open-code/plan/index.tsx b/agent/uis/open-code/plan/index.tsx index d6bbce3..2b524ee 100644 --- a/agent/uis/open-code/plan/index.tsx +++ b/agent/uis/open-code/plan/index.tsx @@ -1,4 +1,7 @@ import "./index.css"; +import { motion } from "framer-motion"; +import { ChevronDown } from "lucide-react"; +import { useState } from "react"; interface PlanProps { toolCallId: string; @@ -8,41 +11,66 @@ interface PlanProps { } export default function Plan(props: PlanProps) { + const [isExpanded, setIsExpanded] = useState(false); + return ( -
-

Code Plan

-
-
-

- Remaining Plans -

- {props.remainingPlans.map((step, index) => ( -

- {index + 1}. {step} -

- ))} -
-
-

- Executed Plans -

- {props.executedPlans.map((step, index) => ( -

- {step} -

- ))} -
-
-

- Rejected Plans -

- {props.rejectedPlans.map((step, index) => ( -

- {step} -

- ))} -
+
+
+

Code Plan

+ +
+
+

+ Remaining Plans +

+ {props.remainingPlans.map((step, index) => ( +

+ {index + 1}. {step} +

+ ))} +
+
+

+ Executed Plans +

+ {props.executedPlans.map((step, index) => ( +

+ {step} +

+ ))} +
+
+

+ Rejected Plans +

+ {props.rejectedPlans.map((step, index) => ( +

+ {step} +

+ ))} +
+
+
+ setIsExpanded(!isExpanded)} + animate={{ rotate: isExpanded ? 180 : 0 }} + transition={{ duration: 0.3, ease: [0.4, 0, 0.2, 1] }} + > + +
); }