Repository navigation
fix(preview): isolate scroll state per document - #251
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What changed
Why
The main Preview uses one DOM scroll container for every document. The render pipeline captured that container's current raw scroll position and restored it after every commit, including commits for a different document. Tabs stored editor scroll state but had no document-owned main Preview state, so switching A → B restored A's pixels into B and switching back restored B's pixels into A.
Issue: #247
How it was tested
npm run check:static— passed; web and prepared desktop resources match.npm test) — 167/168 passed; one unrelated alert-modal focus assertion was intermittent under suite load and passed both its isolated rerun and the final concurrent focused rerun.Documentation
No user-facing documentation changes are required; this restores the intended per-document Preview behavior.