Repository navigation
fix(scroll): virtual list anchor shifts carry a running glide's target with the offset - #1456
Merged
Merged
Conversation
…t with the offset
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.
Refs #364
Cause
When a virtual list inserts rows above the viewport or measures previously estimated rows above its anchor,
crates/rune/src/runtime/commit/measure.rs(measure_virtuals,window) andcrates/rune/src/runtime/commit/remount.rs(remount_virtuals) shiftScrollState::offsetbyVirtualList::anchor_delta(), but leave a runningScrollMode::Glide { to: GlideTo::Offset(to) | GlideTo::ShrunkEnd(to), .. }target unchanged. On the next framescroll_bottom::glidecontinues gliding toward the unshifted offset and overshoots by the anchor delta.Changes
ScrollState::shift_anchor(delta: f32)incrates/rune/src/runtime/scroll/offset.rsto shiftoffsetand any runningGlideTo::Offset/GlideTo::ShrunkEndtarget together (both clamped>= 0.0), leavingGlideTo::Bottomdynamic againstst.max.st.shift_anchor(..)at the three virtual-list anchor adjustment sites incrates/rune/src/runtime/commit/measure.rsandcrates/rune/src/runtime/commit/remount.rs.virtual_list_prepend_mid_glide_shifts_glide_targetandvirtual_list_measure_above_mid_glide_shifts_glide_targetincrates/rune/src/runtime/tests/scroll_growth.rs.changelog/unreleased/2026-11-23-virtual-glide-anchor.md.Verification
cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid scroll_growth(21 passed), plusruntime::scroll::(80 passed),remount(8 passed),scroll_retarget(5 passed), and integrationscroll_to(9 passed).scripts/file-size.sh: 0 errors.cfgblocks touched); checked on Windows only.