The settle window I added for rotation also ran for every `resize`, and on a phone the URL bar collapsing during a fast flick is exactly that. It re-asserted an anchor captured before the flick, so a scrollTo landed mid-momentum and stopped the scroll dead. Only a width change (or an orientationchange) can move a card: positions are absolute pixels in the grid's own space, so a height-only resize leaves both the layout and the scroll position correct and needs no restore at all. The one exception kept is a scrollbar appearing on desktop, which changes the grid's inner width while window.innerWidth stays put -- that re-packs, but only when the columns actually moved. Modelled the failure in headless Chrome (height change mid-flick, scroll continuing): the flick was yanked back 173px before, and now runs on to where it was headed. Rotation still re-anchors, and a fast scroll with 80 videos loaded holds 60fps (median 16.7ms/frame, max 17.2ms, no frame over 32ms). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QBDkEXP4htyXTCZUwMLphd
61 KiB
61 KiB