ui: confirming an alert dialog should close it #1

Open
jules wants to merge 1 commits from fix/alert-dialog-action-closes into main
Owner

Confirming an alert dialog ran its action but never dismissed the dialog.

AlertDialogAction was a plain <Button> — only AlertDialogCancel wrapped the primitive's Close. Every call site already assumed confirming would close it.

Found in Trippy, where "Clear conversation" cleared the chat and left the modal sitting on screen. The same component is in every Crema app, so this is a sweep.

Delete-style dialogs hide the bug by accident — the row they delete unmounts out from under the open dialog and takes it with it. Any confirm whose target stays on screen (a rewrite, a regenerate, a clear) simply gets stuck.

Fixed at the component, so all call sites get it. The action still runs: Base UI merges its own close handler with the caller's onClick, so async work carries on behind the closed dialog and reports via toast as before.

Where the repo has a test setup, a regression test asserts both halves (it closes AND the action fires). It fails against the old component — verified.

🤖 Generated with Claude Code

Confirming an alert dialog ran its action but never dismissed the dialog. `AlertDialogAction` was a plain `<Button>` — only `AlertDialogCancel` wrapped the primitive's `Close`. Every call site already assumed confirming would close it. **Found in Trippy**, where "Clear conversation" cleared the chat and left the modal sitting on screen. The same component is in every Crema app, so this is a sweep. Delete-style dialogs hide the bug by accident — the row they delete unmounts out from under the open dialog and takes it with it. Any confirm whose target stays on screen (a rewrite, a regenerate, a clear) simply gets stuck. Fixed at the component, so all call sites get it. The action still runs: Base UI merges its own close handler with the caller's `onClick`, so async work carries on behind the closed dialog and reports via toast as before. Where the repo has a test setup, a regression test asserts both halves (it closes AND the action fires). It fails against the old component — verified. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jules added 1 commit 2026-07-14 05:00:13 +00:00
AlertDialogAction was a plain <Button> — only AlertDialogCancel wrapped the
primitive's Close — so confirming ran the action but never dismissed the
dialog. Found in Trippy, where "Clear conversation" cleared the chat and left
the modal sitting on screen; the same component is in every Crema app.

Delete-style dialogs hide it by accident: the row they act on unmounts out from
under the open dialog and takes it with it. Any confirm that leaves its target
on screen (a rewrite, a regenerate, a clear) just gets stuck.

Fixed at the component, so every call site gets it. The action still runs —
Base UI merges its own close handler with the caller's onClick — and async work
carries on behind the closed dialog.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/alert-dialog-action-closes:fix/alert-dialog-action-closes
git checkout fix/alert-dialog-action-closes
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CremaUIStudio/crema-app-aifirst-template#1
No description provided.