feat(cli): galaxy visualizer — self-contained interactive HTML graph explorer (6F.8)#49
Merged
officialCodeWork merged 1 commit intoJul 15, 2026
Conversation
…explorer (6F.8) New `ui-lineage visualize -g <graph> -o <html>` renders the whole lineage graph as a single self-contained HTML file (graph JSON + all CSS/JS inlined, zero network requests) that opens in any browser with no server. - visualize.ts: pure renderVisualization(graph) → HTML string (trivially testable) + toViewModel trimming nodes and dropping dangling edges. The embedded JSON escapes "<" so rendered text containing "</script>" can't break out of the data script. - Client: canvas force-directed "galaxy" with grid-approximated repulsion (neighbor-cell only) that scales to thousands of nodes; node radius by degree; 9 node kinds color-coded with a legend. - Interactions: per-kind node + edge filter toggles, search-and-fly, click → detail panel (name, kind, file:line, connection count, flags) with neighbor highlight + dim-others (visual blast radius), drag-to-pin, scroll-zoom, physics pause, always-labels. Verified live in-browser on the demo-app graph: renders, filters, physics toggle, and search→select all work with zero console errors. CLI package gains a test script + vitest; 5 new tests (embed round-trip, dangling-edge drop, </script> breakout guard, self-contained output). README documents the command. Eval unaffected (290/0/0/0); typecheck clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Implements the feature you requested: once
scanemits the graph JSON,ui-lineage visualizeturns it into an interactive HTML page you can open in a browser and explore — all nodes and their interconnections laid out like a galaxy, with options to inspect your own repo.ui-lineage scan ./src -o app.graph.json ui-lineage visualize -g app.graph.json -o app.galaxy.html open app.galaxy.html # no server, no networkWhat it produces
A single self-contained HTML file — graph JSON plus all CSS/JS inlined, zero network requests — safe to double-click or share. The client is a canvas force-directed "galaxy": components are the stars, their instances/hooks/state/data-sources cluster around them, routes act as gravitational centers. All 9 node kinds are color-coded with a legend.
Exploration options:
Built with grid-approximated repulsion (neighbor cells only) so it stays responsive at real-codebase scale (thousands of nodes) where SVG would choke.
Design & safety
renderVisualization(graph)is a pure function (graph in, HTML string out) — trivially testable;toViewModeltrims nodes to what the client needs and drops dangling edges<, so rendered text containing</script>can't break out of the data script (tested)Verification
file://andhttp://with no external requeststestscript + vitest; 5 new tests (embed round-trip, dangling-edge drop,</script>breakout guard, self-contained assertions)pnpm evalunaffected (290/0/0/0); typecheck clean; README documents the commandNote
This is 6F.8. The only remaining Phase 6F step is 6F.6 (test-coverage hardening), which is blocked on a real failing sample — our fixture's custom-wrapper test shape already produces
covered-byedges, so the field's "1 edge app-wide" failure comes from a variant we haven't seen yet.🤖 Generated with Claude Code