summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/components')
-rw-r--r--makima/frontend/src/components/directives/DirectiveDetail.tsx25
1 files changed, 10 insertions, 15 deletions
diff --git a/makima/frontend/src/components/directives/DirectiveDetail.tsx b/makima/frontend/src/components/directives/DirectiveDetail.tsx
index c9dac37..98940d0 100644
--- a/makima/frontend/src/components/directives/DirectiveDetail.tsx
+++ b/makima/frontend/src/components/directives/DirectiveDetail.tsx
@@ -25,7 +25,7 @@ interface DirectiveDetailProps {
onUpdate: (req: UpdateDirectiveRequest) => void;
onDelete: () => void;
onRefresh: () => void;
- onCleanupTasks: () => void;
+ onCleanup: () => void;
onPickUpOrders: () => Promise<{ message: string; orderCount: number; taskId: string | null } | null>;
onCreatePR: () => Promise<void>;
}
@@ -42,7 +42,7 @@ export function DirectiveDetail({
onUpdate,
onDelete,
onRefresh,
- onCleanupTasks,
+ onCleanup,
onPickUpOrders,
onCreatePR,
}: DirectiveDetailProps) {
@@ -66,9 +66,6 @@ export function DirectiveDetail({
const completedSteps = directive.steps.filter((s) => s.status === "completed").length;
const totalSteps = directive.steps.length;
const progress = totalSteps > 0 ? Math.round((completedSteps / totalSteps) * 100) : 0;
- const terminalStatuses = new Set(["completed", "failed", "skipped"]);
- const hasTerminalTasks = directive.steps.some((s) => s.taskId && terminalStatuses.has(s.status));
-
// Get pending questions for this directive's tasks
const { pendingQuestions, submitAnswer } = useSupervisorQuestions();
const directiveTaskIds = useMemo(() => {
@@ -325,17 +322,15 @@ export function DirectiveDetail({
>
Update Goal
</button>
+ <button
+ type="button"
+ onClick={onCleanup}
+ className="text-[10px] font-mono text-[#7788aa] hover:text-white border border-[#2a3a5a] rounded px-2 py-1"
+ >
+ Clean up
+ </button>
</div>
)}
- {hasTerminalTasks && (
- <button
- type="button"
- onClick={onCleanupTasks}
- className="text-[10px] font-mono text-[#7788aa] hover:text-white border border-[#2a3a5a] rounded px-2 py-1 ml-auto"
- >
- Clean up tasks
- </button>
- )}
{completedSteps > 0 && !directive.completionTaskId && (
<button
type="button"
@@ -360,7 +355,7 @@ export function DirectiveDetail({
<button
type="button"
onClick={onDelete}
- className={`text-[10px] font-mono text-red-400 hover:text-red-300 border border-red-800 rounded px-2 py-1 ${hasTerminalTasks ? "" : "ml-auto"}`}
+ className="text-[10px] font-mono text-red-400 hover:text-red-300 border border-red-800 rounded px-2 py-1 ml-auto"
>
Delete
</button>