Closes the F11 feature: makes the toolbar surface reachable end to end and guards the edit controls. Per spec §6.4/§6.5/§7.2 SLICE-5. - package.json: cowriting.showTrackChangesPreview added to editor/title (when: editorLangId == markdown) — the minimal right-click → Open Review Preview gateway (#41/#42 expand it later). - trackChangesPreview: the gateway command accepts the tab's resource Uri (palette/keybinding still fall back to the active editor); refresh() sends an `authorable` flag on both render messages; `editControlsEnabled` test seam. - webview: disable Pin + Ask-Claude on a non-authorable doc (Annotations stays active — reading is always allowed); RenderMessage.authorable. - host E2E: the editor/title gateway opens the preview + is markdown-guarded; edit controls disabled on a non-authorable (read-only-scheme) markdown doc. - docs: docs/MANUAL-SMOKE-F11.md (live smoke, 10 steps) + README F11 section + intro line. 205 unit + 53 host E2E green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4.1 KiB
Manual smoke — F11 preview toolbar as the primary interaction surface (#43)
F11 makes the rendered preview's header toolbar the primary interaction surface: beside the existing Annotations switch it gains a Pin baseline button and a single adaptive Ask-Claude button (Edit Selection when text is selected in the preview, Edit Document otherwise). The webview's visual behavior — the buttons, the live label flip, and the selection→source mapping — is verified here, not in the automated host E2E (the webview is a sealed sandbox; the host's message→seam wiring is covered by the F11 E2E suite). Run once per change that touches F11. Live turns hit the SDK; use a trivial instruction to keep them quick.
Setup
npm run build- Launch the Extension Development Host (F5 in VS Code, or the Run panel) with
sandbox/open. - Open a markdown document with a few paragraphs (e.g. copy
test/e2e/fixtures/workspace/docs/preview.md).
Steps
- Right-click gateway (PUC-6). Right-click the markdown editor tab (or
use the editor title bar) → "Cowriting: Open Review Preview". The preview
opens beside the editor. (The palette entry and
Ctrl+Alt+Rstill work too.) - Three header controls (PUC-1). The header row shows, left to right: the ☑ Annotations checkbox (on), a ⌖ Pin baseline button, and a ✦ Ask Claude to Edit Document button. They restyle with the theme.
- Adaptive label — selection (PUC-2). Select a paragraph in the preview (drag across rendered text). The Ask-Claude button label flips live to "✦ Ask Claude to Edit Selection". Click elsewhere to clear the selection → it flips back to "✦ Ask Claude to Edit Document".
- Edit Selection (PUC-3). With a paragraph selected in the preview, click
Ask Claude to Edit Selection → a host input box appears → type an
instruction (e.g. "tighten this") → submit. A blue
cw-proposalblock appears inline at that paragraph with ✓ / ✗ (the selection mapped back to its source block; the edit ran host-side). The editor does not change (INV-10). Accept with ✓: the replacement lands; the block clears. - Edit Document (PUC-4). Clear the selection (button reads "Edit Document"). Click it → instruct (e.g. "fix any typos and tighten") → submit. Claude's whole-document rewrite surfaces as one or more independent blue proposal blocks (one per changed hunk), each independently ✓ / ✗-able. Accept some, reject others — each behaves as an ordinary F10 proposal.
- Pin baseline (PUC-5). Make (or accept) a few changes so the preview shows
change-marks and a non-zero summary. Click ⌖ Pin baseline. Expect: the
change-marks clear, the summary resets to
+0 −0, and the header epoch readspinned <time>. "What changed" now counts from this moment. - Off-state still maps (INV-36). Toggle Annotations off (clean preview). Selecting a paragraph still flips the button to Edit Selection and an edit still works — the off/clean preview is also a selection→source surface.
- Non-authorable doc (PUC-1/7). Open a markdown doc from a read-only/virtual source (e.g. a Git diff view, or an Output channel rendered as markdown) and open the preview. Expect: Pin baseline and Ask-Claude render disabled; the Annotations toggle stays active (reading is allowed).
- Theme. Toggle light / dark / high-contrast (
Ctrl+K Ctrl+T). The two toolbar buttons (enabled, hover, disabled states) restyle and stay legible. - Cleanliness.
git statusshows nothing written to the document, sidecar, or repo by the toolbar gestures except the edits you explicitly accepted (INV-20/35).
Pass criteria
All ten steps behave as described; the adaptive label tracks the live selection; the selection-scoped edit anchors at the right paragraph; the document edit produces per-hunk proposals; pin clears the marks; edit controls are inert on a non-authorable doc; no console errors in the webview devtools; nothing is persisted by the toolbar beyond the edits you accepted.