Add --max-label flag to diff_to_mermaid#3
Open
brovatten wants to merge 6 commits into
Open
Conversation
…t-in)
Replaces the webview/Playwright PNG approach with an inline Mermaid diagram
that GitHub renders natively in the PR comment — no image, no orphan branch,
no contents:write, and fork-friendly.
How it works:
- Resolve a base ("before") analysis: use the committed
.codeboarding/analysis.json at the PR base if present, else generate one via
a full engine run on the base commit.
- Analyze the PR head incrementally, seeded from the base (stable component
ids), falling back to a full run on cache miss.
- scripts/diff_to_mermaid.py diffs the two analyses (name-based matching;
relation label change => modified) and emits a graph LR with nodes colored
via classDef/class and arrows via positional linkStyle: green added, yellow
modified, red dashed deleted. Escaping, deleted-namespace keying, and a size
guard (GitHub's ~500-edge / 50k-char cap -> changed-only or text fallback).
Rendering:
- Level 1 (flat, top-level) is the default — readable inline, never trips the
size cap.
- nested: true draws depth>1 sub-components as subgraphs (leaf nodes filled,
parent containers outlined). Optional --font-size/--node-padding/spacing emit
an %%{init}%% directive to enlarge nodes.
scripts/run_local.sh mirrors the action for local iteration (fast diff-only or
full pipeline) and writes a browser HTML preview rendered with mermaid.js.
…ace/extension CTA via click proxy
Architecture review · 7 components changedgraph LR
n_Action_Orchestrator["Action Orchestrator"]
n_Structural_Analysis_Engine["Structural Analysis Engine"]
n_Mermaid_Syntax_Renderer["Mermaid Syntax Renderer"]
n_Data_Sanitization_Identity_Provider["Data Sanitization & Identity Provider"]
del_Environment_Context_Resolver["Environment & Context Resolver"]
del_Remote_Job_Orchestrator["Remote Job Orchestrator"]
del_Artifact_Result_Processor["Artifact & Result Processor"]
n_Action_Orchestrator -- "Initiates the comparison" --> n_Structural_Analysis_Engine
n_Action_Orchestrator -- "Passes the structural delta" --> n_Mermaid_Syntax_Renderer
n_Structural_Analysis_Engine -- "Uses identity services" --> n_Data_Sanitization_Identity_Provider
n_Mermaid_Syntax_Renderer -- "Utilizes sanitization logic" --> n_Data_Sanitization_Identity_Provider
n_Action_Orchestrator -- "calls" --> n_Data_Sanitization_Identity_Provider
del_Environment_Context_Resolver -- "passes resolved repository URL and branch to in…" --> del_Remote_Job_Orchestrator
del_Remote_Job_Orchestrator -- "hands off JSON response containing full job res…" --> del_Artifact_Result_Processor
del_Artifact_Result_Processor -- "writes extracted documentation data to runner f…" --> del_Artifact_Result_Processor
del_Remote_Job_Orchestrator -- "manages job configuration and polls for status…" --> del_Remote_Job_Orchestrator
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_Action_Orchestrator,n_Structural_Analysis_Engine,n_Mermaid_Syntax_Renderer,n_Data_Sanitization_Identity_Provider added;
class del_Environment_Context_Resolver,del_Remote_Job_Orchestrator,del_Artifact_Result_Processor deleted;
linkStyle 0,1,2,3,4 stroke:#0b5d23,stroke-width:2px;
linkStyle 5,6,7,8 stroke:#82071e,stroke-width:2px,stroke-dasharray:5 3;
Colours indicate components that have been 🟩 added · 🟨 modified · 🟥 removed — versus 🔍 This is the flattened map. Explore this diff live in your browser → 💡 Prefer your editor? Get the CodeBoarding VS Code extension → codeboarding-action · run 26894341048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small standalone PR to verify the architecture-diff action fires on a fresh PR. Exposes
--max-labelto control edge-label truncation length (default 48). The action should post an architecture-diff comment below.