feat(stacks): add Schedule task shortcut to stack context and kebab menus (#772)

Right-clicking a stack or opening its 3-dot menu now shows a
'Schedule task' entry in the lifecycle group (visible to paid tiers).
Clicking it navigates to Scheduled Operations and opens the New
Schedule dialog pre-filled with the stack name and active node,
removing the need to navigate there manually and re-enter the target.

- Added openScheduleTask to StackMenuCtx; wired in buildMenuCtx using
  the active node from NodeContext
- Extended ScheduledOperationsView with optional prefill/onPrefillConsumed
  props; a ref-guarded effect calls openCreate() with the prefill data
- openCreate refactored to accept an optional prefill arg, removing the
  duplication between the effect and the existing 'New Schedule' button
This commit is contained in:
Anso
2026-04-25 11:49:01 -04:00
committed by GitHub
parent af9cb0aa63
commit 819d2a63fc
5 changed files with 58 additions and 27 deletions
@@ -26,9 +26,6 @@ export interface StackMenuCtx {
hasPort: boolean;
isBusy: boolean;
isPaid: boolean;
// isAdmiral: plumbed now so Admiral-specific menu items can be added in a
// follow-up PR without changing this interface. No Admiral-only items ship
// in the current PR; the auto-update toggle is Skipper+, gated on isPaid.
isAdmiral: boolean;
canDelete: boolean;
isPinned: boolean;
@@ -51,6 +48,7 @@ export interface StackMenuCtx {
createAndAssignLabel: (name: string, color: LabelColor) => Promise<void>;
openLabelManager: () => void;
setAutoUpdateEnabled: (enabled: boolean) => void;
openScheduleTask: () => void;
}
export type StackGroupKind = 'pinned' | 'labeled' | 'unlabeled';