mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
The reading anchor saved its offset in viewport space at the last scroll
event, but the older-history page commits on the deferred snapshot a few
frames later. Momentum scrolling in between made the prepend re-pin
scrollBy() back to a stale offset — snapping the reading row down by the
distance scrolled during the gap, once per ~50-message page boundary
("intermittent stutter down while scrolling up").
Save the anchor in content space instead (row top relative to the scrolled
content element, rect-to-rect): scroll-invariant by construction, so the
measured drift is exactly the layout growth above the row and the
compensation never rewinds a live fling. Keep a viewport-space reading only
to detect when native scroll anchoring already held the row, so the JS
re-pin cannot double-apply the same prepend.
Verified with a mid-fling-prepend probe (fling through real windowed
pagination, per-frame anchor sampling): before, every mid-fling prepend
jerked the anchor row down 17–20px on both engines; after, chromium 0
jerks, webkit residuals only from content-visibility realization (0 when
composed with eagerTimelineLayout, #1678).
Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
Buzz
Desktop chat shell with:
- Tauri + React + TypeScript + Vite
- Tailwind CSS
- shadcn/ui-ready shared components
- Biome (lint/format/check)
- Feature-driven frontend structure
Scripts
pnpm dev- run the web frontendpnpm tauri dev- run the desktop apppnpm build- typecheck and build frontendpnpm typecheck- TypeScript checkspnpm lint- Biome lintpnpm format- Biome format (write)pnpm check- Biome check
Structure
src/shared- reusable app-wide code (ui,lib,styles)src/features- feature modules (vertical slices)src/app- top-level app composition