ui: confirming an alert dialog should close it #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/alert-dialog-action-closes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Confirming an alert dialog ran its action but never dismissed the dialog.
AlertDialogActionwas a plain<Button>— onlyAlertDialogCancelwrapped the primitive'sClose. 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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.