diff options
| author | soryu <soryu@soryu.co> | 2026-02-16 15:45:42 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-16 15:45:42 +0000 |
| commit | 7d2079d7c13804766405af8044574bfc93a86897 (patch) | |
| tree | 05212cb5cd472eff75ed54b9805a1d6ef5c7d922 /makima/frontend/src/components/directives/DirectiveDetail.tsx | |
| parent | 29ec8e53f2acf56fe4a2cd02d352144c697a6afc (diff) | |
| download | soryu-7d2079d7c13804766405af8044574bfc93a86897.tar.gz soryu-7d2079d7c13804766405af8044574bfc93a86897.zip | |
Add PR button to directives
Diffstat (limited to 'makima/frontend/src/components/directives/DirectiveDetail.tsx')
| -rw-r--r-- | makima/frontend/src/components/directives/DirectiveDetail.tsx | 16 |
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} |
