-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Problem
Two destructive actions have no confirmation step and insufficient loading feedback:
1. DeletePaymentButton (app/(admin)/invoices/[invoiceId]/DeletePaymentButton.tsx)
- A single click on a small icon button permanently deletes a payment record
- No confirmation step — easy to misclick in a dense UI
- Pending state is
opacity-50only — no label change to communicate "Deleting…" - No
window.confirm()either (it was never added) — just fires immediately
2. TimeEntryModal delete (components/time/TimeEntryModal.tsx:176)
- "Delete" button in the edit modal footer fires immediately on click
- No confirmation step before permanently deleting a time entry
- A misclick in the modal footer (Cancel / Delete are adjacent) is easy
Fix
DeletePaymentButton
Replace the bare <button> with a pattern that:
- Shows a confirmation Dialog on first click
- Shows "Deleting…" text while
isPending - Disables both Cancel and Delete buttons while pending
TimeEntryModal delete
Add a confirmation step before handleDelete executes — either:
- An inline
useState(false)confirmation prompt within the modal footer ("Are you sure?" + Confirm/Cancel buttons replacing the Delete button), or - A separate small Dialog
Acceptance criteria
-
DeletePaymentButtonrequires a confirmation step before deleting -
DeletePaymentButtonshows a text label change while deleting (not just opacity) -
TimeEntryModaldelete requires a confirmation step - Both confirmations are non-blocking (Dialog, not
window.confirm()) -
npm run buildpasses
Reactions are currently unavailable