Skip to content

Conversation

@nvandessel
Copy link
Owner

Summary

  • Add scripts/screenshot.js — standalone Puppeteer script for capturing HTML graph screenshots as PNG
  • Add Makefile targets: graph-html, graph-screenshot, graph-preview for single-command visual iteration
  • Puppeteer auto-installs into build/node_modules on first run (no package.json needed)
  • Uses GOWORK=off to support building from git worktrees
  • All output goes to build/ (gitignored)

Test plan

  • make graph-html generates build/graph/graph.html
  • make graph-screenshot generates build/graph/graph.png
  • make graph-preview runs full pipeline
  • make clean removes build/ directory
  • build/ does not appear in git status

nvandessel and others added 6 commits February 10, 2026 17:57
Add RenderHTML() and RenderEnrichedJSON() to the visualization package,
producing a self-contained HTML file with an embedded force-directed graph.
Uses force-graph v1.51.1 (MIT) via go:embed for offline-capable, zero-server
visualization. Nodes are colored by behavior kind (Catppuccin Mocha palette),
sized by PageRank + degree, with hover tooltips and click detail panels.

Includes OpenBrowser() cross-platform utility, embedded assets/templates,
and comprehensive tests for enriched JSON, HTML rendering, and edge collection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add --format html, --output/-o, and --no-open flags to floop graph command.
Computes PageRank for node sizing, generates self-contained HTML, writes to
file, and opens in default browser. MCP floop_graph handler also supports
html format using cached PageRank scores.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Much stronger charge repulsion (-1000 - 20*N) to spread nodes apart
- Very weak link force (0.02) so edges don't pull everything into a blob
- Smaller node radii (sqrt(val)*2.5) to reduce overlap
- Labels only render at very high zoom (>8x), keeping overview clean
- Brighter edge color and wider strokes for visibility
- Zoom-to-fit capped at 1x to ensure overview perspective
- Multiple zoom-to-fit calls as simulation settles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Detail panel now shows canonical behavior content when clicking a node
- Edge colors match their kind (blue=requires, red=overrides/conflicts,
  green=learned-from, purple=merged-into, gray=similar-to)
- Added merged-into edge type to legend and styling
- Increased link strength (0.02→0.08) so connected nodes cluster better
- Added test for canonical content in enriched JSON
- Fix click event: debounce background click to prevent panel dismissal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Return HTML content directly as string instead of writing to temp file
  in MCP handler, eliminating orphaned temp file accumulation
- Populate EdgeCount in MCP HTML output (was defaulting to 0)
- Pass file path directly to OpenBrowser instead of constructing fragile
  file:// URL that breaks on paths with spaces
- Export CollectEdges for reuse by MCP handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Puppeteer-based screenshot script and Makefile targets for
single-command graph visualization capture. Puppeteer auto-installs
into build/node_modules on first run (no package.json needed).

Targets: make graph-html, graph-screenshot, graph-preview
Uses GOWORK=off to support building from git worktrees.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

This PR adds development tooling for capturing screenshots of HTML graph visualizations. It introduces a standalone Puppeteer script (scripts/screenshot.js) and three new Makefile targets (graph-html, graph-screenshot, graph-preview) that enable single-command iteration on graph visuals. The implementation uses GOWORK=off to support git worktrees and auto-installs Puppeteer dependencies into build/node_modules without requiring a package.json in the root directory.

Key changes:

  • New scripts/screenshot.js with configurable viewport dimensions and wait time for force-graph physics
  • Makefile targets that compose: generate HTML → capture screenshot → preview pipeline
  • Added build/ directory to .gitignore to keep all artifacts out of version control
  • Clean target updated to remove build/ directory

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are isolated to development tooling, properly gitignored, and follow clean patterns. The Puppeteer script has appropriate error handling, the Makefile targets are well-composed with proper dependencies, and GOWORK=off ensures compatibility with git worktrees. Test plan confirms all targets work as expected.
  • No files require special attention

Important Files Changed

Filename Overview
.gitignore Added build/ directory to gitignore for dev artifacts
Makefile Added three graph visualization targets with auto-installing puppeteer and GOWORK=off support
scripts/screenshot.js Standalone Puppeteer script with configurable viewport and wait time for graph physics

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Make as Makefile
    participant Go as Go Build
    participant Floop as floop CLI
    participant Node as Node.js
    participant Puppeteer as Puppeteer

    Dev->>Make: make graph-preview
    Make->>Make: mkdir -p build/graph
    Make->>Go: GOWORK=off go build
    Go-->>Make: ./floop binary
    Make->>Floop: ./floop graph --format html --no-open
    Floop-->>Make: build/graph/graph.html
    Make->>Node: Check node installation
    Node-->>Make: node exists
    Make->>Node: npm install puppeteer (if missing)
    Node-->>Make: build/node_modules/puppeteer
    Make->>Node: NODE_PATH=build/node_modules node scripts/screenshot.js
    Node->>Puppeteer: Launch headless browser
    Puppeteer->>Puppeteer: Load file://build/graph/graph.html
    Puppeteer->>Puppeteer: Wait 2000ms for physics
    Puppeteer->>Puppeteer: Capture screenshot
    Puppeteer-->>Node: build/graph/graph.png
    Node-->>Make: Screenshot complete
    Make-->>Dev: Preview paths displayed
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@nvandessel nvandessel force-pushed the feat/graph-html-visualization branch from 03f1ca6 to 5c370b8 Compare February 11, 2026 16:10
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