feat!: sunset the review-panel webview — built-in preview + native diff are the review surfaces (D3/D17, spec §6.10); Keep/Reject lens copy (PUC-2)

Deletes the last bespoke UI surface (TrackChangesPreviewController + its
sealed webview client assets); every entry point re-points at native VS
Code chrome per spec §5: the #41 right-click entries become
cowriting.openReviewPreview (enter coediting if needed -> "Open Preview to
the Side"), Ctrl+Alt+R/Cmd+Alt+R moves to cowriting.reviewChanges (native
diff), and the F12 CodeLens per-proposal titles read "Keep"/"Reject" with
a top-of-file "Keep all (N)"/"Reject all" pair once >=2 proposals are
pending. EditFlow drops its own askClaude/askEditInstruction (the
webview's only caller) and its now-unused constructor params.

Coverage that lived only in the webview's test seams (renderHtmlFor,
receiveMessage, isOpen, ...) moves to direct calls against the surviving
controllers/pure renderReview (test/e2e/suite/helpers.ts gains a shared
renderHtmlFor probe); a genuine gap (pending-proposal + unchanged-block
rendering) is backfilled in test/previewAnnotations.test.ts. README's "how
it works" is rewritten as the native-surface map; the superseded F6/F7/F9/
F10/F11 sections are kept as a marked historical record rather than
deleted outright.

292 unit + 91 E2E green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
BenStullsBets
2026-07-02 14:51:18 -07:00
parent 17fc01e8d8
commit 2170a0d282
23 changed files with 412 additions and 1475 deletions
+89 -8
View File
@@ -14,9 +14,59 @@ catalog (a pure, key-free SDK call) in a notification and the
Features shipped so far: F2 region-anchored threads (Feature #4), F3 live
human/Claude attribution (Feature #6), F4 propose/accept diff flow
(Feature #12), F5 cross-rung sidecar contract (Feature #14), F6 diff-view
toggle (Feature #17), F10 interactive review — **write left / review
right** (Feature #29), and F11 — the **preview toolbar as the primary
interaction surface** (Feature #43).
data layer (Feature #17), and the **native-surfaces migration** (the
"Coediting Markdown with a Machine" Solution Design) — the current UI, replacing
the bespoke F7/F10/F11 review webview with VS Code's own chrome end to end. See
**How it works** below for the current experience; the F7/F9/F10/F11 sections
further down are kept as a **historical record** of the superseded webview (each
now says so up top).
## How it works
There is **no bespoke panel**. Every surface below is native VS Code chrome —
the editor title bar, status bar, Comments gutter, source control, diff editor,
and the built-in Markdown preview:
1. **Enter coediting.** Run **"✦ Coedit this Document with Claude"** (command
palette, editor title menu, or editor/explorer context menu) on a Markdown
document — it captures a **baseline** (a clean checkpoint: git HEAD if the
file is tracked and clean, otherwise a snapshot) to measure future changes
against. Until a document is entered, none of the surfaces below attach to
it. **"Stop editing with Claude"** reverses it.
2. **Title bar + status bar are the everyday entry points.** Once coedited, the
editor title bar carries **Review Changes**, **Ask Claude**, **Toggle
Annotations**, and (in snapshot mode) **Mark Changes as Reviewed**; a
`✦ Coediting · N changes` status-bar item shows the pending-change count and
opens the review when clicked — no need to find the Source Control pane.
3. **Ask Claude is comments-first.** **"Ask Claude"** (editor title, or select
text → right-click → "Ask Claude to Edit") opens a focused comment box on
the native **Comments API** — on your selection, or a top-anchored
whole-document thread with none selected. Claude replies in-thread and
offers an edit; accepting the offer turns it into one or more pending
proposals.
4. **Pending changes live in the buffer.** A proposal is **optimistically
applied** straight into the editor (green/blue insertion tint, a struck
deletion hint) with an inline **`✓ Keep` / `✗ Reject`** CodeLens above each
changed block — and, once ≥2 proposals are pending, a top-of-file
**`✓ Keep all (N)` / `✗ Reject all`** pair. Nothing is force-applied: a
proposal whose target text changed underneath it is skipped, never guessed.
5. **Native diff answers "what changed?"** **Review Changes** (editor title, or
`Ctrl+Alt+R` / `Cmd+Alt+R`) opens VS Code's own diff editor — baseline on the
left, your live document on the right — with the platform's inline/side-by-side
toggle, navigation, and accessibility for free. A Source Control gutter/viewlet
entry (quick-diff change bars, "Open Changes") is a bonus home for git users,
never the required path.
6. **The built-in Markdown preview is the annotated read.** "Open Preview to the
Side" (or right-click a markdown file/tab → **"Open Cowriting Review
Preview"**, `cowriting.openReviewPreview`) renders the document with
authorship/change coloring **inside VS Code's own preview** — green = human,
blue = Claude, strikethrough = deleted — toggled by **Toggle Annotations**
(command or the title-bar eye icon). No separate webview, no separate
persistence.
Design: `vscode-cowriting-plugin-content/specs/coauthoring-native-surfaces.md`
(§5 UX Layout is the canonical source for this map). Migration plan:
[`docs/superpowers/plans/2026-07-01-native-surfaces-migration.md`](docs/superpowers/plans/2026-07-01-native-surfaces-migration.md).
## Architecture
@@ -134,7 +184,16 @@ record per the contract; git push/pull is the transport, no re-homing ever.
Design: `vscode-cowriting-plugin-content/specs/coauthoring-cross-rung-format.md`.
## F6 — Diff-view toggle (Feature #17, #19)
## F6 — Diff-view toggle (Feature #17, #19) — SUPERSEDED
> **Superseded.** The two-pane `Ctrl+Alt+D` toggle this section describes was
> deleted in #34; only the baseline **data layer** survived, now serving the
> native diff editor (`Ctrl+Alt+R` / "Review Changes" — How it works §5) and the
> built-in preview annotations (§6). The native-surfaces migration's Task 2
> additionally **retired INV-18** (machine-landing auto-advance): a landed
> Claude edit stays a visible change until "Mark Changes as Reviewed" (the
> renamed "Pin Diff Baseline to Now"), it no longer auto-clears. Kept below as a
> historical record.
**`Ctrl+Alt+D`** (the same chord on macOS — not `Cmd`; or **Cowriting: Toggle
Diff View**) flips the focused document into a native `vscode.diff` against a
@@ -166,7 +225,12 @@ instead of git archaeology.
Design: `vscode-cowriting-plugin-content/specs/coauthoring-diff-view.md`.
Live smoke: [`docs/MANUAL-SMOKE-F6.md`](docs/MANUAL-SMOKE-F6.md).
## F7 — Rendered track-changes preview (Feature #21)
## F7 — Rendered track-changes preview (Feature #21) — SUPERSEDED
> **Superseded (Task 8, native-surfaces migration).** The bespoke webview this
> section describes was deleted; its authorship/change coloring lives on
> **inside VS Code's own built-in Markdown preview** — see **How it works** §6
> above. Kept below as a historical record of the pre-migration design.
**`Ctrl+Alt+R`** (or **Cowriting: Open Track-Changes Preview**) opens a
read-only webview **beside** a **Markdown** editor that renders the document and
@@ -198,7 +262,12 @@ the manual smoke, not the sealed-sandbox E2E.
Design: `vscode-cowriting-plugin-content/specs/coauthoring-rendered-preview.md`.
Live smoke: [`docs/MANUAL-SMOKE-F7.md`](docs/MANUAL-SMOKE-F7.md).
## F9 — Authorship view in the preview (Feature ~#27)
## F9 — Authorship view in the preview (Feature ~#27) — SUPERSEDED
> **Superseded (Task 8, native-surfaces migration).** The F7 webview this mode
> lived in was deleted; the built-in preview's annotations (How it works §6)
> always show authorship + change coloring together — there is no separate
> mode toggle. Kept below as a historical record.
The rendered preview (F7) gains a second mode, switched by a `[ Track changes |
Authorship ]` toggle in its header. **Authorship** mode re-renders the current
@@ -239,7 +308,13 @@ a plain PR revert with zero data migration.
Design: `vscode-cowriting-plugin-content/specs/coauthoring-out-of-workspace.md`.
Live smoke: [`docs/MANUAL-SMOKE-F8.md`](docs/MANUAL-SMOKE-F8.md).
## F10 — Interactive review: write left / review right (Feature #29)
## F10 — Interactive review: write left / review right (Feature #29) — SUPERSEDED
> **Superseded (Task 8, native-surfaces migration).** The editor is no longer
> "zero-annotation" — pending proposals now render optimistically applied
> in-buffer with `✓ Keep`/`✗ Reject` CodeLens (F12), and review happens across
> the native diff editor + built-in preview, not one dedicated webview. See
> **How it works** above. Kept below as a historical record.
A clean, **zero-annotation editor** on the left; the rendered preview on the
right as the **single interactive review surface**. The editor carries no
@@ -266,7 +341,13 @@ they are no longer separate user surfaces.
Design: `vscode-cowriting-plugin-content/specs/coauthoring-interactive-review.md`.
Live smoke: [`docs/MANUAL-SMOKE-F10.md`](docs/MANUAL-SMOKE-F10.md).
## F11 — Preview toolbar as the primary interaction surface (Feature #43)
## F11 — Preview toolbar as the primary interaction surface (Feature #43) — SUPERSEDED
> **Superseded (Task 8, native-surfaces migration).** The webview toolbar this
> section describes was deleted; its two controls moved to native chrome —
> **Pin baseline** is now **"Mark Changes as Reviewed"** in the editor title
> bar, and **Ask Claude** is the comments-first ask (How it works §3). Kept
> below as a historical record.
The review preview's **header toolbar** becomes the cockpit for the inner loop.
Beside the existing **Annotations** switch it gains two controls: