The PR deletes a row with window.confirm("Are you sure?"), or it mounts a new centered overlay with two buttons and a click-outside dismiss. The repo already has a ConfirmDialog (or AlertDialog) with a title, a description, a destructive confirm action, and a focus return to the trigger. Nearby destructive actions already use it. The browser confirm cannot be styled, and the homemade overlay misses Escape, initial focus, and the existing danger-button variant.
I've started treating a window.confirm as an incomplete dialog, not as a lighter safety check. Asking yes or no is the easy part. Focus trap, labeled actions, and a consistent danger style are why the primitive is there.
Why window.confirm shows up
A tutorial "confirm delete" example is window.confirm. The model can write that without finding ConfirmDialog. Your primitive may wrap Radix AlertDialog or be named DangerModal, which is easy to miss if the prompt only says "ask the user to confirm."
You also skip the existing copy pattern: what will be deleted, and that the action cannot be undone, instead of a generic "Are you sure?"
A simple confirm policy
- New destructive or irreversible actions use the existing confirm dialog
- Do not call
window.confirmorwindow.alert - Do not build a new overlay in a feature file
- A new destructive variant is a primitive change, with a story
A Toast is not a confirm. If the user must choose, use the dialog. If they can undo, use the existing undo Toast.
What to put in the prompt
Use the existing ConfirmDialog or AlertDialog for this destructive action. Do not call window.confirm, and do not build a new overlay in this file. Follow the existing title, description, and destructive confirm pattern. If the action can be undone, use the existing undo Toast instead. Paste one existing confirm usage. In review, search the diff for window.confirm, a one-off overlay with "Are you sure?", and a delete that has no confirm at all when the rest of the app requires one.
Reject / send back
Reject
-
window.confirmorwindow.alertfor a destructive action - A feature-level overlay that reimplements the confirm dialog
- Generic "Are you sure?" copy when the existing pattern names the thing being deleted
- A confirm used where an undo Toast is the established pattern
Accept
- A destructive action that uses the existing confirm dialog
- A primitive PR that adds a documented variant and a story
- An undoable action that stays on the existing Toast
