Skip to content

fix(ui): keep dialog content through close animation - #4285

Merged
JanPokorny merged 1 commit into
dam-agents:mainfrom
BrUn3y:fix/dialog-close-flash
Oct 7, 2026
Merged

JanPokorny merged 1 commit into
dam-agents:mainfrom
BrUn3y:fix/dialog-close-flash

Conversation

@BrUn3y

@BrUn3y BrUn3y commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Hello, here is my small first contribution to DAM

Summary

  • keep confirm and alert dialog content available while the closing animation runs
  • clear the retained dialog state after the exit animation finishes
  • simplify the exit animation to a short 100 ms fade
  • add a regression test for the dialog close lifecycle

Testing

  • mise run check
  • mise run //packages/ui:check
  • mise run //packages/ui:test — 568 tests passed across 66 files

Closes #4264

@dam-code-guardian dam-code-guardian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Code Guardian 🛡️ — ✅ Code Review @ c01f680

PR #4285: fix(ui): keep dialog content through close animation

Author: BrUn3y | Branch: fix/dialog-close-flash → main | Changes: +60 −17 (5 files)

Summary

The PR keeps the dialog state in the store with open: false until the close animation ends. Then clearClosedDialog removes it, so the content does not flash empty.

Findings

  • ✅ Looks good: A second close is safe. closeDialog returns early when open is false, so the action click plus onOpenChange(false) resolves the promise once. Radix Presence 1.1.10 does not use flushSync, so React still sends onAnimationEnd before the content unmounts.

Documentation Check (doc-drift)

✅ No findings.

Issue Fit

✅ No findings.

TypeScript Engineering Review

✅ No findings.

React UI Engineering Review

  • 🟢 Suggestion: Only the content's animationend event calls clearClosedDialog. If no close animation runs, the store keeps the closed entry until the next dialog opens. The UI stays correct. A close signal that Radix always sends, for example onCloseAutoFocus, removes this dependency on CSS (packages/ui/src/components/ui/confirm-dialog.tsx:64)

Verdict

APPROVE — No blocking finding. The store test covers the new close lifecycle.


Review by Code Guardian 🛡️ · automated code guardian

@JanPokorny
JanPokorny merged commit e06de9d into dam-agents:main Oct 7, 2026
1 check passed
@JanPokorny

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI - A closing dialog flashes different content before it fades out

3 participants