Skip to content

fix(snackbar): make lifecycle dismissal deterministic - #89

Open
Banegasn wants to merge 1 commit into
mainfrom
codex/issue-24-snackbar-lifecycle
Open

fix(snackbar): make lifecycle dismissal deterministic#89
Banegasn wants to merge 1 commit into
mainfrom
codex/issue-24-snackbar-lifecycle

Conversation

@Banegasn

@Banegasn Banegasn commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bind snackbar exit teardown to cancellable animation completion rather than an untracked delay.
  • Restart auto-dismiss on active duration changes, cancel lifecycle work on disconnect, and define exactly-once dismissal reasons.
  • Document reopen/replacement behavior and add deterministic fake-clock/event-driven browser races.

Acceptance mapping

  • Reopening during exit cancels the stale lifecycle and remains open.
  • Disconnect clears the auto-dismiss timer and aborts exit completion listeners.
  • Changing duration while open restarts the full auto-dismiss interval; changes during exit do not alter that dismissal.
  • snackbar-dismiss is emitted once per dismissed lifecycle with timeout, action, programmatic, or replacement detail.
  • open changes after animationend/animationcancel, or immediately when reduced motion removes animation.
  • Browser-matrix race tests use fake timers and dispatched animation events; no arbitrary delays.

Validation

  • pnpm lint
  • pnpm typecheck
  • pnpm test (including Chromium, Firefox, and WebKit)

Fixes #24

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.

[P2] Fix snackbar timer races, dismissal reasons, and lifecycle cleanup

1 participant