mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 14:16:28 +03:00
When HMR misses and we fall back to window.location.reload(), the native scroll restoration landed the page somewhere near the right region but not on the selected element, because layout had shifted between the save and the reload. Capture the element's getBoundingClientRect().top into the session snapshot, disable native scroll restoration on resume, and manually scroll the element back to that exact viewport-relative position. Run a second correction pass after fonts and images settle to absorb late layout shifts without animating the fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>