#46 (SLICE-3, accept): Accept all pending proposals in one gesture #51

Merged
benstull merged 1 commits from f12-slice3-accept-all into main 2026-06-13 15:16:19 +00:00
Owner

SLICE-3 — #46 (accept) of the document-edit flow (specs/coauthoring-document-edit-flow.md §7.2, INV-42) — completes the reach→review→accept cluster (#42 + #47 + #46).

A single Accept all gesture applies every pending proposal on the current document through the existing F4 acceptById seam (block proposals take the INV-40 word-precise path automatically), in descending anchor order, skipping orphans (never force-applied) and reporting applied-vs-skipped. Batched application of the existing path — no new accept mechanism; the webview posts intent only (INV-35). No confirmation dialog (undo restores).

Changes

  • proposalController.tsacceptAllProposals(document){applied, skipped} (descending order, orphan-skip); accept/acceptById gain a silent opt so the batch shows one report instead of N per-proposal warnings.
  • trackChangesPreview.tsToolbarMsg += {type:"acceptAll"}; routes to a public acceptAll(document) that batches + reports.
  • extension.ts / package.jsoncowriting.acceptAllProposals command (active doc, markdown-gated palette) for the non-webview path.
  • media/preview.ts + shell — "✓✓ Accept all" toolbar button, posting the intent, shown only with ≥2 pending proposals.
  • trackChangesModel.tsdiffToBlockHunks now emits one block-aligned hunk per changed block even when changed blocks are adjacent (changed blocks are 1:1 anchors; gap-spans only cover add/remove runs) — fixes adjacent changed blocks collapsing into one proposal (caught by the accept-all E2E).

Tests

214 unit + 73/5 host E2E green. New f12Accept E2E: apply-all reconstructs + clears; orphan skip + report; single-proposal path; command registered/gated. MANUAL-SMOKE-F12 §3.

Session 0045. The document-edit-flow cluster is now fully shipped.

🤖 Generated with Claude Code

**SLICE-3 — #46 (accept)** of the document-edit flow (`specs/coauthoring-document-edit-flow.md` §7.2, INV-42) — **completes the reach→review→accept cluster** (#42 + #47 + #46). A single **Accept all** gesture applies every pending proposal on the current document through the existing F4 `acceptById` seam (block proposals take the INV-40 word-precise path automatically), in descending anchor order, **skipping** orphans (never force-applied) and **reporting** applied-vs-skipped. Batched application of the existing path — no new accept mechanism; the webview posts intent only (INV-35). No confirmation dialog (undo restores). ## Changes - **`proposalController.ts`** — `acceptAllProposals(document)` → `{applied, skipped}` (descending order, orphan-skip); `accept`/`acceptById` gain a `silent` opt so the batch shows one report instead of N per-proposal warnings. - **`trackChangesPreview.ts`** — `ToolbarMsg += {type:"acceptAll"}`; routes to a public `acceptAll(document)` that batches + reports. - **`extension.ts` / `package.json`** — `cowriting.acceptAllProposals` command (active doc, markdown-gated palette) for the non-webview path. - **`media/preview.ts` + shell** — "✓✓ Accept all" toolbar button, posting the intent, shown only with **≥2** pending proposals. - **`trackChangesModel.ts`** — `diffToBlockHunks` now emits one block-aligned hunk per changed block **even when changed blocks are adjacent** (changed blocks are 1:1 anchors; gap-spans only cover add/remove runs) — fixes adjacent changed blocks collapsing into one proposal (caught by the accept-all E2E). ## Tests 214 unit + 73/5 host E2E green. New `f12Accept` E2E: apply-all reconstructs + clears; orphan skip + report; single-proposal path; command registered/gated. `MANUAL-SMOKE-F12` §3. Session 0045. **The document-edit-flow cluster is now fully shipped.** 🤖 Generated with [Claude Code](https://claude.com/claude-code)
benstull added 1 commit 2026-06-13 15:16:13 +00:00
Document-edit flow SLICE-3 — completes reach→review→accept
(specs/coauthoring-document-edit-flow.md §7.2, INV-42). A single "Accept all"
gesture applies every pending proposal on the current document through the
existing F4 acceptById seam (block proposals take the INV-40 word-precise path
automatically), in descending anchor order so an earlier accept never invalidates
a later one, skipping (never force-applying) proposals that can't anchor and
reporting applied-vs-skipped. Batched application of the existing accept path — no
new mechanism; the webview posts intent only (INV-35). No confirmation dialog
(undo restores).

- proposalController.ts: acceptAllProposals(document) → {applied, skipped}
  (descending order, orphan-skip); accept/acceptById gain a silent opt so the
  batch suppresses N per-proposal orphan warnings in favour of one report.
- trackChangesPreview.ts: ToolbarMsg += {type:"acceptAll"}; handleWebviewMessage
  routes it to a public acceptAll(document) that batches + reports.
- extension.ts + package.json: cowriting.acceptAllProposals command (active doc,
  markdown-gated palette entry) for the non-webview path.
- media/preview.ts + shellHtml: "✓✓ Accept all" toolbar button, posting the
  intent, shown only with ≥2 pending proposals (authorable, on-state).
- trackChangesModel.ts: diffToBlockHunks now emits one block-aligned hunk per
  CHANGED block even when changed blocks are ADJACENT (treats changed blocks as
  1:1 anchors alongside unchanged ones; gap-spans only cover add/remove runs
  between anchors) — fixes adjacent changed blocks collapsing into one proposal.
- f12Accept host E2E (apply-all reconstructs; orphan skip + report; single
  proposal; command registered/gated); MANUAL-SMOKE-F12 §3.

214 unit + 73/5 host E2E green. Completes the document-edit-flow cluster
(#42 reach + #47 review + #46 accept).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benstull merged commit 83c4a80d8b into main 2026-06-13 15:16:19 +00:00
Sign in to join this conversation.