Review pane behavior on document switch #57
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?
Review pane behavior on document switch
Summary
Deliberately decide — and implement — what happens to the review pane when the
active editor switches documents: the fate of the outgoing document's review
pane, and whether the switched-to document gets a review experience at all.
Problem / pain
The review panel's behavior on document switch is incidental, not designed.
The panel is one-per-document, keyed by URI (
src/trackChangesPreview.ts:45),and the controller registers no
onDidChangeActiveTextEditorlistener. Sotoday, when you switch the active editor to a different document:
follow you), and
explicitly re-invoke
cowriting.showTrackChangesPreviewon it.That landing was never a decision — it's just where the absence of a listener
left things. As the review pane becomes the primary interaction surface (F11,
#43), this navigation gap becomes user-visible friction: open a review pane,
click into another markdown file to compare or copy something, and the pane is
now silently showing the wrong document — or you have two panes and no clear
rule for which is "live." There is no defined, predictable model for how the
review experience tracks the document you're actually looking at.
Who feels it
The coauthor (the human writer using the plugin) — anyone working across
more than one markdown document in a session, navigating between files while a
review pane is open.
Desired outcome / value
A predictable, deliberate rule for how the review experience relates to the
active document, so that switching documents never leaves the writer looking at
a review pane for the wrong file or wondering whether the new file is "covered."
The review surface behaves coherently as the writer navigates a multi-document
workspace.
Acceptance — "done right"
relevant spec / design), not an accident of which listeners happen to exist.
switch away from (stays pinned / detaches / closes / retargets).
review experience (auto-open the pane and/or auto-establish review state)
or stays inert until the user explicitly asks.
(right-click menu #41, toolbar #43, command/keybinding) and across authorable
vs. non-authorable / non-markdown documents.
defined (e.g. the review pane does not try to review a file it cannot review).
to doc B, assert the defined outcome for both A's pane and B).
Scope / non-goals
In scope: the lifecycle/targeting rule for the review pane (the
TrackChangesPreviewController) as the active editor changes between documents,and whether/how review state is established for the newly-active document.
Non-goals:
— this is about which document the pane targets and when a review exists,
not the rendering.
split/grid features).
Assumptions · constraints · dependencies
Map<uriString, WebviewPanel>,src/trackChangesPreview.ts:45); whatever rule is chosen must reconcile withthat (e.g. "follow active editor" may imply collapsing toward a single live
pane, or revealing the per-doc pane).
auto-creates on demand when a pane is shown for a doc
(
diffViewController.tsensureBaseline,proposalController.tsper-docstate) — an "auto-review on switch" option leans on that; a "do nothing"
option must avoid creating state for files the user never asked to review.
isAuthorable)must be handled explicitly.
(preview toolbar as primary surface), #32 (scroll-sync). This sharpens the
same surface those touch.
Source / signal
Self-originated — capture session vscode-cowriting-plugin-0050
(2026-06-13). Dev observation while working the review-panel surface: "When
changing documents, we should decide what happens to the review pane of the
current document, and if the document switched to should get a review experience
or not." Current behavior confirmed by reading
src/trackChangesPreview.ts(noonDidChangeActiveTextEditorlistener; panelstays pinned).
Priority (WSJF)
Provisional: Value 5 · Time-criticality 3 · Opportunity-enablement 3 ÷ Size 3 =
~3.7.
priority/P2— real navigation friction and a visible incoherence as thepane becomes primary, but not blocking the inner-loop triad; worth doing once
the decision is made.
Decomposition
Feature → design-then-build slices (one increment):
experience) in a short design, with the option set below evaluated.
TrackChangesPreviewControllerper the decision.Solution notes (optional — NOT a design)
Non-binding option space for the design to choose among:
Outgoing pane on switch away:
stale/confusing.
Incoming (switched-to) document:
doc B automatically (leans on existing on-demand state creation).
mode" is implicitly on once you've opened one), inert otherwise.
A likely-coherent default to test against: a single "live" review pane that
follows the active markdown editor once opened, leaving non-markdown docs
untouched and not fabricating review state for files the user never opened a
pane on — but this is for the design to settle, not pre-decided here.