From c0f220582cd61f0d88e42dfbc29d55b3be1e3b19 Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 8 Feb 2026 16:18:13 +0000 Subject: Fix directive deletion and stop local only on contracts --- .../src/components/directives/DirectiveDetail.tsx | 188 +++++---------------- 1 file changed, 42 insertions(+), 146 deletions(-) (limited to 'makima/frontend/src/components/directives/DirectiveDetail.tsx') diff --git a/makima/frontend/src/components/directives/DirectiveDetail.tsx b/makima/frontend/src/components/directives/DirectiveDetail.tsx index 06d8ba2..6bdf5aa 100644 --- a/makima/frontend/src/components/directives/DirectiveDetail.tsx +++ b/makima/frontend/src/components/directives/DirectiveDetail.tsx @@ -3,8 +3,6 @@ import { useNavigate } from "react-router"; import type { DirectiveWithChains, DirectiveStatus, - ChainWithSteps, - ChainStep, ContractPhase, } from "../../lib/api"; import { getDirective } from "../../lib/api"; @@ -32,122 +30,6 @@ const statusColors: Record = { failed: "text-red-400", }; -const stepStatusColors: Record = { - pending: "text-[#888]", - running: "text-yellow-400", - passed: "text-green-400", - failed: "text-red-400", -}; - -const stepStatusIcons: Record = { - pending: "\u25CB", // ○ - running: "\u25D4", // ◔ - passed: "\u25CF", // ● - failed: "\u2715", // ✕ -}; - -function StepRow({ step }: { step: ChainStep }) { - const navigate = useNavigate(); - const color = stepStatusColors[step.status] || "text-[#888]"; - const icon = stepStatusIcons[step.status] || "\u25CB"; - const summary = step.contractSummary; - - return ( -
- {icon} -
-
- - {step.name} - - - {step.status} - -
- {summary && ( -
- - - {summary.tasksDone}/{summary.taskCount} tasks - - {step.contractId && ( - - )} -
- )} - {!summary && step.contractId && ( - - )} - {step.description && ( -

- {step.description} -

- )} -
-
- ); -} - -function ChainCard({ chainWithSteps }: { chainWithSteps: ChainWithSteps }) { - const chain = chainWithSteps; - const steps = chainWithSteps.steps || []; - - return ( -
-
-
- - {chain.name} - - - gen {chain.generation} · {chain.status} - -
- {chain.description && ( -

- {chain.description} -

- )} -
- - {chain.completedSteps}/{chain.totalSteps} steps - - {chain.failedSteps > 0 && ( - {chain.failedSteps} failed - )} - {chain.currentConfidence != null && ( - - confidence: {(chain.currentConfidence * 100).toFixed(0)}% - - )} -
-
- {steps.length > 0 && ( -
- {steps.map((step) => ( - - ))} -
- )} -
- ); -} - function JsonSection({ label, data, @@ -484,39 +366,53 @@ export function DirectiveDetail({ {activeTab === "chain" && (
- {/* Step diagram */} - {directive.chains.length > 0 && ( -
-

- Step Dependencies -

- c.steps)} - /> -
- )} - - {/* Chain cards */} -
-

- Chains ({directive.chains.length}) -

- {directive.chains.length === 0 ? ( -

+ {directive.chains.length === 0 ? ( +

+
+ {directive.status === "planning" ? "\u2699" : "\u25CB"} +
+

{directive.status === "planning" - ? "Planning in progress... chains will appear when the planner completes." + ? "Planning in progress... the chain will appear when the planner submits a plan." : directive.status === "draft" ? "No chains yet. Start the directive to begin planning." : "No chains created for this directive."}

- ) : ( -
- {directive.chains.map((cws) => ( - - ))} -
- )} -
+
+ ) : ( + <> + {/* Chain metadata header */} + {directive.chains.map((chain) => ( +
+
+ + {chain.name} + + + gen {chain.generation} + + + {chain.status} + + + {chain.completedSteps}/{chain.totalSteps} steps + {chain.failedSteps > 0 && ( + + ({chain.failedSteps} failed) + + )} + +
+ +
+ ))} + + )}
)} -- cgit v1.2.3