summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components/directives/DirectiveDetail.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/components/directives/DirectiveDetail.tsx')
-rw-r--r--makima/frontend/src/components/directives/DirectiveDetail.tsx16
1 files changed, 16 insertions, 0 deletions
diff --git a/makima/frontend/src/components/directives/DirectiveDetail.tsx b/makima/frontend/src/components/directives/DirectiveDetail.tsx
index 9305e20..c8da7a0 100644
--- a/makima/frontend/src/components/directives/DirectiveDetail.tsx
+++ b/makima/frontend/src/components/directives/DirectiveDetail.tsx
@@ -27,6 +27,7 @@ interface DirectiveDetailProps {
onRefresh: () => void;
onCleanupTasks: () => void;
onPickUpOrders: () => Promise<{ message: string; orderCount: number; taskId: string | null } | null>;
+ onCreatePR: () => Promise<void>;
}
export function DirectiveDetail({
@@ -43,12 +44,14 @@ export function DirectiveDetail({
onRefresh,
onCleanupTasks,
onPickUpOrders,
+ onCreatePR,
}: DirectiveDetailProps) {
const [editingGoal, setEditingGoal] = useState(false);
const [goalText, setGoalText] = useState(directive.goal);
const [visibleTaskIds, setVisibleTaskIds] = useState<Set<string> | null>(null);
const [pickingUpOrders, setPickingUpOrders] = useState(false);
const [pickUpResult, setPickUpResult] = useState<string | null>(null);
+ const [creatingPR, setCreatingPR] = useState(false);
// Sync goalText and reset editing state when directive changes
useEffect(() => {
@@ -333,6 +336,19 @@ export function DirectiveDetail({
Clean up tasks
</button>
)}
+ {completedSteps > 0 && !directive.completionTaskId && (
+ <button
+ type="button"
+ onClick={async () => {
+ setCreatingPR(true);
+ try { await onCreatePR(); } catch (e) { console.error("Failed to create PR:", e); } finally { setCreatingPR(false); }
+ }}
+ disabled={creatingPR}
+ className="text-[10px] font-mono text-emerald-400 hover:text-emerald-300 border border-emerald-800 rounded px-2 py-1 disabled:opacity-50"
+ >
+ {creatingPR ? "Creating..." : directive.prUrl ? "Update PR" : "Create PR"}
+ </button>
+ )}
<button
type="button"
onClick={handlePickUpOrders}