shredbx logo
shredbx shredbx shredbx shredbx Personal
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
AClaude
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
Andrei Solovev
Knowledge
Search knowledge... ⌘K
Knowledge · Guidelines · sveltekit

View Transition Navigation

Manage video playback, DOM observation, and navigation state during SvelteKit client-side View Transitions

Andrei Solovev

Metadata

sveltekit sveltekit

Description

SvelteKit uses the View Transitions API (document.startViewTransition + onNavigate) for client-side page transitions. During the ~250ms snapshot+animate phase, the browser freezes rendering and silently drops or defers certain DOM operations: - video.play() is silently rejected (no error thrown, promise resolves but playback never starts) - document.getElementById() may return null for elements that exist in the new DOM but aren't yet mounted in the live document tree - IntersectionObserver entries report stale intersection ratios from the pre-transition DOM - Scroll position may not reflect the new page state This guideline defines the patterns every component must follow when interacting with these APIs during client-side navigation. Established from PR #326 (v0.15.9) — VideoStream safePlay() and ContentSidebar deferred scroll-spy.

Rules

  • VTN-1 — Never call video.play() directly — always use the safePlay() retry pattern
  • VTN-2 — DOM element lookups in $effect must use deferred resolution with retry
  • VTN-3 — Use 350ms as the standard retry delay for View Transition recovery
  • VTN-4 — All cleanup functions in $effect must clear retry timers AND disconnect observers
  • VTN-5 — Navigation active state (sidebar, footer, navbar) must derive from SvelteKit stores, not DOM state
  • VTN-6 — HLS video components must handle re-initialization on client-side navigation
  • VTN-7 — Footer and navbar active link state must use the same isPathMatch() logic as ContentSidebar
shredbx logo shredbx shredbx shredbx shredbx Andrei Solovev

Solution Architect & Lead Software Engineer

ExperiencePortfolioResearch & ExperimentsEducationCertificationSkills
GitHub ↗LinkedIn ↗Email ↗
AVAILABLE FOR NEW PROJECTS
// MY LATEST BEATS
Hobby & Interests

Lab

  • The Lab
  • Framework
  • Components
  • Packages
  • Games
  • Process (SDLC)
  • Knowledge
  • Blog

Andrei

  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
  • Lifestyle

Team

  • Team
  • Andrei
  • Claude

Legal

  • Privacy
  • Terms
  • Cookies
© 2026 shredbx.com. All rights reserved. — Andrei Solovev |