feat(dashboard): show the code graph, from its card and from a finding (t82) #939

Merged
sharang merged 2 commits from feat/t82-graph-view into main 2026-11-07 10:43:03 +00:00
Owner

Part of t82, after #937 (the code graph card). The user's complaint was that the drawn graph is never shown; the card had only counts.

What

  • Card → graph. The Codegraph card on the target page has an "Anzeigen" link to /graph/:repo_id.
  • Finding → impact. A finding whose location the graph has gets a "Codegraph" card: "N Einstiegspunkte erreichen die Stelle" and "Auswirkung anzeigen", linking to /graph/:repo_id/impact/:fingerprint. Impact analyses are stored for every finding with a file, also when the graph has no node there, so the card only appears when the analysis has something to show.
  • Current dashboard look, German first.
    • The explorer and the impact page use i18n texts (new texts::graph) and the target page's header.
    • Node kinds are named in German (Funktion, Klasse, Programm for PLC, …), and a legend shows them.
    • graph-viz.js takes its colours from theme tokens (--graph-* in main.css), so the drawing follows the light and dark theme and recolours on a switch.
    • The March-era orbital overlay and the hard-coded palette are gone.
  • Large graphs stay usable.
    • Above 1,200 nodes the graph opens as one node per group. A group is a community with 10 or more members; smaller communities are pooled by folder (hexagons).
    • A click opens a group: its members, plus only the groups linked to them, as bundled edges with counts. A group over the limit keeps its 1,200 most connected members and says so.
    • The grouping is in Rust, in pages/graph_view.rs (pure, unit-tested); graph-viz.js only draws.
    • A large drawing stops its layout after stabilising, and group labels scale with size.
    • The agent's truncation of very large graphs (its 10,000-edge cap) is now shown.
  • Smaller changes:
    • /graph redirects to the targets list.
    • The old repository cards and GraphExplorerInline are removed (unused).
    • The file-content and search queries are URL-encoded; file names can hold spaces or #.
    • Graph-derived values are memoised, so a keystroke in the search box doesn't copy the graph.
  • /graph and /chat stay out of the sidebar.

Test

  • fmt; clippy (server and web, CI flags); dashboard tests: server 123, web 102. New tests cover the grouping, the overview and its bundles, an opened group, the cap, the impact check and format_count.
  • Render check of graph-viz.js with real graph data. A local harness used this branch's vis-network.min.js, graph-viz.js and main.css. The graphs came from the real parsers via a throwaway test, not committed:
    • C (fixtures/nightly/firmware, 28 nodes), C# (fixtures/dotnet, 15) and PLC (examples/plc-demo, 8) all render in light and dark. A PLC PROGRAM is drawn as a module with an entry-point ring; a FUNCTION_BLOCK is drawn as a class.
    • A large graph (this repository's compliance-agent/src, 4,356 nodes and 10,864 edges): the Rust grouping takes about 50 ms in a debug build. The overview has 116 groups and 575 edges and lays out in about 1.4 s; the largest group opened has 905 nodes and lays out in about 2.5 s.
    • Before folder pooling, the same graph gave 839 communities, most of 2–4 members: an unreadable overview.
  • Not exercised: the Dioxus page against a live agent. That means the click wiring, opening a group from search or the file tree, the rebuild button and the finding's impact card. To check on stage after merge: open the graph from a C, C# and PLC target's card, open a group, search, and follow the impact link from a finding.

Notes

  • A PLC PROGRAM is kept as kind module in the graph. The dashboard names it "Programm" in the tooltip, inspector, search suggestions and legend, because "Modul" names a bookable product (the user's decision, 2026-11-07). A graph with PLC and other code shows both names in the legend.
  • /chat stays hidden; the recommendation goes to the user separately.

🤖 Generated with Claude Code

Part of t82, after #937 (the code graph card). The user's complaint was that the drawn graph is never shown; the card had only counts. ## What - **Card → graph.** The Codegraph card on the target page has an "Anzeigen" link to `/graph/:repo_id`. - **Finding → impact.** A finding whose location the graph has gets a "Codegraph" card: "N Einstiegspunkte erreichen die Stelle" and "Auswirkung anzeigen", linking to `/graph/:repo_id/impact/:fingerprint`. Impact analyses are stored for every finding with a file, also when the graph has no node there, so the card only appears when the analysis has something to show. - **Current dashboard look, German first.** - The explorer and the impact page use i18n texts (new `texts::graph`) and the target page's header. - Node kinds are named in German (Funktion, Klasse, Programm for PLC, …), and a legend shows them. - `graph-viz.js` takes its colours from theme tokens (`--graph-*` in `main.css`), so the drawing follows the light and dark theme and recolours on a switch. - The March-era orbital overlay and the hard-coded palette are gone. - **Large graphs stay usable.** - Above 1,200 nodes the graph opens as one node per group. A group is a community with 10 or more members; smaller communities are pooled by folder (hexagons). - A click opens a group: its members, plus only the groups linked to them, as bundled edges with counts. A group over the limit keeps its 1,200 most connected members and says so. - The grouping is in Rust, in `pages/graph_view.rs` (pure, unit-tested); `graph-viz.js` only draws. - A large drawing stops its layout after stabilising, and group labels scale with size. - The agent's truncation of very large graphs (its 10,000-edge cap) is now shown. - **Smaller changes:** - `/graph` redirects to the targets list. - The old repository cards and `GraphExplorerInline` are removed (unused). - The file-content and search queries are URL-encoded; file names can hold spaces or `#`. - Graph-derived values are memoised, so a keystroke in the search box doesn't copy the graph. - `/graph` and `/chat` stay out of the sidebar. ## Test - fmt; clippy (server and web, CI flags); dashboard tests: server 123, web 102. New tests cover the grouping, the overview and its bundles, an opened group, the cap, the impact check and `format_count`. - **Render check of `graph-viz.js` with real graph data.** A local harness used this branch's `vis-network.min.js`, `graph-viz.js` and `main.css`. The graphs came from the real parsers via a throwaway test, not committed: - C (`fixtures/nightly/firmware`, 28 nodes), C# (`fixtures/dotnet`, 15) and PLC (`examples/plc-demo`, 8) all render in light and dark. A PLC PROGRAM is drawn as a module with an entry-point ring; a FUNCTION_BLOCK is drawn as a class. - A large graph (this repository's `compliance-agent/src`, 4,356 nodes and 10,864 edges): the Rust grouping takes about 50 ms in a debug build. The overview has 116 groups and 575 edges and lays out in about 1.4 s; the largest group opened has 905 nodes and lays out in about 2.5 s. - Before folder pooling, the same graph gave 839 communities, most of 2–4 members: an unreadable overview. - **Not exercised:** the Dioxus page against a live agent. That means the click wiring, opening a group from search or the file tree, the rebuild button and the finding's impact card. To check on stage after merge: open the graph from a C, C# and PLC target's card, open a group, search, and follow the impact link from a finding. ## Notes - A PLC PROGRAM is kept as kind `module` in the graph. The dashboard names it "Programm" in the tooltip, inspector, search suggestions and legend, because "Modul" names a bookable product (the user's decision, 2026-11-07). A graph with PLC and other code shows both names in the legend. - `/chat` stays hidden; the recommendation goes to the user separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang changed target branch from feat/t82-graph-card to main 2026-11-07 10:05:39 +00:00
sharang added 2 commits 2026-11-07 10:25:09 +00:00
The target page's code graph card links to the drawn graph, and a
finding whose location the graph has links to its impact: the entry
points that reach it, the call chains, callers and callees.

The explorer and the impact page follow the current dashboard: German
first through i18n, the target page's header, and graph colours taken
from the theme tokens, so the drawing follows the light and dark theme
and recolours on a switch.

A large graph stays usable: above 1,200 nodes it opens as one node per
group (communities of 10 or more, smaller ones pooled by folder), and a
click opens a group with its members and the groups linked to them.
The grouping runs in Rust (pages/graph_view.rs); graph-viz.js only
draws. A large drawing stops its layout after stabilising. The agent's
truncation of very large graphs is now shown.

/graph leads to the targets list; the file and search queries are
encoded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(dashboard): a PLC PROGRAM is a "Programm" in the code graph (t82)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m7s
CI / Check (pull_request) Successful in 17m34s
f1278ccb12
The graph keeps a PLC PROGRAM as a module. "Modul" names a bookable
product, so the tooltip, the inspector, the search suggestions and the
legend call it "Programm" (Program); a graph with PLC and other code
shows both in the legend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang force-pushed feat/t82-graph-view from b4fe7cb21b to f1278ccb12 2026-11-07 10:25:09 +00:00 Compare
sharang merged commit c8deabd4d9 into main 2026-11-07 10:43:03 +00:00
Sign in to join this conversation.