Skip to content

fix(preview): isolate scroll state per document - #251

Merged
ThisIs-Developer merged 1 commit into
mainfrom
fix/issue-247-preview-scroll-state
Aug 28, 2026
Merged

ThisIs-Developer merged 1 commit into
mainfrom
fix/issue-247-preview-scroll-state

Conversation

@ThisIs-Developer

Copy link
Copy Markdown
Owner

What changed

  • Store main Preview scroll coordinates on each stable document/tab object.
  • Save the outgoing rendered document's Preview position before the shared Preview DOM is replaced.
  • Restore the incoming document's own position after its Preview commit, clamped to the rendered range and guarded by render/document identity.
  • Prevent pending editor/Preview synchronization work and stale Preview scroll events from crossing a document activation boundary.
  • Preserve Preview coordinates through Live Share tab snapshots.
  • Regenerate the tracked Neutralino desktop resource from the root web source.
  • Add Playwright coverage for two documents with Sync on/off, three documents, repeated switching, tab reordering, view-mode transitions, new documents, closing/reopening, and Explorer activation.

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.
  • Focused issue regressions — 4/4 passed.
  • Full tab/Preview/Split/Files spec — 17/17 passed.
  • Editor, Files sidebar, smoke, and rich-renderer group — 37/37 passed.
  • Final focused Split + issue regressions + unrelated flake rerun — 6/6 passed.
  • Full Chromium suite (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.
  • Standalone browser reproduction with Sync enabled and disabled — A and B restored their own raw pixel positions with no leakage.
  • Workspace reload probe — A restored 1811 → 1811 px and B restored 2824 → 2824 px.

Documentation

No user-facing documentation changes are required; this restores the intended per-document Preview behavior.

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview Aug 28, 2026 2:22pm

@ThisIs-Developer
ThisIs-Developer merged commit 9409384 into main Aug 28, 2026
5 checks passed
@ThisIs-Developer
ThisIs-Developer deleted the fix/issue-247-preview-scroll-state branch August 28, 2026 14:28
@ThisIs-Developer ThisIs-Developer added the bug Something is broken or not working as expected. label Oct 2, 2026 — with ChatGPT Codex Connector

This branch was successfully deployed

1 active deployment
Preview — 1104da0b Deployed Aug 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken or not working as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant