Skip to content

fix(web): preserve retained reading position across virtual prepends - #250

Merged
tiensonqin merged 2 commits into
mainfrom
logseq/virtual-prepend-anchor-X6p3Nv
Oct 19, 2026
Merged

tiensonqin merged 2 commits into
mainfrom
logseq/virtual-prepend-anchor-X6p3Nv

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Prepending mixed-height rows can lose the reader because total scroll-height changes include unrelated offscreen geometry. Preserve the first intersecting retained row and its measured viewport offset, materialize it through the virtualizer, and cancel on subsequent collection changes, user input, explicit scroll requests, reparenting or disposal. The helper has an explicit interface and no timer or synthetic input path.

Validation: two real-browser failures before implementation, then all three prepend cases pass in Chromium, Firefox and WebKit. All 20 related Chromium cases pass. The real Mapre consumer removes duplicate height compensation and passes 102 related browser cases. Melange/install builds and the new helper's AST64 check pass.

The first CI run passes six jobs and 135/136 browser cases; its unchanged virtual-tree focus test exposes a real reparenting regression. The correction cancels the old container's reading position when its retained parent changes. The unchanged assertion and all 18 focused upstream cases now pass, as do 44 affected Mapre cases after a fresh installed-package build. New exact-head CI is required; the original failure is preserved.

No Dune declarations, warning settings or vendored code changed. Repository-wide decision validation still reports two pre-existing legacy document paths; whole-repository @fmt reports pre-existing Dune formatting/configuration issues. New modules are explicitly formatted. Mapre release remains gated on this PR's CI and merge.

@tiensonqin
tiensonqin merged commit dc43d44 into main Oct 19, 2026
8 checks passed
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