Files
buzz/desktop/tests
morgmart 8290827192 Let cold deep links win the viewport in virtualized timelines
A deep link opened from outside the channel (Home inbox, search, a
notification) mounts the timeline with the target already in the route.
Two things then fought the target jump and won:

- `scrollToMessageImperative` returned `false` after handing the jump to
  the virtualizer, so the cold-mount path read "not in list" and pinned
  to bottom, re-arming durable bottom intent over the jump.
- Even when the target was centered, `virtualizerAtBottomRef` still held
  the channel reset's `true` default. The viewport-resize observer fires
  once on observe and trusted it, re-settling to the floor; Virtua then
  reported "at bottom", the anchor flipped, and every later append
  settled there too.

Make the result explicit — `centered | pending | missing` — and have
every caller branch on the truth: the cold-mount path pins to bottom only
for `missing`, and both retry paths (route target, search match) wait
for `centered` instead of re-querying the DOM themselves. In virtualized
mode the virtualizer is the only scroll writer: its imperative jump keeps
correcting `scrollTop` as rows measure, so a direct `scrollTo` would be
overwritten; the hook reports `centered` only once the row is measured
and settled in view, and records the bottom state it actually observed
so the resize/append settles stop acting on the seeded default.

Adds two cold-navigation e2e tests against `#deep-history` — a target in
unrendered mid-history and the newest message — that fail on the
previous code with exactly the reported symptoms (no scroll; no
highlight) and pass now.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
2026-08-22 20:47:05 -07:00
..