Undo in the editor renders wrong marks in the F10 review preview #38
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?
Undo in the editor renders wrong marks in the F10 review preview
Summary
After pressing undo (Ctrl+Z) in the source editor, the F10 rendered review
preview updates its text but shows incorrect annotations — change-marks,
author-coloring, and/or proposal markup that no longer match the reverted buffer.
Problem / pain
The preview pane re-renders on undo (undo is a document change, so the debounced
onDidChangeTextDocumentrefresh fires and the text content updates), but themarks are wrong after the reversal: author-colored spans (
cw-by-human/cw-by-claude), the since-baseline diff, and/or pending-proposal blocks render inthe wrong place or with the wrong content for the post-undo buffer. The text is
right; the overlay that makes the preview a review surface is not. It reproduces
every time on undo in the F10 review preview.
Who feels it
The human coauthor (PP-1) reviewing changes in the preview. Undo is a routine
editing gesture mid-review; when it leaves the marks wrong, the review surface is
actively misleading about what changed and who authored it — the exact thing F10
exists to show truthfully.
Desired outcome / value
After an undo, the preview's marks match the reverted buffer exactly — the
since-baseline diff, author-coloring, and proposal placement are all correct, just
as they are after a normal forward edit. Undo is just another document change; the
review surface stays trustworthy across it.
Acceptance — "done right"
correct state for the reverted buffer (no stale/ghost diff, no mis-placed
author-coloring, no orphaned/mis-anchored proposal block).
at each step (not just the text).
corrected marks.
Scope / non-goals
In scope: the F10 review preview's marks (diff / author-coloring / proposals)
staying correct across undo (and redo) of editor changes.
Non-goals: changing the visual language of the marks; the baseline-advance
semantics (INV-18); behavior unrelated to undo/redo.
Assumptions · constraints · dependencies
(
trackChangesPreview.tsonEdit→ debouncedrefresh). The render engine(
renderReview) is pure; the wrongness is most likely in the data the refreshfeeds it after an undo (F3 attribution spans and/or F4 proposal anchors not
tracking the reversal), not in the renderer.
doesn't reconcile its offsets on undo.
Source / signal
Self-originated — capture session vscode-cowriting-plugin-0033 (2026-06-12),
from a direct operator observation while using the F10 review preview. Symptom
confirmed in-session: "updates but wrong marks," F10 review preview, reproduces
always. Relates to F10
#29, F3#6, F4#12.Priority (WSJF)
Value medium (correctness/trust of the primary review surface; wrong marks
mislead the reviewer) · Time-criticality medium (defect in the just-shipped F10
surface, hit by a routine gesture) · Opportunity low ÷ Size small →
priority/P1 (operator decision, session 0033: undo-during-review is a common
gesture, so a misleading review surface warrants P1). Decision aid, not
auto-scored.
Decomposition
Bug (single corrective increment). Fix checklist:
can be driven directly; host E2E for the editor undo → preview path).
anchors) and reconcile it on the reverting change.
green.
Solution notes (optional — NOT a design)
Non-binding: VS Code delivers undo as an
onDidChangeTextDocumentwithreason === TextDocumentChangeReason.Undo(redo =.Redo). The preview'sonEditlikely treats it as a normal edit; the suspicion is that the attribution
tracker (F3) or proposal anchoring (F4) does not correctly reverse/re-anchor
its offsets for an undo, so
renderReviewis handed stale spans/anchors. Worthchecking whether attribution records an undo as a new (mis-attributed) edit
rather than reverting prior spans. Verify before designing a fix.