Skip to content

feat: Add delete confirmation dialog for task deletion#725

Open
codevivekk wants to merge 1 commit into
aryandas2911:mainfrom
codevivekk:feat/task-delete-confirmation
Open

feat: Add delete confirmation dialog for task deletion#725
codevivekk wants to merge 1 commit into
aryandas2911:mainfrom
codevivekk:feat/task-delete-confirmation

Conversation

@codevivekk
Copy link
Copy Markdown

@codevivekk codevivekk commented May 18, 2026

📌 Description

State Management:

Added showConfirm state to track confirmation dialog visibility
Implemented three handlers: handleDeleteClick, handleConfirmDelete, and handleCancelDelete
User Experience Improvements:

Inline confirmation buttons replace Edit/Delete icons during confirmation phase
Escape key support to cancel the confirmation dialog
Prevents accidental task deletion by requiring explicit user confirmation
Implementation Details:

Added useEffect hook to listen for Escape key presses
Proper event listener cleanup on component unmount
Conditional rendering of action buttons based on confirmation state
Visual feedback with styled red "Confirm" and gray "Cancel" buttons
Files Changed
frontend/src/components/Task/TaskItem.jsx

🔗 Related Issue

Closes #24

🛠 Changes Made

  • Add showConfirm state to track confirmation visibility
  • Implement handleDeleteClick, handleConfirmDelete, handleCancelDelete handlers
  • Add Escape key support to cancel confirmation
  • Display inline Confirm/Cancel buttons instead of Edit/Delete icons during confirmation
  • Prevent accidental task deletion with user confirmation requirement

✅ Checklist

  • Code runs locally
  • Followed project structure
  • No console errors
  • Properly tested changes
  • Linked the issue

🚀 Notes for Reviewers

Anything specific you want reviewed.

- Add showConfirm state to track confirmation visibility
- Implement handleDeleteClick, handleConfirmDelete, handleCancelDelete handlers
- Add Escape key support to cancel confirmation
- Display inline Confirm/Cancel buttons instead of Edit/Delete icons during confirmation
- Prevent accidental task deletion with user confirmation requirement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Delete Confirmation Before Removing a Task

1 participant