Skip to content

Annotate mode: show the version diff (highlighted) for .md and .html files #960

Description

@egouilliard-leyton

Summary

Plan mode shows a highlighted version diff (the +N/-M badge → PlanDiffViewer) when a plan is revised, powered by previousPlan/versionInfo that the plan server saves to ~/.plannotator/history/.... Annotate mode has no equivalentplannotator annotate <file> never tracks history, so there's no way to see what changed between edits of a standalone Markdown note or an HTML spec, even though the diff UI and block-level commenting already exist in the editor.

This is especially useful for an iterative loop: annotate a doc → the agent edits it → reopen and immediately see the highlighted changes before the next round.

Request

Bring the version diff to annotate mode for both:

  • .md / .txt — the existing rendered Markdown diff (clean/classic/raw).
  • .html with --render-html — render the diff as the real page with inline <ins>/<del> highlights, so you see where it changed (not a source dump), with commenting still working on the diff view.

Notes / constraints

  • History should be keyed by file path (stable across edits) rather than the plan flow's first-heading+date slug — re-opening the same file should group its versions even when headings change.
  • The diff UI (PlanDiffViewer, Version Browser, block annotations) is already mode-agnostic and consumes previousPlan/versionInfo; the annotate server just needs to send them.
  • Per CLAUDE.md, the change must land in both the Bun (packages/server/annotate.ts) and Pi (apps/pi-extension/server/serverAnnotate.ts) runtimes.

Happy to contribute this — PR incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions