Commit Graph

332 Commits

Author SHA1 Message Date
BenStullsBets 705de3169b feat: re-emit changed mermaid diagrams through mermaidDiff in the built-in preview (plan T7 §2.6, INV-29 parity)
Task 7 scoped out reusing the F7.1 (#22) intra-diagram mermaid diff in the
built-in Markdown preview's mermaid fence rendering; Task 8 then deleted the
webview that still had it, leaving mermaidDiff.ts/mermaidFlowchartDiff.ts/
mermaidSequenceDiff.ts production-dead. Wires diffMermaid into
cowritingMarkdownItPlugin's options.highlight override via a per-render
mermaid-fence queue (built in the core rule where state.env is visible,
consumed by highlight in fence-encounter order — highlight itself has no env
param) so a mermaid fence changed since the F6/F7 baseline is re-emitted with
classDef/class/linkStyle styling directives + legend before mermaid.js ever
sees it, reusing diffBlocks' baseline/current block pairing (same pairing
renderReview used). Unchanged diagrams, disabled annotations, no baseline, and
pinned-zero-diff all pass through verbatim.

Ports the substance of the 6 mermaid-diff assertions Task 8 deleted with the
webview's E2E suite as pure unit tests in previewAnnotations.test.ts instead
(DOM-free, source-level).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:08:46 -07:00
BenStullsBets 2170a0d282 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>
2026-07-02 14:51:18 -07:00
BenStullsBets 17fc01e8d8 feat: authorship + change annotations in the built-in Markdown preview (D3/D21, PUC-3); cowriting.annotations toggle
Task 7 of the native-surfaces migration plan. Pure previewAnnotations.ts
(annotateSource + cowritingMarkdownItPlugin) reuses trackChangesModel.ts's
sentinel discipline (#33/#47), generalized to a 3-way ins-claude/ins-human/del
tag (exported injectSentinels/sentinelsToSpans, colorByAuthor unaffected,
84/84 existing tests pass unmodified). Host hook in extension.ts wires
registry/diffView/attribution/proposals/config into the plugin, exposed via
CowritingApi.extendMarkdownIt + a previewAnnotationHost test seam.
cowriting.annotations setting + toggleAnnotations command/menu. Q4 mermaid
(previewScripts + options.highlight fence override) implemented per the
proven bierner.markdown-mermaid pattern; intra-diagram diff augmentation
scoped out (unverifiable via the structural E2E harness) — see
task-7-report.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 14:23:11 -07:00
BenStullsBets c9975ba9e6 fix: route document asks to comment-first askClaude (plan T6 Step 4); machine-author guard + offer cleanup
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 09:04:32 -07:00
BenStullsBets 75f4a3cc20 feat: comments-first ask + comment→reply→offer→proposal loop (D19/D10/D8, PUC-8); sunset the input webview (spec §6.10)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 08:48:20 -07:00
BenStullsBets 8fbbe451ea fix: repaint open review panel after palette accept/reject-all (restores dropped refresh)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 08:30:58 -07:00
BenStullsBets ad5d34b85b refactor: extract EditFlow (runEditAndPropose + editDocument) from the review webview ahead of its sunset (spec §6.10)
Moves runEditAndPropose, the askClaude gate/prompt/progress wrapper, the
EditTarget type, the editTurn/askEditInstruction/turnSeq state, and the
cowriting.editDocument command registration out of TrackChangesPreviewController
into a new EditFlow (src/editFlow.ts), reachable from the review webview
(delegates) and, from Task 6 on, the thread controller. extension.ts now
constructs EditFlow before the preview controller and routes
acceptAllProposals/rejectAllProposals directly to ProposalController, dropping
the preview-controller indirection. E2E suites that drove the old
trackChangesPreviewController.{setEditTurnForTest,runEditAndPropose,askEditInstruction}
seams now drive the same seams on editFlow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 08:22:44 -07:00
BenStullsBets f23fc4afb3 docs: fix fused Task 5 heading in migration plan (---### → separate lines)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 08:07:09 -07:00
BenStullsBets a36353d041 fix: restore proposals + attribution on coediting enter (PUC-7) — registry onDidChange subscribers
Task 4 gated every surface on CoeditingRegistry but only wired
ThreadController/EditorProposalController to registry.onDidChange for
restore-on-enter — ProposalController.renderAll and
AttributionController.loadAll were never called on the enter transition, so
a document's FIRST enter with pre-existing sidecar proposals/attribution
showed threads but not proposal decorations/CodeLens or committed
author-coloring until a later edit happened to fire them (a gap Task 4's
own report flagged as known and unfixed).

Both controllers now subscribe to registry.onDidChange in their
constructors and call renderAll/loadAll on entry only (both already
self-gate on isCoediting; exit stays hide-only, mirroring
ThreadController). Construction order in extension.ts (attribution before
proposals before EditorProposalController) keeps the same-tick read order
correct.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 08:04:36 -07:00
BenStullsBets a323b827a8 feat: gate every surface on CoeditingRegistry (INV-10) — commenting ranges re-assigned on gate change (spec §6.4 v0.2.1)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 07:41:13 -07:00
BenStullsBets cf65528711 feat: native diff surface — QuickDiff + cowriting-baseline: provider + Review Changes + status bar (spec §6.4, INV-13)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 07:18:50 -07:00
BenStullsBets 447a1170ce feat: baseline router — git HEAD + snapshot per INV-7/D13/D14; retire machine-landing advance (spec §6.4)
Task 2 of the native-surfaces migration plan. GitBaselineAdapter resolves a
document's HEAD blob via the built-in vscode.git extension (hardened with a
.git/logs/HEAD watch that nudges repo.status(), since the git extension's own
watcher doesn't reliably notice out-of-band commits on non-workspace-folder
repos in the E2E host). DiffViewController is reworked into a baseline router:
head mode (git-tracked, never persisted, re-read on commit) vs snapshot mode
(captured on CoeditingRegistry entry, re-pinned by "Mark Changes as Reviewed"
— renamed from cowriting.pinDiffBaseline, D14). The shipped machine-landing
baseline advance (#48/INV-18) is retired: a landed Claude edit now stays a
visible change-since-baseline until commit or review (INV-7/D21). Legacy
on-disk reasons ("opened"/"machine-landing") migrate to "entered" via
BaselineStore.normalizeReason on load.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 07:09:55 -07:00
BenStullsBets de83757754 test: cover syncContext context-key derivation + exit idempotency (CoeditingRegistry)
Implements comprehensive unit test coverage for CoeditingRegistry.syncContext,
which derives context keys (cowriting.isCoediting, cowriting.baselineMode) via
vscode.commands.executeCommand — previously untested. Added 8 new tests:

- isCoediting: true for active editor with coediting doc
- isCoediting: false for undefined editor or non-entered doc
- baselineMode: uses hook result when set; defaults to "" otherwise
- exit idempotency: double exit fires onDidChange only once

All assertions inspect the mocked executeCommand call arguments directly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 06:45:59 -07:00
BenStullsBets 2597cba229 feat: CoeditingRegistry opt-in gate (INV-10, spec §6.4) — enter/stop commands + context keys
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 06:40:15 -07:00
BenStullsBets ef61b141b6 plan(0064): native-surfaces migration — ONE plan from coauthoring-native-surfaces v0.2.1 (D17/§6.10/§7.1 rung 3+4), 9 tasks, sunsets gated on green replacements
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-01 22:40:40 -07:00
BenStullsBets 55fe663bd0 claim vscode-cowriting-plugin session 0064 (placeholder) + sessions.json entry 2026-07-01 22:19:33 -07:00
BenStullsBets 7b767a759d update sessions/0063/SESSION-0063.0-TRANSCRIPT-2026-07-01T18-49--INPROGRESS.md 2026-07-01 19:13:17 -07:00
BenStullsBets 2a1d7623f5 claim vscode-cowriting-plugin session 0063 (placeholder) + sessions.json entry 2026-07-01 18:49:59 -07:00
BenStullsBets fdab92ae6d claim vscode-cowriting-plugin session 0062 (placeholder) + sessions.json entry 2026-06-27 17:03:29 -07:00
BenStullsBets c9050c3e08 Merge origin/main (session 0061 claim) into main 2026-06-27 05:18:51 -07:00
BenStullsBets b3c476e4d9 claim vscode-cowriting-plugin session 0061 (placeholder) + sessions.json entry 2026-06-27 05:14:59 -07:00
BenStullsBets 15e6f02bdf Merge: author-colored track changes — Phase 2 (editor pane)
Brings author-colored track changes inline into the main editor (reverses
INV-32): four per-author decoration types, decorateCommitted decorating all
committed changes-since-baseline by author (human green / Claude blue + struck
hints), standalone deletions neutral, proposals recolored Claude, overlap
stacking. Subagent-driven execution of Tasks 6-9; opus whole-branch review +
fix. typecheck + 265 unit + build + E2E green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 18:54:10 -07:00
BenStullsBets c3cecdfaa2 fix: editor renders standalone committed deletions neutral; doc/comment cleanups (final review)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 18:10:25 -07:00
BenStullsBets 02fbe9c77e chore: sweep retired semantic-diff markup; full suite green
- Delete dead `authorBadge` function (no callers; grep-verified)
- Merge adjacent duplicate imports from trackChangesModel in test file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:57:16 -07:00
BenStullsBets ae19df78fb feat: overlap renders stacked author marks (insert + delete) in both panes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:50:39 -07:00
BenStullsBets 7b59c324d5 feat: Task 7 — decorateCommitted fills committed author-colored changes in the editor (reverses INV-32)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:40:15 -07:00
BenStullsBets dcdd2ffc1c feat: per-author editor decoration types; proposals decorate in Claude blue/purple 2026-06-26 17:31:13 -07:00
BenStullsBets 1d284d2868 Merge: author-colored track changes — Phase 1 (preview pane)
Preview pane renders document changes as author-colored track changes:
underline=insert / strikethrough=remove, color=author (human green/red,
Claude blue/purple). Adjacency heuristic for deletion authorship; unchanged
text plain; pin->clean preserved. Phase 2 (editor pane) to follow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 16:38:19 -07:00
BenStullsBets 05ca497900 chore: drop dead cw-by-*/cw-mixed preview CSS; fix added-block comment to cw-ins-*
Final-review follow-up: the live preview colors added blocks via colorByAuthor(kind="ins")
emitting cw-ins-*; the cw-by-*/cw-mixed rules (only authorBadge, which has no callers)
were styled-but-never-emitted. Cosmetic only; build + 260 unit green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:47:05 -07:00
BenStullsBets c579f67a43 test(e2e): assert author-colored track changes render in the preview
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 14:37:29 -07:00
BenStullsBets 5d1000096a feat: author-colored track-changes CSS for the preview (human green/red, Claude blue/purple) 2026-06-26 14:22:12 -07:00
BenStullsBets 2955e8d929 feat: color pending proposal blocks by author (Claude blue/purple)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 14:17:40 -07:00
BenStullsBets 44ef0a21db fix: render added blocks via markdown-safe sentinel path emitting cw-ins-* (heading/list structure preserved)
Defect: an ADDED block was colored via `render(wordDiffByAuthor("", raw, ...))`, which
wrapped the whole raw markdown in an inline `<ins>` BEFORE markdown-it parsed it — so
`## X` rendered as literal text, not `<h2>`. Same structural bug for list, blockquote,
and thematic-break blocks.

Fix (three-part, pure / vscode-free):
1. `blockContentStart(raw)`: new helper returning the offset past block-level markers
   (ATX headings `## `, unordered/ordered list markers, blockquotes). Open sentinels must
   not precede these markers or markdown-it cannot recognise the block construct.
2. `injectSentinels`: clamp the open-sentinel lower-bound to `blockContentStart(raw)`,
   so for `## New Section` the sentinel lands AFTER `## ` (at position 3) instead of at
   position 0, letting the heading parse correctly.
3. `sentinelsToSpans` / `colorByAuthor`: add optional `kind: "by" | "ins" = "by"`
   parameter so the sentinel path can emit `cw-ins-{author}` for added blocks while all
   existing `colorByAuthor`/`cw-by-*` call-sites are unchanged.
4. `renderReview` ADDED block path: `render(wordDiffByAuthor("", raw, ...))` →
   `colorByAuthor(raw, blk.start, landedSpans, render, "ins")`. The CHANGED non-atomic
   prose path (`wordDiffByAuthor(before, after, ...)`) is untouched — it correctly keeps
   the block markers at column 0 of the unchanged prefix.
5. `renderReviewOp`: removed the now-vestigial `colored` parameter (was always `render`
   after the added-block path moved to `changedHtml`); unchanged blocks now call
   `render(op.block.raw)` directly.

Regression test added: "renderReview: an added heading block renders as a heading AND
is author-colored as an insertion" — RED on old code, GREEN after fix. All 259 tests
pass; typecheck clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 14:09:19 -07:00
BenStullsBets 08557827da feat: author-colored changed/added blocks in review; unchanged blocks render plain 2026-06-26 13:54:24 -07:00
BenStullsBets 0ad040711f feat: authorAt + wordDiffByAuthor pure helpers (author-colored word diff w/ adjacency del) 2026-06-26 13:34:12 -07:00
BenStullsBets 94b1a9b0c2 docs: author-colored track-changes design + implementation plan
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 13:32:34 -07:00
BenStullsBets 126d71fa06 add sessions/0060/SESSION-0060.0-TRANSCRIPT-2026-06-26T12-52--2026-06-26T13-14.md + replace placeholder/variant SESSION-0060.0-TRANSCRIPT-2026-06-26T12-52--INPROGRESS.md 2026-06-26 13:15:04 -07:00
benstull e671c4bf03 fix(#59): disable claude-code IDE auto-connect to stop spurious macOS Apple-Events prompt (#68) 2026-06-26 20:12:24 +00:00
BenStullsBets 5d83f290f5 claim vscode-cowriting-plugin session 0060 (placeholder) + sessions.json entry 2026-06-26 12:52:49 -07:00
BenStullsBets e38fe1b8ca add sessions/0059/SESSION-0059.0-TRANSCRIPT-2026-06-26T06-01--2026-06-26T08-32.md + replace placeholder/variant SESSION-0059.0-TRANSCRIPT-2026-06-26T06-01--INPROGRESS.md 2026-06-26 08:33:00 -07:00
benstull 844a2789fd chore: remove stray code-repo spec copy (canonical in content repo) (#67) 2026-06-26 15:30:59 +00:00
benstull 7b98249286 F12: inline editable proposed-change diff in the Markdown editor + Accept/Reject control parity (#64) (#66) 2026-06-26 15:28:14 +00:00
BenStullsBets d2ef9457c4 add sessions/0057/SESSION-0057.0-TRANSCRIPT-2026-06-26T04-35--2026-06-26T06-55.md + replace placeholder/variant SESSION-0057.0-TRANSCRIPT-2026-06-26T04-35--INPROGRESS.md 2026-06-26 06:56:48 -07:00
benstull 7e42d115c0 feat(ux): unify Ask-Claude-to-Edit on a split-below multi-line webview (#65) 2026-06-26 13:50:31 +00:00
BenStullsBets 56cc9eb6ad claim vscode-cowriting-plugin session 0059 (placeholder) + sessions.json entry 2026-06-26 06:01:30 -07:00
BenStullsBets 2069029d73 add sessions/0058/SESSION-0058.0-TRANSCRIPT-2026-06-26T05-12--2026-06-26T05-58.md + replace placeholder/variant SESSION-0058.0-TRANSCRIPT-2026-06-26T05-12--INPROGRESS.md 2026-06-26 05:58:49 -07:00
BenStullsBets a99430c247 claim vscode-cowriting-plugin session 0058 (placeholder) + sessions.json entry 2026-06-26 05:13:09 -07:00
benstull 9432300e3c feat(ux): unify "Ask Claude to Edit" + inline prompt at selection; fix keybindings (#62) 2026-06-26 12:11:43 +00:00
BenStullsBets a42e5f145d add sessions/0056/SESSION-0056.0-TRANSCRIPT-2026-06-26T04-24--2026-06-26T04-54.md + replace placeholder/variant SESSION-0056.0-TRANSCRIPT-2026-06-26T04-24--INPROGRESS.md 2026-06-26 04:55:04 -07:00
BenStullsBets 26628c0dbe claim vscode-cowriting-plugin session 0057 (placeholder) + sessions.json entry 2026-06-26 04:53:46 -07:00