diff options
Diffstat (limited to 'makima/frontend/src/components/directives/DirectiveContextMenu.tsx')
| -rw-r--r-- | makima/frontend/src/components/directives/DirectiveContextMenu.tsx | 91 |
1 files changed, 77 insertions, 14 deletions
diff --git a/makima/frontend/src/components/directives/DirectiveContextMenu.tsx b/makima/frontend/src/components/directives/DirectiveContextMenu.tsx index 3f24ce1..eda7e7f 100644 --- a/makima/frontend/src/components/directives/DirectiveContextMenu.tsx +++ b/makima/frontend/src/components/directives/DirectiveContextMenu.tsx @@ -17,6 +17,14 @@ interface DirectiveContextMenuProps { * tabular UI doesn't have to wire it up. */ onNewDraft?: () => void; + /** Trigger a fresh PR creation from the current contract state. */ + onCreatePR?: () => void; + /** Manually advance the DAG (find newly-ready steps). */ + onAdvance?: () => void; + /** Run the cleanup task to prune merged/stale steps. */ + onCleanup?: () => void; + /** Pick up linked orders (queue them as new steps). */ + onPickUpOrders?: () => void; } export function DirectiveContextMenu({ @@ -30,6 +38,10 @@ export function DirectiveContextMenu({ onDelete, onGoToPR, onNewDraft, + onCreatePR, + onAdvance, + onCleanup, + onPickUpOrders, }: DirectiveContextMenuProps) { const menuRef = useRef<HTMLDivElement>(null); @@ -153,21 +165,72 @@ export function DirectiveContextMenu({ </button> )} - {/* Go to PR link */} + {/* Orchestration actions — Advance / Pick up orders / Cleanup. */} + {(onAdvance || onPickUpOrders || onCleanup) && ( + <div className={dividerClass} /> + )} + {onAdvance && ( + <button + className={menuItemClass} + onClick={() => { + onAdvance(); + onClose(); + }} + > + <span className="text-[#75aafc]">»</span> + Advance DAG + </button> + )} + {onPickUpOrders && ( + <button + className={menuItemClass} + onClick={() => { + onPickUpOrders(); + onClose(); + }} + > + <span className="text-[#c084fc]">◆</span> + Plan orders + </button> + )} + {onCleanup && ( + <button + className={menuItemClass} + onClick={() => { + onCleanup(); + onClose(); + }} + > + <span className="text-[#75aafc]">⎚</span> + Clean up + </button> + )} + + {/* PR actions — Create / Update / Go to PR. */} + {(onCreatePR || showGoToPR) && <div className={dividerClass} />} + {onCreatePR && ( + <button + className={menuItemClass} + onClick={() => { + onCreatePR(); + onClose(); + }} + > + <span className="text-emerald-300">↗</span> + {directive.prUrl ? "Update PR" : "Create PR"} + </button> + )} {showGoToPR && ( - <> - <div className={dividerClass} /> - <button - className={menuItemClass} - onClick={() => { - onGoToPR(); - onClose(); - }} - > - <span className="text-[#75aafc]">↗</span> - Go to PR - </button> - </> + <button + className={menuItemClass} + onClick={() => { + onGoToPR(); + onClose(); + }} + > + <span className="text-[#75aafc]">↗</span> + Go to PR + </button> )} <div className={dividerClass} /> |
