{
  "id": 22581363,
  "title": "Require the agent to reuse the existing confirm dialog, not window.confirm",
  "url": "https://urgent.news/2026/11/29/require-the-agent-to-reuse-the-existing-confirm-dialog-not-window",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-29T13:00:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sherotree/require-the-agent-to-reuse-the-existing-confirm-dialog-not-windowconfirm-8e3"
  },
  "original_language": null,
  "account": "The existing confirm dialog, referred to as ConfirmDialog or AlertDialog, should be reused for any destructive or irreversible action within the application. The current implementation, which utilizes window.confirm, lacks the ability to style the dialog and fails to account for crucial features such as focus trapping, labeled actions, and a consistent danger style. This oversight often leads to the creation of a new overlay with a generic \"Are you sure?\" message, which neglects to provide context about the impending action or its irreversible nature. In order to maintain consistency and usability, new destructive variants must be implemented as primitives, accompanied by a story that outlines their functionality. It is essential to avoid calling window.confirm or window.alert, and to refrain from building a new overlay within a feature file. Instead, the existing title, description, and destructive confirm pattern of the ConfirmDialog or AlertDialog should be followed. If the action can be undone, it is preferable to use the existing undo Toast instead of creating a new confirm dialog. This approach aligns with the overall user experience and ensures that destructive actions are handled in a consistent and intuitive manner across the application.",
  "summary": "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…",
  "summary_source": "publisher",
  "key_points": [
    "Reuse existing ConfirmDialog/AlertDialog for destructive actions",
    "Avoid using window.confirm or window.alert",
    "Implement new destructive variants as primitives"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}