Skip to content

ui: walk back into a landed history page inside the render, not between frames - #507

Merged
Tryanks merged 1 commit into
mainfrom
ui/page-walk-back-survives-pan
Sep 22, 2026
Merged

Tryanks merged 1 commit into
mainfrom
ui/page-walk-back-survives-pan

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • On phones in remote mode, scrolling up sometimes jumped the conversation by up to a screen when a history page landed while the finger was still panning or a fling was ticking.
  • The walk back into the landed page ran in a next-frame callback and gave up (or was overwritten) whenever a pan packet touched the anchor in between. It now runs in the render after the measuring frame as a relative scroll, so intervening packets and the walk both apply.
  • A session reset, a jump to a requested turn and the start of a scrolling screenshot drop a pending walk.

Test plan

  • New regression test pan_packet_after_a_page_lands_keeps_the_walk_back_into_it (fails before: 100px instead of 200px).
  • cargo test -p tcode-ui --lib: 310 passed. Clippy clean, fmt applied.

…en frames

A reader who scrolled into the reservation above the first loaded turn is
anchored at the former first turn when the page lands, and a walk back
restores their pixel position once the page is measured. That walk ran in
a next-frame callback and only when the anchor was untouched. On a phone
the finger is still panning, or a fling is ticking on that same frame, so
a packet either moved the anchor first (the walk was dropped) or resolved
against the painted anchor afterwards (the walk was overwritten). Either
way the conversation jumped up by up to a screen.

The walk now runs in the render after the frame that measured the page.
It is a relative scroll, so packets that arrived in between stay applied,
and the anchor painted after this render already carries it. A session
reset, a jump to a requested turn and the start of a scrolling screenshot
drop a pending walk.

Regression test pans 40px after the landing frame and expects both the
walk back and the pan to apply.
@Tryanks
Tryanks merged commit a2dc6a3 into main Sep 22, 2026
13 of 14 checks passed
@Tryanks
Tryanks deleted the ui/page-walk-back-survives-pan branch September 22, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant