ui: walk back into a landed history page inside the render, not between frames - #507
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
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.