fix(ui): replace native window.confirm() with styled ConfirmDialog for destructive actions #198

Merged
vas2000-work merged 1 commit from feat/MAPPS-189-confirm-dialog-replace-native-confirm into main 2026-06-16 23:48:53 +02:00
Owner

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

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<MouseEvent> 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>
fix(ui): replace native window.confirm() with styled ConfirmDialog for destructive actions
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m0s
Create release / Create release from merged PR (pull_request) Has been skipped
dd3485f45b
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<MouseEvent> 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>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!198
No description provided.