Repository navigation
Description
Problem / motivation
Destructive actions are confirmed three different ways depending on where you happen to be.
A Dialog — audit/[id]/page.tsx wraps the delete button in a Dialog with a title, a description, Cancel, and a destructive confirm button.
A typed confirmation — deleting a brand asks you to type the brand name (settings.deleteConfirmPlaceholder in web/messages/en.json).
The browser's own confirm() — four places:
| File | Action |
|---|---|
agent/page.tsx deleteConversation |
delete a conversation |
reports/page.tsx handleDelete |
delete a report |
settings/api-keys-section.tsx handleRevoke |
revoke an API key |
settings/agent-section.tsx handleClear |
remove the org's Anthropic key |
confirm() is the browser's own modal. It ignores the theme, cannot be styled, cannot mark the destructive choice as destructive, renders as an OS alert on mobile, and blocks the whole tab while it is open. Two of the four also have their prompt text hardcoded in English while the other two use t().
The last two are the ones that sting: revoking an API key breaks every client using it, and clearing the org key cuts the whole team off from the agent. Those deserve better than a grey system box.
Proposed solution
Move all four to the Dialog pattern the audit page already uses. That page is the reference — copy its shape rather than inventing a new one:
DialogTitlenaming the action,DialogDescriptionsaying what it costsDialogClosewithvariant="outline"to cancelDialogClosewithvariant="destructive"to confirm
Notes
agentandreportsdelete a specific row from a list, so the dialog needs to know which one. A single dialog driven by apendingIdpiece of state reads better than one dialog rendered per row — pick whichever you can make clean, but don't render N dialogs if the list can be long.- The existing
t('deleteConfirm')strings already say the right thing; reuse them as theDialogDescription. - The two settings sections have their text inline. While you're there, move those strings into
web/messages/en.jsonalongside the others. - Keep the disabled/pending state the handlers already manage (
deletingId,clearing) so the confirm button can't be double-clicked.
Out of scope
Brand deletion's typed confirmation stays as it is. Typing the name is a deliberately higher bar for a deliberately bigger action.
Alternatives considered
Add an AlertDialog primitive. The usual shadcn split gives destructive confirmations their own component. There isn't one in web/src/components/ui/ today, and adding a primitive is a larger change than this needs — Dialog already does the job on the audit page.
Leave confirm() alone. It does technically confirm. But the app looks like an application everywhere else and like a 1998 browser here, and the two key-related actions are exactly where a user should be able to read carefully before clicking.
Related: #614 covers a delete that has no confirmation at all. Different problem, no overlap.
Activity
BharadwajKanneveti commentedon Aug 20, 2026
@gkhngyk I will pick this issue
gkhngyk commentedon Aug 25, 2026
Assigned to you, @BharadwajKanneveti — thanks for picking it up. The audit page is the reference for the shape; ping here if anything in the issue is unclear.