Skip to content

Consistent destructive actions: one confirm pattern, undo toast, delete non-empty blocks #83

Description

@ApocDev

Destructive actions currently behave three different ways, one has no confirmation at all, and one is missing entirely:

  • Recipe-row removal uses a click-to-arm confirm (routes/block.$id.tsx).
  • Task/subtask/note deletion and project removal use raw window.confirm (routes/tasks.tsx, components/project-switcher.tsx).
  • Companion-mod Remove fires immediately with no confirmation (components/companion-mod-card.tsx).
  • There is no UI path to delete a non-empty block: deleteBlockFn is only reachable through tab-close, which silently deletes empty blocks only (routes/block.tsx).

What to do

  • Pick one pattern per severity and apply it everywhere: small reversible deletes (recipe row, note, subtask) happen immediately with no confirm — the undo system (Undo system: trigger-based undo log with multi-level Ctrl+Z #90) covers regret, with a brief post-delete toast whose Undo button is just a shortcut to it; big deletes (block, project, companion mod) get a proper confirm dialog (shadcn AlertDialog, not window.confirm) that names what's being deleted.
  • Add an explicit Delete block action (block context menu and/or the block page) that works for non-empty blocks, with the confirm dialog stating the recipe/goal count being destroyed.
  • Undo itself is out of scope here: multi-level undo is Undo system: trigger-based undo log with multi-level Ctrl+Z #90 (trigger-based undo log), and named restore points / history are plan snapshots (Plan snapshots: block-level history, restore, and diff #85). This issue is the confirm-pattern unification and the missing delete path.

Part of the polish epic #35.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: webWeb UI (React/TanStack/vite-plus)enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions