Files
buzz/desktop/tests
Meli c9a26d31f2 fix(desktop): bound the older-page settle hold and stop page cascades
Scrollback paging felt slow even with a fast relay because a fetched page
could sit unpainted for seconds, and one gesture often pulled several pages.

useSettleGatedPrependMessages held a landed page on ANY wheel/scroll input
with a 4s deadline, and assumed motion at hold start — so even a scroller at
rest paid a full quiet window, and a reader keeping fingers on the trackpad
waited seconds for a 450ms page. Track motion for the scroller's whole life
(lastMotionTsRef) so an at-rest hold admits after the stable-frame count,
and cut SETTLE_HOLD_DEADLINE_MS to 1500: trackpad momentum — the only phase
with the dropped-write hazard — decays well inside that bound. Retiring the
hold directly on wheel was tried and rejected: it drifted the anchor ~30px
under live input.

loadOlderViaVirtualizer refused to re-fire only while isFetchingOlder or
the settle hold was set. Between the fetch resolving and the prepend
committing, WebKit's scroll events at the boundary started the next page,
cascading one gesture into many. Add isRenderedTimelineBehindHistoryPrepend
to the refuse predicate — the same signal the spinner already uses.

Tests (each fails on the previous code):
- useSettleGatedPrependMessages.test.mjs: at-rest hold admits without a
  charged quiet window; motion before the hold still charges it.
- virtualization 09: commit under 60 wheel bursts is bounded
  (gapSinceInput < 80ms, sinceSpinner < deadline+slack) and the anchor
  holds within 5px at commit.
- scroll-history "one gesture pages once": emulate WebKit's at-rest scroll
  events and tighten the ceiling from <=4 pages to <=1.

Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
2026-08-22 19:31:14 -04:00
..