Skip to content

docs: PR architecture sections carry one diff diagram, not a before/after pair - #107

Merged
ssowonny merged 1 commit into
mainfrom
docs/pr-diff-diagrams
Aug 1, 2026
Merged

docs: PR architecture sections carry one diff diagram, not a before/after pair#107
ssowonny merged 1 commit into
mainfrom
docs/pr-diff-diagrams

Conversation

@ssowonny

@ssowonny ssowonny commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

TL;DR

  • PR "Architecture changes" sections now carry one diagram with the change marked on it, instead of a Before block and an After block the reviewer has to diff by eye.
  • Additions are ✅, removals are ❌ struck through, anything unmarked already existed.
  • Nothing about the committed architecture/*.md files changes — they stay full-state classDiagram. This is only about the excerpt in the PR description.
  • Docs-only, one paragraph in CLAUDE.md.

What changed

CLAUDE.mdArchitecture diagrams in PRs, item (2) of the recipe. Was: a Before mermaid block and an After mermaid block, each an excerpt. Now: one consolidated diff diagram per changed file, produced by the mermaid-diff-diagram skill, fed the merge-base diagram as before and the branch's as after. Still an excerpt — only the affected classes and their immediate relationships, never the full diagram.

The skill emits a flowchart (not classDiagram) because classDiagram can't style individual edges and its members are plain SVG text, so per-line marking is impossible there. Class boxes are emulated with HTML labels and UML semantics ride on edge labels. Every marker is layered so it degrades gracefully where a renderer strips inline styles: the ✅/❌ chip is the layer that always survives, with a highlight span, <s> strikethrough, and classDef/linkStyle colors on top.

What it looks like

Taken from #100, whose lib class gained one export:

✅ added · ❌ removed (strikethrough) · unmarked = unchanged

flowchart TB
    components["components"]
    lib["<div style='text-align:left'><b>lib</b><br/>+diff.ts splitLines lcsDiff diffText<br/>+runs.ts groupRuns runFileCount<br/>+heat.ts heatFor heatTotal heatText heatLevel hotPathSplit<br/>+heat.ts ageRange isFlatRange ageSpanLabel (treemap scale)<br/><span style='background:#22c55e55;padding:0 4px;border-radius:3px'>✅ +heat.ts orphanPaths (reads whose file left the tree)</span><br/>+sniff.ts sniffBytes BlobText MAX_BYTES<br/>+utils.ts</div>"]
    components -- "diffText groupRuns hotPathSplit" --> lib
Loading

#100's description has already been rewritten this way.

Architecture changes

None — docs only, no package or type moves.

…fter pair

Two diagrams make the reviewer do the diffing. The mermaid-diff-diagram skill
folds them into one flowchart with additions marked ✅ and removals ❌ struck
through, so the change reads at a glance. The committed architecture/*.md files
are untouched by this: they stay full-state classDiagram; only the PR excerpt
changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FNgeJVcsXQ5sTfWLgCR4cv
@ssowonny
ssowonny merged commit 2a7dca2 into main Aug 1, 2026
2 checks passed
@ssowonny
ssowonny deleted the docs/pr-diff-diagrams branch August 1, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant