Skip to content

fix(ui): prevent upward scroll jumps across long Markdown messages - #513

Merged
Tryanks merged 1 commit into
mainfrom
fix/markdown-upward-scroll-jump
Sep 23, 2026
Merged

Tryanks merged 1 commit into
mainfrom
fix/markdown-upward-scroll-jump

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 23, 2026

Copy link
Copy Markdown
Owner

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:

  • cargo fmt --all --check and git diff --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo nextest run --workspace --locked: 933 passed, 5 skipped
  • cargo-machete .: no unused dependencies
  • iOS simulator and Web cargo checks with RUSTFLAGS=-D warnings
  • Native desktop Markdown rendering inspected at wide/narrow widths in light/dark themes using a disposable probe

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.

@Tryanks
Tryanks merged commit 966b645 into main Sep 23, 2026
7 checks passed
@Tryanks
Tryanks deleted the fix/markdown-upward-scroll-jump branch September 23, 2026 07:59
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