Files
vscode-cowriting-plugin/docs/MANUAL-SMOKE-F12.md
T
Ben Stull 9c3770d26a #42 (SLICE-1, reach): selection-aware Ask-Claude from editor body + tab
Document-edit flow SLICE-1 (specs/coauthoring-document-edit-flow.md §7.2,
INV-38): make "Ask Claude to Edit" reachable from the editor body AND the
editor tab, selection-aware — a selection routes to editSelection, no
selection to editDocument — both gated to markdown/authorable docs, both
flowing through the single runEditAndPropose path (no divergent edit code).

- package.json: add editSelection + editDocument to editor/context (selection-
  aware, markdown + file/untitled) and editor/title/context (selection-aware,
  resourceLangId == markdown). Markdown-gate the existing editor/context
  editSelection entry to match (its command handler is unchanged; the palette
  still reaches any authorable doc — see transcript Deferred decisions).
- trackChangesPreview.ts: cowriting.editDocument accepts the clicked tab's
  resource Uri (editor/title/context), targeting THAT document (opening it if
  needed) and falling back to the active editor when invoked with no arg —
  mirroring showTrackChangesPreview's #41 clicked-doc resolution.
- E2E (test/e2e/suite/f12Reach.test.ts): menu entries present, selection-aware,
  markdown-gated; editDocument(uri) targets the tab doc not the active editor;
  no-arg falls back to the active editor.
- docs/MANUAL-SMOKE-F12.md: SLICE-1 reach smoke steps.

208 unit + 65/5 host E2E green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 07:26:14 -07:00

38 lines
2.1 KiB
Markdown

# Manual smoke — F12 document-edit flow
Covers the document-edit-flow cluster (`specs/coauthoring-document-edit-flow.md`,
#42 · #47 · #46). This file is filled in slice by slice.
## SLICE-1 — #42 (reach): selection-aware Ask-Claude from body + tab (INV-38)
Run the extension (F5) on a markdown document under the sandbox workspace.
1. **Body, with selection (PUC-2).** Select a paragraph, right-click the editor
**body**. Expect **Ask Claude to Edit Selection** in the menu (and **not**
"Edit Document"). Pick it → instruct → submit; a single proposal lands over
the selection (existing F11 behavior, unchanged).
2. **Body, no selection (PUC-1).** Clear the selection (click once), right-click
the editor **body**. Expect **Ask Claude to Edit Document** (and **not** "Edit
Selection"). Pick it → instruct → submit; the whole-document rewrite surfaces
as F4 proposal(s) in the preview.
3. **Tab, with selection (PUC-3).** With a selection active, right-click the
editor **tab**. Expect **Ask Claude to Edit Selection**, acting on that tab's
document.
4. **Tab, no selection (PUC-3).** With no selection, right-click the editor
**tab**. Expect **Ask Claude to Edit Document**, acting on **that tab's**
document — even if a *different* editor is the active one. Open two markdown
tabs A and B, make A active, right-click B's tab → Edit Document → the
proposals land on **B**, not A.
5. **Markdown-gated.** Open a non-markdown file (e.g. `.txt`). Right-click body or
tab: neither **Ask Claude to Edit Selection** nor **Edit Document** appears.
6. **Single edit path.** Both entries route through the same `runEditAndPropose`
path — there is no second edit code path (INV-38). Nothing is written to the
document or sidecar by merely invoking the menu (INV-10/20/35) until you accept.
### Pass criteria
The body and tab menus show exactly one Ask-Claude edit entry, matching the live
selection state (selection → Edit Selection; none → Edit Document); the tab
gesture targets the clicked tab's document, not the active editor; both are absent
on non-markdown docs; no console errors.