fix(ui): prevent upward scroll jumps across long Markdown messages - #513
Merged
Merged
Conversation
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.
Upward trackpad scrolling could jump almost a viewport when an offscreen long Markdown message entered the chat viewport. A 40px input moved the visible reading anchor by 942px in the regression fixture, including on a local desktop.
Measure cold Markdown blocks in a regular column at the actual parent width, then retain the existing virtualized block list for painting and warm layouts. The previous Infer list measured cold blocks at min-content width before prepaint supplied the real width. This keeps first-layout and visible-layout heights consistent. The existing Markdown renderer owns both paths; the obsolete RootMeasurements wrapper is removed.
The regression test sends pixel scroll events across long-message boundaries at 393px and 1024px widths and checks the screen position of the existing reading anchor after every input. It fails with the original renderer and passes with this change.
Validation:
Local Android compilation could not run because the NDK is absent; the PR Android CI job must pass before merging. Physical-device touch/trackpad input was not separately tested; the regression drives GPUI pixel scroll events.