fix(graph): grow the placement band and canvas with the library - #818
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Blocked merge diagnosis — blocked |
GitNexus Review · PR #818GitNexus reviewed 8 changed files. 🤖 Agent context — 19 symbols · 8 filesSummaryThis appears to be a concentrated graph UI and layout change, with substantial edits in node placement logic and supporting viewport coverage. Its reach is shallow in dependents, but the CRITICAL classification and multiple affected flows warrant close review of layout behavior and canvas fitting. 🔴 CRITICAL blast radius. A graph-view and node-placement change centered on The change is concentrated in the
What changedSymbol Changes (19)
Changed Files (8)
What it affectsArchitecture Impact
Blast Radius
Direct dependents (d1)
What to checkFile Risk (1)
Full detail lives in the GitNexus check run for this commit. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Amp-Thread-ID: https://ampcode.com/threads/T-01a0cf2b-5969-7627-bccd-702e8d30adda Co-authored-by: Amp <amp@ampcode.com>
8234c1e to
68dbb79
Compare
GitNexus Review · PR #818GitNexus reviewed 8 changed files. 🤖 Agent context — 19 symbols · 8 filesSummaryThis appears to be a concentrated graph UI and layout change, with updates spanning placement logic, viewport behavior, and coverage. The blast level is critical despite no graph dependents, so review should focus on the changed graph rendering and positioning paths. 🔴 CRITICAL blast radius. A graph-view frontend change centered on The change is concentrated in the Start with
What changedSymbol Changes (19)
Changed Files (8)
What it affectsArchitecture Impact
What to checkFile Risk (1)
Full detail lives in the GitNexus check run for this commit. |
GitNexus Review · PR #8182 issues found across 2 files. (target branch indexed; the incoming branch is not, so cross-branch structure came from the diff alone) 🤖 Agent context — 19 symbols · 8 filesSummaryThis appears to be a concentrated graph UI and layout change, with updates spanning placement logic, viewport behavior, and coverage. The blast level is critical despite no graph dependents, so review should focus on the changed graph rendering and positioning paths. 🔴 CRITICAL blast radius. A graph-view frontend change centered on The change is concentrated in the Start with
What changedSymbol Changes (19)
Changed Files (8)
What it affectsArchitecture Impact
What to checkFile Risk (1)
Prompt for AI agents (2 issues)Full detail lives in the GitNexus check run for this commit. |
Amp-Thread-ID: https://ampcode.com/threads/T-01a0cf2b-5969-7627-bccd-702e8d30adda Co-authored-by: Amp <amp@ampcode.com>

Closes the last follow-up from the plans/148 sweep (§6.3): "the placement band is small relative to the seed layout, so a large library crowds."
The defect was worse than crowding
plans/148 gave unseeded nodes a probe that keeps its distance from every placed node, and measured click-safe spacing from the label geometry (80px). But the band it probes inside is fixed at 600×400, and once that band saturates the probe falls back to "most clearance" — which can be closer than click-safe. So the wrong-entity selection plans/148 fixed returns for larger libraries. Measured with 8 seed nodes + 40 new entities:
Two halves, and the second is what makes the first safe
graph-layout.ts).placementBand(count)doubles its area per tier (√2 per axis) until it holds the library at the preferred spacing: 6 → 12 → 24 → 48 entities. Positions stay stable inside a tier.graph-viewport.ts, new). The view hard-codedviewBox="0 0 800 560". Left that way, a grown band is not crowded but invisible — the mutation check measured 56 of 60 nodes drawn outside the canvas, where they cannot be clicked or even panned to, since the viewBox never grows.canvasSize(nodes)returns the authored canvas or the smallest canvas containing every node and its label;canvasViewBoxcomposes it with the existing zoom/pan state, so Home always shows the whole graph. No new control and no new strings.This also covers the
circularandhierarchicallayouts, which place nodes on their own grid and already exceeded 800×560 at ~25 entities.Verification
0 0 800 560→ component test fails (expected 800 to be greater than 800) and the E2E reports 56 nodes outside the canvas.pnpm exec playwright test --project=chromium— 151 passed (2.3 m), including two newe2e/graph-density.spec.tstests (60 entities seeded through the persist envelope)../scripts/quality_gate.sh— all gates passed.Trade-off stated plainly in
plans/152§5: a large graph now renders at reduced scale (fit-to-content); detail comes from zooming in, and the alternative is the wrong-entity click.📝 Summary by GitNexus
Summary
This appears to be a concentrated graph UI and layout change, with updates spanning placement logic, viewport behavior, and coverage. The blast level is critical despite no graph dependents, so review should focus on the changed graph rendering and positioning paths.
🔴 CRITICAL blast radius. A graph-view frontend change centered on
src/lib/studio/graph-layout.tsandsrc/components/studio/views/graph-view.tsx, reaching 9 affected flows.The change is concentrated in the
Studiomodule, with related impact inViews. It updatesGraphViewandvisibleNodesinsrc/components/studio/views/graph-view.tsx, alongside graph placement logic includingplaceGraphNodes,resolveNodePosition,probeForClearance,clearance, andclampinsrc/lib/studio/graph-layout.ts.Start with
src/lib/studio/graph-layout.ts, which contains the hottest concentration of changed symbols. Review the placement bounds and distance constants, includingPREFERRED_NODE_DISTANCE_PX,CLICK_SAFE_NODE_DISTANCE_PX,PLACEMENT_Y_MAX,PLACEMENT_Y_MIN, andPLACEMENT_X_MAX, together withprobePositionandbaseNodePosition. Then verify the resulting graph behavior throughsrc/lib/studio/graph-layout.test.ts,src/lib/studio/graph-viewport.test.ts,src/components/studio/views/graph-view.test.tsx, ande2e/graph-density.spec.ts.Added by GitNexus for PR #818. Edit freely — this block is replaced on the next review, everything above it is left untouched.