Scroll-sync the review preview with the source editor #32
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scroll-sync the review preview with the source editor
Summary
Keep the F10 review preview and the source markdown editor scroll-synchronized,
so scrolling one moves the other to the corresponding position.
Problem / pain
The review preview opens beside the source editor (
ViewColumn.Beside), but thetwo panes scroll independently. On a long document the reviewer scrolls the preview
to a change, then has to manually hunt for the same place in the editor to act on
it (or vice-versa). VS Code's built-in markdown preview scroll-syncs by default, so
the absence here reads as a regression from the familiar behavior.
Who feels it
The human coauthor (PP-1) reviewing/editing a long markdown document — the
longer the doc, the more the lost sync costs.
Desired outcome / value
Scrolling the editor moves the preview to the matching content, and scrolling the
preview moves the editor — the two stay aligned so the reviewer never loses their
place crossing between "review on the right" and "write on the left."
Acceptance — "done right"
content (block-level alignment is sufficient — exact pixel parity is not
required).
scroll events).
postMessagebetween hostand webview; no new network or document-mutation surface.
Scope / non-goals
In scope: bidirectional scroll-sync between the F10 preview webview and its
source editor.
Non-goals: cursor/selection sync; editing in the preview; any change to the
render engine or the accept/reject path.
Assumptions · constraints · dependencies
preview already splits the document into blocks with source ranges
(
splitBlocksWithRanges), which can seed the mapping.postMessage, debounced to avoid loops.Source / signal
Self-originated — capture session vscode-cowriting-plugin-0031 (2026-06-12),
from the F10 spec's open-questions list. Spec:
specs/coauthoring-interactive-review.md§1.7 (out of scope for F10) / §9("OPEN → later: preview→source scroll-sync"). Builds on F10
#29.Priority (WSJF)
Provisional: Value low–medium (a quality-of-life parity feature) ·
Time-criticality low · Opportunity low ÷ Size small–medium →
provisional priority/P3. (Decision aid, not auto-scored.)
Decomposition
Single increment (Feature, small–medium). Slice checklist:
onDidChangeTextEditorVisibleRanges, posts target block).Solution notes (optional — NOT a design)
Non-binding: VS Code's built-in markdown preview is the reference behavior; the
block-range data F10 already computes is the natural anchor for the mapping. A
Solution Design should precede implementation if the mapping proves non-trivial.