Repository navigation
Graph renderer: wrap wide fan-outs into blocks, and lay out large graphs faster - #272
Merged
Merged
Conversation
agorischek
force-pushed
the
graph-wide-fanouts
branch
from
December 2, 2026 02:36
9d2b70e to
024a197
Compare
agorischek
added a commit
that referenced
this pull request
Dec 2, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
agorischek
force-pushed
the
graph-wide-fanouts
branch
from
December 2, 2026 09:15
024a197 to
14158b2
Compare
agorischek
marked this pull request as ready for review
December 2, 2026 19:03
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
What changed in this PR
This PR enhances the graph renderer’s scalability by collapsing large sets of “relationship-identical” sibling cards into blocks (with shared routing) and by reducing routing/crossing work for large graphs, while also adding fixtures/tests/docs to validate and demonstrate the behavior.
Changes:
- Add sibling “block” support across layout, routing, transitions, rendering, CSS, and browser invariants (including
GraphLayout.blocks, frameblocks, andedgeEnd). - Optimize routing/crossing computation paths and add performance regression tests for wide fan-outs and large graphs.
- Add new graph scenarios/fixtures and documentation updates describing blocks and the new APIs.
| File | Description |
|---|---|
| packages/renderers/kit/test/performance.test.mjs | Adds perf regression tests for block fan-outs and large graphs. |
| packages/renderers/kit/test/layout.test.mjs | Updates layout invariants/tests to account for blocks and tray endpoints. |
| packages/renderers/kit/styles/graph.css | Styles for block trays/captions and “receded” appearance. |
| packages/renderers/kit/src/routes/courses.ts | Makes route sampling lazy based on bounds intersection to reduce work. |
| packages/renderers/kit/src/react/graph-canvas/laid-out-graph.tsx | Renders block trays and passes block membership into link drawing. |
| packages/renderers/kit/src/react/graph-canvas/graph-link.tsx | Uses tray endpoints for block member edges; adds data attributes for block endpoints. |
| packages/renderers/kit/src/react/graph-canvas/framing.ts | Includes blocks in framing/fit computations. |
| packages/renderers/kit/src/react/graph-canvas/block-tray.tsx | New component to draw a block tray + caption with change counts. |
| packages/renderers/kit/src/layout/routing/trunk-moves.ts | Reduces neighbor checks by track bucketing. |
| packages/renderers/kit/src/layout/routing/ports.ts | Adds special port placement for block in-faces. |
| packages/renderers/kit/src/layout/routing/converge.ts | Limits swap checks after staggers are exhausted. |
| packages/renderers/kit/src/layout/routing/context.ts | Factors clearance into dedicated module and adds cardsNear. |
| packages/renderers/kit/src/layout/routing/clearance.ts | New spatial index for clearance checks and nearby-card queries. |
| packages/renderers/kit/src/layout/routing/bundles.ts | Avoids rebuilds when runs unchanged; caches samples/crossings. |
| packages/renderers/kit/src/layout/routing/build.ts | Uses cardsNear to limit blocking-card scans for gap discovery. |
| packages/renderers/kit/src/layout/model.ts | Adds GraphLayout.blocks and GraphLayoutOptions.blocks. |
| packages/renderers/kit/src/layout/layout-graph.ts | Incorporates options.blocks into layout cache key inputs. |
| packages/renderers/kit/src/layout/lay-out.ts | Integrates block arrangement/placement/routing into layout pipeline. |
| packages/renderers/kit/src/layout/grid.ts | Adds cardBreadth helper for block/grid pitch decisions. |
| packages/renderers/kit/src/layout/elk-input.ts | Computes sibling blocks, replaces block members with a synthetic ELK node, and routes edges “as the block”. |
| packages/renderers/kit/src/layout/blocks.ts | New block grouping + arrangement logic (blockMinimum, IDs, grid wrapping). |
| packages/renderers/kit/src/layout/block-layout.ts | New block placement + route projection back to card edges. |
| packages/renderers/kit/src/layout.ts | Exposes blockMinimum and LayoutBlock. |
| packages/renderers/kit/src/index.ts | Exposes edgeEnd from the kit entrypoint. |
| packages/renderers/kit/src/graph-transition/layouts.ts | Propagates reference blocks through transition steps. |
| packages/renderers/kit/src/graph-transition/frame.ts | Adds frame-level block interpolation via frameBlocks. |
| packages/renderers/kit/src/graph-transition/diff-frame.ts | Includes blocks in diff frames. |
| packages/renderers/kit/src/graph-transition/crossing.ts | Uses cell-based lookup to reduce morph card intersection tests. |
| packages/renderers/kit/src/graph-transition.ts | Adds TransitionBlock and frame blocks. |
| packages/renderers/kit/src/graph-canvas/view-change.ts | Shifts/morphs blocks along with nodes/edges. |
| packages/renderers/kit/src/graph-canvas/fan-in.ts | Counts block member routes once for hub-width calculation. |
| packages/renderers/kit/src/graph-canvas/edges.ts | Adds edgeEnd helper for tray endpoints (no scale). |
| packages/renderers/kit/browser/invariants/frame.ts | Treats block trays like boundaries for overlap/target checks. |
| packages/renderers/kit/browser/invariants/contacts.ts | Targets arrow contacts against block trays when applicable. |
| packages/renderers/kit/browser/fixtures.ts | Adds wideFanOut fixture for block behavior. |
| packages/renderers/graph/scenarios.json | Adds the MCP tools scenario to scenarios list. |
| packages/renderers/graph/fixtures/module-graph-large-before.json | Adds large module graph fixture (before) for perf coverage. |
| packages/renderers/graph/fixtures/module-graph-large-after.json | Adds large module graph fixture (after) for perf coverage. |
| packages/renderers/graph/fixtures/make-module-graphs.mjs | Updates fixture generator to produce the large graph. |
| packages/renderers/graph/fixtures/make-mcp-tools.mjs | New generator for MCP tools scenario fixtures. |
| packages/renderers/graph/browser/graph.spec.ts | Adds Playwright coverage for block tray routing and membership. |
| packages/renderers/graph/README.md | Documents block behavior in the graph renderer. |
| eslint-suppressions.json | Updates suppression counts after refactors. |
| docs/reference/renderers.md | Adds MCP scenario mention in renderer reference. |
| docs/reference/renderer-kit.md | Documents new APIs (blockMinimum, LayoutBlock, TransitionBlock, edgeEnd, frame blocks). |
| docs/guides/renderer-kit-graphs.md | Adds guide section explaining sibling blocks and data attributes. |
| changelog.d/272.md | Changelog entry for renderer behavior + perf improvements. |
| changelog.d/272-kit.md | Changelog entry for kit API additions around blocks. |
Review effort: Lite
…hs faster Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… the tray; browser coverage Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ths, tests Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
agorischek
force-pushed
the
graph-wide-fanouts
branch
from
December 2, 2026 19:34
6c1d7d6 to
eb7b87a
Compare
3 tasks done
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.

Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
eb7b87a03ad2d119d57089dc2b0fccf3225fc6e0main, both orientations (compared point by point and route by route).↑ Screenshots of service platform, its dark mode, Terraform and npm workspace are pixel-identical to
main.↑ CI passes on this revision (45 checks). Two browser shards timed out on slow runners in the first attempt and passed on rerun; locally the graph arrowheads test takes 33 s of its 360 s budget.
↑ Copilot review raised one issue (a mutated
ReadonlyMap), fixed and resolved.↓ The MCP scenario's built-in checks take about 76 s locally against a 360 s CI budget, so a very slow runner can still time them out.
↓ The few-hundred-node graph is about 2× faster but a full transition still takes about 17 s in Node.
What changed
The shared graph renderer handles wide fan-outs and large graphs. Prompted by the GitHub MCP Server's "MCP tools, toolsets and OAuth scopes" projection (github/github-mcp-server#3719), where the
copilot_automationstoolset's 11 new tools stood in one row far wider than the screen, each routed separately into thereposcope.Sibling blocks (
packages/renderers/kit/src/layout/blocks.ts,block-layout.ts). Six or more cards (blockMinimum) that share every relationship (same sources and targets, same kinds, drawn the same way) wrap into a block:11 tools +11), in the summary bar's style.GraphLayoutOptions.blocks). Trays fade with their most visible card and never scale. Framing includes trays.fanInWidthscounts a block's routes into a hub once, sorepono longer grows 4× for routes that now arrive as a few.Performance, profiled first. One MCP layout took 72 s. 57 s of it was
untangleConvergingtesting every pair of the 120 routes converging onrepo, round after round. Changes:crossingMorphsindexes where cards sweep.main(checked point by point and route by route).Fixtures and scenarios.
graph/mcp-toolsis generated from the server's publiclist-scopesinventory (fixtures/make-mcp-tools.mjs): 150 tools, 23 toolsets, 12 scopes, withcopilot_automationsand its 11 tools added.module-graph-large(320 modules) is for the performance budget. Graph browser fixturewideFanOutadds an animated case.Not in this PR: folding a very large block into one expandable stack card. The tray keeps big groups readable for now, and a fold can build on
GraphLayout.blockslater.Evidence
tools check --fastandtools check --affectedpass. The affected build gate neededhost-vscodebuilt first, which is unrelated to this change.tools test --affectedpasses. New kit tests: blocks wrap and route as one, mixed bundles stay apart, a transition keeps the union's block IDs, crossing budgets for the MCP hub and for 320 cards.Graph browser suites (chromium-desktop): 57 passed, including dense scrubbing of
wideFanOutin both orientations. The frame invariants now judge a block's arrowheads against its tray.Built-in renderer checks pass for every
graph/*scenario on chromium-desktop, chromium-mobile and webkit-desktop.Scrubbed
wideFanOutandmcp-toolsframes (0 to 1) and reviewed the images. Before and after screenshots (desktop, dark, 390 px) were shared with the coordinator.Documentation that this change affects is updated (graph README, renderer kit graphs guide).
Fixes include a regression test.
No credentials, private source or machine-specific paths are included.