fix(ui): replace native window.confirm() with styled ConfirmDialog for destructive actions #198
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/MAPPS-189-confirm-dialog-replace-native-confirm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every destructive action in the SPA prompted via the native browser window.confirm() (web_sys confirm_with_message). That dialog is unthemed OS chrome that ignores dark/high-contrast mode, is inconsistent with the app's existing styled Modal, and freezes the page event loop so browser automation (Claude-in-Chrome, Playwright) cannot drive any delete flow. This swaps all 14 remaining call sites onto the existing, themed, focus-trapped ConfirmDialog component (the same one PMS-369 already adopted for SLA targets).
SettingFormModal now owns the confirmation for the 10 settings lookup editors and the 2 contract rate-card / rate editors: the footer Delete button opens a ConfirmDialog and the caller's ondelete fires only on confirm. Its ondelete prop changed from EventHandler to EventHandler<()> to match. The settings delete_lookup helper no longer prompts (its native confirm_delete helper is removed) since confirmation now happens up front in the dialog.
The remaining detail-page, modal-form, table-row, and invoice-void sites (assets, contracts, contacts company/site/contact, projects, time entry, calendar appointment, billing void / payment / tax rate / gateway) each gained a confirming-delete signal: the Danger button opens the dialog and the actual request runs from an on_confirm_delete handler, mirroring the SLA reference pattern. No confirm_with_message / window.confirm calls remain in src (grep clean).
#MAPPS-189
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com