Skip to content

Fallout-branded build-graph control PoC (elkjs + React Flow) - #526

Draft
ChrisonSimtian wants to merge 4 commits into
Fallout-build:developfrom
ChrisonSimtian:feature/graph-control
Draft

ChrisonSimtian wants to merge 4 commits into
Fallout-build:developfrom
ChrisonSimtian:feature/graph-control

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Phase 1 PoC of a Fallout-branded, GitHub-Actions-style build/run graph control — the intended replacement for the VS Code extension's Mermaid graph, and the basis for the --plan HTML report and (eventually) the Fallout CI run graph.

Not a GitHub clone: its own dark radioactive-amber identity, tokens lifted from the logo assets.

Stack — layout and render kept as separate layers:

  • elkjs (layered, left-to-right) computes node positions — surface-independent.
  • React Flow (@xyflow/react) renders + handles pan/zoom/click.

How it fits Fallout

  • Consumes the existing build-graph.json schema. Edge semantics match Mermaid/--plan: solid = dependsOn, dashed = after, thick = triggers.
  • Host injects a real graph via window.__FALLOUT_GRAPH__; otherwise a demo fixture renders.
  • Optional per-target status is wired through the node now but reserved for the live phase — schema v1 omits it.
  • Vite + singlefile emits one self-contained dist/index.html — the same shape the static HTML report will take.

Scope — exploratory, lives under poc/; nothing shipped/wired yet (hence skip-changelog).

Try it

cd poc/graph-control && npm install && npm run dev

Next

  • Phase 2: wire into the extension (replace Mermaid in graphPanel.ts) + emit the static HTML report.
  • Phase 3: BuildManager streams per-target status → the control animates the run.

Phase 1 of replacing the extension's Mermaid graph with a Fallout-branded,
GitHub-Actions-style graph control. Deliberately not a GitHub clone — its own
dark radioactive-amber identity, tokens lifted from the logo assets.

Stack keeps layout and render as separate layers: elkjs (layered, left-to-right)
computes positions, React Flow renders + handles pan/zoom/click. The layout is
surface-independent so the same control can back the VS Code webview, the --plan
HTML report, and eventually the Fallout CI run graph.

- Consumes the existing build-graph.json schema (solid=dependsOn, dashed=after,
  thick=triggers); host injects a real graph via window.__FALLOUT_GRAPH__.
- Optional per-target status (running/succeeded/failed/…) is wired through the
  node now but reserved for the later live phase — schema v1 omits it.
- Vite + singlefile build emits one self-contained dist/index.html, the same
  shape the static HTML report will take.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian ChrisonSimtian added target/vCurrent Targets the current version skip-changelog Dont add to the Github Release Notes labels Jul 21, 2026
ChrisonSimtian and others added 2 commits July 21, 2026 13:27
Emits a single self-contained IIFE (dist-lib/fallout-graph-control.js) via
`npm run build:lib` — React, React Flow and elkjs bundled, CSS injected at
runtime — exposing FalloutGraph.mount(el, graph, { onRunTarget }). Hosts load it
as one <script>, the same way the extension loaded mermaid.

Re-calling mount on the same element reconciles in place, which is what drives
the extension's live refresh. dist-lib is gitignored (build artifact).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two defects the standalone demo build masked, both hit only when the control is
loaded as a plain <script> (the webview / HTML-report path):

- theme.css (which defines --fallout-yellow and the rest) was imported only by
  the demo entry, so the library bundle shipped control.css referencing tokens
  that weren't there — the embedded control rendered unstyled. Import it from
  GraphControl so the tokens travel with the control regardless of entry point.
- Vite library mode doesn't substitute process.env.NODE_ENV, so React's
  reference threw `process is not defined` in a browser <script> host. Define it
  in the lib config; the bundle now ships React's production build (and is
  ~300 KB smaller for it).

Verified by loading dist-lib via a <script> tag + FalloutGraph.mount — renders
branded with zero console errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian

Copy link
Copy Markdown
Collaborator Author
image there is also a darkmode version btw

`npm run report [build-graph.json] [out.html]` emits one self-contained HTML file
with the control's IIFE and the graph JSON inlined — double-clickable, offline,
no server. This is the shape the `fallout` --plan HTML report will take.

- Dark by default: the report pins data-theme="dark" so it stays dark regardless
  of the viewer's OS, with a toggle that remembers the choice in localStorage.
- theme.css now honours an explicit data-theme both ways (dark default, explicit
  light via data-theme="light", OS preference only when nothing is pinned) — the
  webview keeps following the editor theme since it pins nothing.
- The "click a target to run it" legend hint now shows only when a run handler is
  wired (the webview), not in a static report where there's nothing to run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ITaluone

ITaluone commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

@ChrisonSimtian I don't get it.. Where does this graph show up? IS this just a replacement of the --plan output?

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator Author

that too but its mainly going to show in extensions like the vs code extension im working on

@ITaluone

Copy link
Copy Markdown
Contributor

Ok

Curious, how that will look then :)

@ChrisonSimtian ChrisonSimtian added target/vNext Targets the next calendar-version target/vCurrent Targets the current version and removed target/vCurrent Targets the current version target/vNext Targets the next calendar-version labels Aug 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Dont add to the Github Release Notes target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants