Skip to content

Add interactive semantic diff HTML reports#34

Merged
forhappy merged 1 commit into
mainfrom
codex/semantic-diff-html
Jul 25, 2026
Merged

Add interactive semantic diff HTML reports#34
forhappy merged 1 commit into
mainfrom
codex/semantic-diff-html

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

Summary

  • add the hard-cutover compass diff OLD NEW --format html --output PATH workflow
  • render a self-contained reviewer report with actionable semantic findings, exact source changes, and meaningful code-graph changes
  • embed pinned @pierre/diffs 1.2.12 for unified/split layouts, line numbers, intraline emphasis, hunk metadata, and wrapping
  • retain the exact Git patch as a no-JavaScript/error fallback and lazy-mount file diffs as accordions open
  • normalize graph deltas, collapse non-semantic metadata and edge-identity churn, and preserve exhaustive node/edge lists in the report
  • document the CLI, output contract, offline behavior, vendored license, and reproducible bundle build

Why

PR reviewers need one concise artifact that explains what behavior changed, what may break, which callers/modules are affected, what tests are missing, and how both the source and code graph changed. The previous text/JSON-only flow did not provide an interactive review surface, and a basic line-oriented patch view could not provide side-by-side or intraline review without an external tool.

User impact

Users can now run:

compass diff OLD NEW --format html --output semantic-diff.html

The resulting file is fully offline and self-contained: it has no CDN or runtime server dependency. The existing text and JSON workflows remain available; --output is intentionally valid only for HTML.

Validation

  • cargo test -p compass-semantic-diff -p compass-history
  • cargo test -p compass-cli --test history_cli diff_emits_semantic_text_json_html_and_rejects_removed_flags
  • cargo test -p compass-cli semantic_diff_render::tests --lib
  • cargo check -p compass-cli
  • cargo fmt --all -- --check
  • git diff --check
  • generated and exercised a real bbolt report in the browser: unified/split switching, wrapped lines, lazy second-file rendering, intraline spans, exact-patch fallback behavior, and zero fresh console warnings/errors

@forhappy
forhappy marked this pull request as ready for review July 25, 2026 14:42
@forhappy
forhappy merged commit 18f4eb4 into main Jul 25, 2026
4 of 9 checks passed
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