Skip to content

feat: add confirmation dialogs before destructive actions in navigator #41

Description

@gr3enarr0w

Summary

Pressing x in the navigator immediately stops a running workflow or deletes a saved workflow with only a post-hoc ui.notify(). A confirmation step prevents accidental data loss.

Current state

case 'stop':
  manager.stop(action.runId)     // immediate, no confirm
  ui.notify(`Stopped ${action.runId}`)
  break
case 'deleteSaved':
  storage.delete(action.savedName)  // immediate, no confirm

ctx.ui.confirm() already exists and is used in /workflows-models — infrastructure is in place.

Proposed change

case 'stop': {
  const ok = await ctx.ui.confirm(`Stop workflow "${run.name}"? This cannot be undone.`)
  if (!ok) break
  manager.stop(action.runId)
  break
}
case 'deleteSaved': {
  const ok = await ctx.ui.confirm(`Delete saved workflow "/${action.savedName}"?`)
  if (!ok) break
  storage.delete(action.savedName)
  pi.unregisterCommand(action.savedName)
  break
}

Also apply to pause with a lighter confirmation.

Files to change

  • src/workflow-ui.ts — wrap stop, deleteSaved, pause with ctx.ui.confirm()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions