feat(f11): SLICE-5 — gateway, non-authorable disabling, docs (#43)

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>
This commit is contained in:
Ben Stull
2026-06-12 13:57:28 -07:00
parent 03b61ed43e
commit 1564ef562b
6 changed files with 178 additions and 6 deletions
+30 -2
View File
@@ -14,8 +14,9 @@ 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), and F10 interactive review — **write left / review
right** (Feature #29).
toggle (Feature #17), F10 interactive review — **write left / review
right** (Feature #29), and F11 — the **preview toolbar as the primary
interaction surface** (Feature #43).
## Architecture
@@ -262,6 +263,33 @@ 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)
The review preview's **header toolbar** becomes the cockpit for the inner loop.
Beside the existing **Annotations** switch it gains two controls:
- **⌖ Pin baseline** — pins the previewed document's review baseline to now and
clears the change-marks (homes the previously-orphaned `pinDiffBaseline`
command, which is reachable from the palette again too).
- **✦ Ask Claude…** — one **adaptive** button. Its label flips on the preview's
selection: **Edit Selection** when text is selected in the rendered preview,
**Edit Document** otherwise. Clicking it opens a host input box for the
instruction (the LLM turn and prompt stay host-side — the sealed webview gains
no LLM/credential surface), then surfaces the result as F4 proposals — **one**
for a selection (mapped back to its source block-union), or **one per changed
hunk** for a whole-document rewrite (`diffToHunks`), each independently ✓/✗-able.
The pure render layer emits `data-src-start`/`data-src-end` on every block in
**both** modes (INV-36); the webview's only mapping duty is walking a selection
to its nearest `data-src` ancestor. Right-clicking a markdown tab → **Open Review
Preview** is the minimal gateway making the surface reachable end to end (#41/#42
expand it). Edit controls are disabled on a non-authorable doc (reading stays
allowed). No new model, no new persistence — pin via the F6 store, edits via the
F4 propose/accept seam with F3 attribution (INV-35..37).
Design: [`docs/superpowers/specs/2026-06-12-f11-preview-toolbar-interaction-surface.md`](docs/superpowers/specs/2026-06-12-f11-preview-toolbar-interaction-surface.md).
Live smoke: [`docs/MANUAL-SMOKE-F11.md`](docs/MANUAL-SMOKE-F11.md).
## Develop
- `npm run watch` — rebuild on change.