Skip to content

Draw graph edges, settle the layout, and document the dashboard - #23

Merged
Phoenixrr2113 merged 4 commits into
mainfrom
fix/dashboard-graph-and-docs
Aug 20, 2026
Merged

Phoenixrr2113 merged 4 commits into
mainfrom
fix/dashboard-graph-and-docs

Conversation

@Phoenixrr2113

Copy link
Copy Markdown
Owner

Follow-up to #22, from actually exercising the dashboard UI rather than the API. Three real defects and the missing documentation.

Edges were bound to the wrong nodes, twice

Two independent bugs, one server side and one client side, both producing the same symptom: functions and interfaces rendered as a disconnected grid while only files appeared connected.

Server. getFullGraph resolved each edge endpoint with a check that tested filePath on its own first. Every function, class and interface in a file shares that path, so the lookup returned whichever node for the file came first, in practice the File node. The name comparison after the || could never run.

Client. The element mapping spread the payload's data object after setting id, and that object carries its own internal id for 208 of 235 nodes (every Function, Class, Interface and Variable). Their cytoscape ids were overwritten, so every edge referencing the real id was dropped as an orphan. Files and Types carry no inner id, which is exactly why only files looked connected.

Measured on the same graph afterwards: 152 of 152 functions and 41 of 41 interfaces connected, with all 300 edges rendering.

The layout never settled

cose runs numIter simulation steps, 1000 by default. Animating them left the graph drifting for many seconds, and nodes moved out from under the pointer faster than they could be clicked. Animating only the final transition was worse, because the viewport fit to the pre-layout positions and the graph settled off screen. Positioning without animation gives final coordinates immediately, so the fit and the hit testing are both correct.

Search results did not open the detail panel

Clicking a result highlighted the node but never selected it, so the panel stayed on its empty state. The result now flows through to selection. Since the search payload already carries filePath and line numbers, the signature, complexity metrics, parameters and syntax-highlighted source preview all render.

Documentation

The package installs codegraph-dashboard, which neither README mentioned. Both now cover what it is, how to start it from a checkout or the published package, that it serves the UI and REST API on one port, and that it is optional and never started by the MCP server.

Verification

  • 20 of 20 typecheck tasks, 32 of 32 test tasks
  • MCP tools exercised end to end against a real npm install of the tarball: all four groups respond, codebase stats returns 235 nodes, search find returns correct hits, query counts 152 functions
  • Dashboard checked in a browser: graph fits and holds still, edges render throughout, search result opens the detail panel with a highlighted source preview

🤖 Generated with Claude Code

Phoenixrr2113 and others added 3 commits August 19, 2026 20:29
getFullGraph matched each edge endpoint with a check that tested filePath on
its own before anything else. Every function, class and interface declared in a
file shares that path, so the lookup returned whichever node for the file came
first, in practice the File node. The name comparison that followed could never
run because the || had already short-circuited.

The effect was that edges collapsed onto File nodes and the real endpoints were
left with none, so the dashboard drew functions and interfaces as a
disconnected grid. Endpoints are now matched on name plus path, falling back to
the file itself only when the endpoint carries no name.

Measured on the same graph: every node type went from partially connected to
fully connected, including 152 of 152 functions and 41 of 41 interfaces.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… on search

Three defects found while exercising the UI rather than the API.

Node ids were being overwritten. The element mapping spread the payload's data
object after setting id, and that object carries its own internal id for 208 of
235 nodes, every Function, Class, Interface and Variable. Their cytoscape ids
were replaced, so every edge referencing the real id was treated as an orphan
and dropped. Files and Types carry no inner id, which is why only files ever
appeared connected. The spread now comes first.

The layout never settled. cose runs numIter simulation steps, 1000 by default,
and animating them left the graph drifting for many seconds, during which nodes
moved out from under the pointer and could not reliably be clicked. Animating
only the final transition was worse: the viewport fit to the pre-layout
positions and the graph settled off screen. Positioning without animation gives
final coordinates immediately, so both the fit and the hit testing are correct.

Clicking a search result highlighted the node but never selected it, leaving the
detail panel on its empty state. The result now flows through to selection, and
because the search payload already carries filePath and line numbers, the
signature, metrics and syntax-highlighted source preview all render.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The package installs a second binary that neither README mentioned, so it
shipped as a feature nobody could discover. Both now describe what the
dashboard is, how to start it from a checkout or from the published package,
that it serves the UI and the REST API on one port, and that it is optional and
never started by the MCP server. The environment variables that affect it are
listed, and the two new workspace packages are recorded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-landing-page-build Ready Ready Preview, v0 Aug 20, 2026 12:42am

@augmentcode

augmentcode Bot commented Aug 20, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR fixes dashboard graph rendering and improves its launch documentation.

  • Resolves graph edge endpoints by declaration identity instead of file path alone.
  • Preserves server-provided node IDs when converting data for Cytoscape.
  • Disables animated COSE layout so fitting and node selection occur at settled positions.
  • Makes search-result clicks populate the entity-detail panel with the result payload.
  • Documents the optional dashboard/API server and its environment configuration in both package READMEs.
Technical notes: The dashboard remains a separate binary from the MCP server and serves its static UI and REST API from one port.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread README.md
Raised in review on #23 and correct. npx resolves its argument as a package
name, and this binary ships inside codegraph-mcp, so "npx codegraph-dashboard"
would look for a package called codegraph-dashboard. No such package exists on
the registry, confirmed with npm view, so the documented quick start could not
have worked on a clean machine and the name is available for anyone to squat.

Both READMEs now name the package explicitly and show the global install form
alongside it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Phoenixrr2113
Phoenixrr2113 merged commit f775385 into main Aug 20, 2026
12 checks passed
@Phoenixrr2113
Phoenixrr2113 deleted the fix/dashboard-graph-and-docs branch August 20, 2026 00:49

This branch was successfully deployed

1 active deployment
Preview — 5948a452 Deployed Aug 20, 2026 by vercel[bot]
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