Skip to content

Add Confirmation Dialog for Collection Deletion #7

Description

@0010aor

Description

Add a confirmation step when deleting collections to prevent accidental deletions.

Current Behavior

  • Collection is deleted immediately upon clicking delete
  • No confirmation step
  • Potential for accidental deletions

Expected Behavior

  • Show confirmation dialog before deletion
  • Clear warning about the action being irreversible
  • Option to cancel or confirm
  • Show toast notification after successful deletion with message "Collection deleted successfully"
  • Show toast notification if deletion fails with message "Error deleting collection"

Acceptance Criteria

  • Confirmation dialog appears before deletion
  • Dialog clearly states consequences
  • Cancel button is focused by default
  • Escape key closes dialog
  • Clicking outside closes dialog
  • Success toast appears after successful deletion (using toaster.create({ title: "Collection deleted successfully", type: "success" }))
  • Error toast appears if deletion fails (using toaster.create({ title: "Error deleting collection", type: "error" }))

As reference: useCards.ts alredy uses the toaster: import { toaster } from "@/components/ui/toaster";

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions