Pinning the baseline should leave the review panel fully un-annotated #48

Closed
opened 2026-06-13 14:04:04 +00:00 by benstull · 1 comment
Owner

Summary

As a writer, when I pin the baseline, the review panel shows a fully clean,
un-annotated
document — no change marks and no authorship coloring — so
pinning reads as "this is my clean starting point."

Problem / pain

Pinning the baseline (cowriting.pinDiffBaseline / the F11 preview-toolbar Pin
baseline
button) sets the baseline to the current document text, so there are
zero changes since baseline. The change axis correctly goes empty — no
<ins> / <del> / strikethrough. But the panel is not clean: the F3
authorship coloring (green = human, blue = Claude) still paints every
block
, because the F10 "on" render (INV-33) author-colors all live text, not
just changed text — an unchanged block renders as cw-blk cw-unchanged with
colorByAuthor applied (src/trackChangesModel.ts, renderReview
renderReviewOp).

So immediately after a pin, the writer expects a clean slate and instead sees the
whole document painted green/blue. The panel refreshes correctly on pin
(onDidChangeBaseline) — this is not a stale render; the persistent author colors
are the annotations. The result undercuts the "pin = clean baseline" mental
model that the pin gesture is supposed to convey.

Who feels it

Writers using the F10/F11 review preview who pin a baseline — the pin button is a
primary preview-toolbar gesture (alongside Ask-Claude, F11), so this is on a
high-traffic surface.

Desired outcome / value

A pin yields a fully clean panel: with no changes since baseline, the "on"
review render shows plain rendered markdown — no change marks and no authorship
coloring
. Pinning visibly means "accepted as my clean baseline," reinforcing the
gesture instead of contradicting it.

Acceptance — "done right"

  • With the review preview in the annotations-on state, when there are no
    changes since baseline
    (every block unchanged — the state right after a pin),
    the panel renders plain — no cw-add / cw-del / strikethrough and no
    authorship (green/blue) coloring
    on any block.
  • Pinning the baseline while the preview is open produces this clean panel
    immediately (the existing onDidChangeBaseline refresh already fires).
  • When changes do exist since baseline, rendering is unchanged — changed/
    added text is still author-colored and struck deletions still show (this issue
    does not touch the with-changes render).
  • Pending Claude proposals, if any remain after a pin, still show as
    actionable cw-proposal ✓/✗ blocks — they are review actions, not "annotations,"
    and are out of scope for clearing.
  • The annotations-off state is unchanged (already plain — renderPlain).

Scope / non-goals

  • In scope: suppressing authorship coloring (and, redundantly, change marks)
    in the on render when there are no changes since baseline — the
    just-pinned / zero-diff whole-document state.
  • Non-goals:
    • Not the broader "authorship should never color unchanged text" change —
      an unchanged block inside a document that has other changes is left as-is
      (that broader INV-33 revision was explicitly not chosen — see Source).
    • No change to the with-changes render, the off-state render, or the proposal
      blocks.
    • No new toggle/setting — clean-when-no-changes is the behavior, not an option.

Assumptions · constraints · dependencies

  • The "no changes since baseline" condition is exactly "diffBlocks(baseline, current) yields all-unchanged ops" — the natural place to branch the on-render
    to renderPlain-equivalent output (clean, but keep the data-src block mapping
    so INV-36 selection→source still works, as renderPlain already does).
  • Builds on: F6 baseline / pin (#17/#19, DiffViewController), F10 interactive
    review (#29, INV-32..34, renderReview/renderReviewOp/colorByAuthor), F11
    preview toolbar (#43, the Pin-baseline button, INV-35).
  • Touches INV-33 only at the edge case (zero diff → clean); the general
    combined-render behavior is unchanged. A one-line invariant clarification may be
    warranted (e.g. "with no changes since baseline the on-render is clean").

Source / signal

Self-originated — capture session vscode-cowriting-plugin-0042 (operator ask:
"When I pin the baseline, there should be no annotations in the review panel").
Scope confirmed in-session: the desired behavior is pin → fully clean panel
(change marks and authorship colors gone in the zero-diff state), not the
broader "authorship never colors unchanged text." Arose while reviewing the
document-edit-flow Solution Design (brainstorming session 0041), which centers the
pin-baseline + review-panel surfaces.

Priority (WSJF)

Value (med — fixes a confusing, expectation-violating result on a primary
toolbar gesture) · Time-criticality (low) · Opportunity-enablement (low) ÷ Size
(small — a single zero-diff branch to clean rendering) → favorable-but-modest.
priority/P2. (Defect-flavored story — surprising behavior, but with a
workaround: toggle annotations off.)

Decomposition

  • In the on render, detect "no changes since baseline" (all diffBlocks
    ops unchanged) and render the body clean — no authorship coloring, no
    change marks — while preserving the data-src block mapping (INV-36).
  • Keep pending cw-proposal blocks rendering in that clean state (proposals
    are actions, not annotations).
  • Clarify INV-33 (zero-diff → clean on-render) in the F10/document-edit spec
    invariant set.
  • Unit test: baseline == current with authorship spans → on-render has no
    cw-add/cw-del/author-color classes; with a pending proposal → the
    proposal block still renders.
  • Host E2E: open preview, pin baseline → panel is visually clean (no green/
    blue); make an edit → annotations return.

Solution notes (optional — NOT a design)

The narrow shape: in renderReview, when diffBlocks(baseline, current) is
entirely unchanged, short-circuit to the same clean per-block output
renderPlain produces (bare <div data-src…> + rendered markdown, no cw-
annotation classes), then append any pending cw-proposal blocks. This reuses the
existing clean-render path rather than special-casing colorByAuthor, and keeps
the two states (off / on-with-no-changes) visually identical by construction.
Non-binding.

<!-- Set the type/* label via capture-issues.sh --type story --> ## Summary As a writer, when I **pin the baseline**, the review panel shows a **fully clean, un-annotated** document — no change marks **and** no authorship coloring — so pinning reads as "this is my clean starting point." ## Problem / pain Pinning the baseline (`cowriting.pinDiffBaseline` / the F11 preview-toolbar **Pin baseline** button) sets the baseline to the current document text, so there are **zero changes since baseline**. The change axis correctly goes empty — no `<ins>` / `<del>` / strikethrough. **But the panel is not clean:** the F3 **authorship coloring** (green = human, blue = Claude) still paints **every block**, because the F10 "on" render (INV-33) author-colors **all live text**, not just changed text — an *unchanged* block renders as `cw-blk cw-unchanged` with `colorByAuthor` applied (`src/trackChangesModel.ts`, `renderReview` → `renderReviewOp`). So immediately after a pin, the writer expects a clean slate and instead sees the **whole document painted** green/blue. The panel refreshes correctly on pin (`onDidChangeBaseline`) — this is not a stale render; the persistent author colors *are* the annotations. The result undercuts the "pin = clean baseline" mental model that the pin gesture is supposed to convey. ## Who feels it Writers using the F10/F11 review preview who pin a baseline — the pin button is a **primary** preview-toolbar gesture (alongside Ask-Claude, F11), so this is on a high-traffic surface. ## Desired outcome / value A pin yields a **fully clean panel**: with no changes since baseline, the "on" review render shows plain rendered markdown — no change marks and **no authorship coloring**. Pinning visibly means "accepted as my clean baseline," reinforcing the gesture instead of contradicting it. ## Acceptance — "done right" - With the review preview in the **annotations-on** state, when there are **no changes since baseline** (every block unchanged — the state right after a pin), the panel renders **plain** — no `cw-add` / `cw-del` / strikethrough **and no authorship (green/blue) coloring** on any block. - Pinning the baseline while the preview is open produces this clean panel **immediately** (the existing `onDidChangeBaseline` refresh already fires). - When changes **do** exist since baseline, rendering is **unchanged** — changed/ added text is still author-colored and struck deletions still show (this issue does not touch the with-changes render). - **Pending Claude proposals**, if any remain after a pin, **still show** as actionable `cw-proposal` ✓/✗ blocks — they are review actions, not "annotations," and are out of scope for clearing. - The **annotations-off** state is unchanged (already plain — `renderPlain`). ## Scope / non-goals - **In scope:** suppressing authorship coloring (and, redundantly, change marks) in the **on** render when there are **no changes since baseline** — the just-pinned / zero-diff whole-document state. - **Non-goals:** - **Not** the broader "authorship should never color unchanged text" change — an *unchanged* block inside a document that has *other* changes is left as-is (that broader INV-33 revision was explicitly **not** chosen — see Source). - No change to the with-changes render, the off-state render, or the proposal blocks. - No new toggle/setting — clean-when-no-changes is the behavior, not an option. ## Assumptions · constraints · dependencies - The "no changes since baseline" condition is exactly "`diffBlocks(baseline, current)` yields all-`unchanged` ops" — the natural place to branch the on-render to `renderPlain`-equivalent output (clean, but keep the `data-src` block mapping so INV-36 selection→source still works, as `renderPlain` already does). - Builds on: F6 baseline / pin (`#17`/`#19`, `DiffViewController`), F10 interactive review (`#29`, INV-32..34, `renderReview`/`renderReviewOp`/`colorByAuthor`), F11 preview toolbar (`#43`, the Pin-baseline button, INV-35). - Touches INV-33 only at the **edge case** (zero diff → clean); the general combined-render behavior is unchanged. A one-line invariant clarification may be warranted (e.g. "with no changes since baseline the on-render is clean"). ## Source / signal Self-originated — capture session **vscode-cowriting-plugin-0042** (operator ask: "When I pin the baseline, there should be no annotations in the review panel"). Scope confirmed in-session: the desired behavior is **pin → fully clean panel** (change marks *and* authorship colors gone in the zero-diff state), **not** the broader "authorship never colors unchanged text." Arose while reviewing the document-edit-flow Solution Design (brainstorming session 0041), which centers the pin-baseline + review-panel surfaces. ## Priority (WSJF) Value (med — fixes a confusing, expectation-violating result on a **primary** toolbar gesture) · Time-criticality (low) · Opportunity-enablement (low) ÷ Size (small — a single zero-diff branch to clean rendering) → favorable-but-modest. `priority/P2`. *(Defect-flavored story — surprising behavior, but with a workaround: toggle annotations off.)* ## Decomposition - [ ] In the **on** render, detect "no changes since baseline" (all `diffBlocks` ops `unchanged`) and render the body **clean** — no authorship coloring, no change marks — while preserving the `data-src` block mapping (INV-36). - [ ] Keep pending `cw-proposal` blocks rendering in that clean state (proposals are actions, not annotations). - [ ] Clarify INV-33 (zero-diff → clean on-render) in the F10/document-edit spec invariant set. - [ ] Unit test: baseline == current with authorship spans → on-render has no `cw-add`/`cw-del`/author-color classes; with a pending proposal → the proposal block still renders. - [ ] Host E2E: open preview, pin baseline → panel is visually clean (no green/ blue); make an edit → annotations return. ## Solution notes (optional — NOT a design) The narrow shape: in `renderReview`, when `diffBlocks(baseline, current)` is entirely `unchanged`, short-circuit to the same clean per-block output `renderPlain` produces (bare `<div data-src…>` + rendered markdown, no `cw-` annotation classes), then append any pending `cw-proposal` blocks. This reuses the existing clean-render path rather than special-casing `colorByAuthor`, and keeps the two states (off / on-with-no-changes) visually identical by construction. Non-binding.
benstull added the type/storypriority/P2 labels 2026-06-13 14:04:04 +00:00
Author
Owner

Shipped (#52, session 0046). Pinning the baseline now renders the review panel fully clean — no change marks and no authorship coloring — when there are zero changes since the pin (reason === "pinned"); a machine-landing-advanced baseline (accept) keeps its coloring so accepted Claude text stays blue (INV-33 preserved). Proposals still show; data-src mapping kept. 218 unit + 74/5 host E2E green. INV-33 clarification written to the F10 spec (content-repo working tree, pending push).

Shipped (#52, session 0046). Pinning the baseline now renders the review panel fully clean — no change marks and no authorship coloring — when there are zero changes since the pin (`reason === "pinned"`); a machine-landing-advanced baseline (accept) keeps its coloring so accepted Claude text stays blue (INV-33 preserved). Proposals still show; data-src mapping kept. 218 unit + 74/5 host E2E green. INV-33 clarification written to the F10 spec (content-repo working tree, pending push).
Sign in to join this conversation.