fix(web): keep the grid preview pinned to the section it is previewing - #144
Open
TheMaestr-o wants to merge 1 commit into
Open
fix(web): keep the grid preview pinned to the section it is previewing#144TheMaestr-o wants to merge 1 commit into
TheMaestr-o wants to merge 1 commit into
Conversation
TheMaestr-o
force-pushed
the
feat/home-grid-polish
branch
from
August 3, 2026 06:03
a299e60 to
2154f2d
Compare
TheMaestr-o
force-pushed
the
fix/grid-preview-scroll
branch
from
August 3, 2026 06:04
53ce4f3 to
493e7da
Compare
TheMaestr-o
force-pushed
the
feat/home-grid-polish
branch
from
August 3, 2026 06:12
2154f2d to
e25ccdd
Compare
The preview scrolled itself to the grid with a single setTimeout(120), which raced the page it was measuring. At 120ms the globe, the fonts and the card photos are still landing, so the offset it computed was stale a moment later and the frame settled back on the hero — intermittently, and more often on a slow machine, which is what made it look like it worked. It also never ran again. Switching the editor between desktop, tablet and mobile reflows the document to a different height, but the scroll position stayed where the old layout had put it, so the two panes could disagree about what they were showing. The section is pinned on mount and re-pinned on load, on resize and whenever a ResizeObserver sees the document or the section change size, coalesced through one animation frame. Verified 15 runs at normal, 4x and 8x CPU throttling: identical every time, both panes in sync, 97% of the section in frame. Switching desktop -> tablet -> mobile -> desktop re-pins each time (scrollY 558 -> 732 -> 549 -> 558) with the section at the top of the frame in every mode; before, scrollY stayed at 558 throughout.
TheMaestr-o
force-pushed
the
fix/grid-preview-scroll
branch
from
August 3, 2026 06:12
493e7da to
582658a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Keeps the admin's grid preview pinned to the section it is previewing, instead of drifting back to the hero.
Base:
feat/home-grid-polish(#136) — merge that first. No issue of its own.The preview scrolled itself to the grid with a single
setTimeout(120), which raced the page it was measuring. At 120ms the globe, the fonts and the card photos are still landing, so the offset it computed was stale a moment later and the frame settled back on the hero — intermittently, and more often on a slow machine, which is exactly what made it look like it worked.It also never ran again. Switching the editor between desktop, tablet and mobile reflows the document to a different height, but the scroll position stayed where the old layout had put it, so the two panes could disagree about what they were showing.
Fix
The section is pinned on mount and re-pinned on
load, onresize, and whenever aResizeObserversees the document or the section change size — all coalesced through one animation frame.Verification
scrollY558 → 732 → 549 → 558) withsection top = 0in every mode. Before the fixscrollYstayed at 558 throughout.