Files
buzz/desktop/tests
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger 04b7a59356 test(timeline): drive scroll-preservation off real wheel + genuine prepend
The 'preserves user scroll while older channel history loads' e2e test
drove pagination with a synthetic scrollTop teleport plus a
dispatchEvent('scroll'), which mutates geometry a virtualizer can
re-assert and never reflects real input.

Seeding general with a small prepend was a dead end: the cold load
(CHANNEL_HISTORY_LIMIT=300) drains a sub-300 store in one shot, so the
wheel-driven fetchOlder returns only already-cached events that dedup to
zero net growth. The anchor then has no real prepend to hold and the
assertion measures virtualizer re-measure, not scroll preservation --
and __HISTORY_INFLIGHT__ fires on the request gate regardless of whether
new events come back, so it cannot prove a genuine page landed.

Target the deep-history channel (600 > 300) so a real older page sits
behind the until cursor. Its store is pre-seeded with monotonic
createdAt, so the test no longer needs its own timestamped emit loop to
avoid the same-second-collision flake. Two phases reconcile the standing
tension that the in-flight delay needed to observe drift is the same
thing that stalls the climb to the top sentinel: walk into mid-history
with no delay (each instant page advances the oldest row so the next
wheel re-enters a fresh sentinel), then enable historyDelayMs and fire
one delayed genuine page. The poll gates on a NEW older index landing
(not the inflight counter, not bare row count) AND <=2px drift of a
first-visible row captured while that page is in flight -- so a pass
proves the restore held a genuine prepend, not a re-measure.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-23 04:54:56 -04:00
..