Skip to content

Preserve animated slide state during view transitions - #49

Merged
samuel-williams-shopify merged 1 commit into
mainfrom
fix/slide-transition-cleanup
Sep 22, 2026
Merged

samuel-williams-shopify merged 1 commit into
mainfrom
fix/slide-transition-cleanup

Conversation

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor

When advancing between animated slides on /display, disposing the outgoing slide reverts its Anime.js styles before the browser captures the fade snapshot. This briefly exposes the complete, unanimated diagram before the next slide's animation begins. The presenter preview skips view transitions, so it does not show the flash.

Transfer ownership of outgoing slide resources to the replacement rendering, then dispose them inside the view-transition update callback, after capture and before updating the DOM. Superseded renderings still cancel pending updates and transitions immediately. Apply the same handoff to recorded playback while stopping narration immediately.

Validation:

  • npm test: all 31 tests pass, including regressions using real Anime.js scopes for outgoing snapshot state, synchronous replacement, hidden/unsupported transitions, rapid navigation before and after a pending update, and disposal before replacement.
  • bundle exec bake web:packages:check: passes; generated browser assets are updated.
  • JavaScript syntax checks and git diff --check: pass.

Browser visual verification is still pending; the regression tests control the view-transition snapshot/update boundary.

@samuel-williams-shopify
samuel-williams-shopify merged commit 0ebd0fa into main Sep 22, 2026
28 checks passed
@samuel-williams-shopify
samuel-williams-shopify deleted the fix/slide-transition-cleanup branch September 22, 2026 05:22
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.

1 participant