Skip to content

Give the explorer an honest window: totals, most-connected-first, files view, and expansion - #38

Merged
Phoenixrr2113 merged 1 commit into
mainfrom
feat/graph-window
Aug 22, 2026
Merged

Phoenixrr2113 merged 1 commit into
mainfrom
feat/graph-window

Conversation

@Phoenixrr2113

Copy link
Copy Markdown
Owner

What this changes

The explorer showed an arbitrary 300 nodes of a graph that can hold tens of thousands, with no indication of the whole. Now:

  • Honest window: a visible N of M for nodes and edges in the current scope, a window-size control (300 / 500 / 1,000) persisted like project selection, and a deterministic most-connected-first ordering with a stable tiebreak. Degree is persisted at index time so ordering is not a per-request aggregation.
  • Files view: a file-level graph (this repo: 524 files, 410 import edges, 37 ms) as the default overview, with drill-down from a file into its symbols and true per-collection totals with truncation flags.
  • Expand on demand: double-click or a keyboard action fetches a node's neighbors and merges them without duplicates, marking truncation; Back and Forward restore the exact canvas view; Reset returns to the base window.
  • One node per file path: a real File and a leftover External stub (created when an import was unresolved) used to coexist for the same path, silently underfilling windows and splitting identity; upserting the real file now upgrades the stub while preserving its inbound edges.
  • Re-export hops now appear as file-level IMPORTS edges, so barrels show their real dependencies.

Review

Two adversarial rounds plus a profiling pass. Round one found four blockers (underfilled window, missing re-export hops, drill-down claiming completeness past its cap, Back as a no-op) and a pathological full window (5.8 s, 2.6 MB). The dominant cost was a scoped edge total using an IN predicate over 19,000 identities, now 56 ms. Round two: all-clear on correctness, hostile cases (many importers before the target exists, sibling-prefix scopes, five-call determinism), and navigation.

Measured on this repository's index (18,952 scoped nodes)

Full window at 1,000: 524 ms, 757 KB, 1,000 nodes, 2,299 induced edges. Files: 37 ms. Hub neighbors: 77 ms.

Verification

pnpm turbo build 21/21, test 36/36, typecheck 20/20. Graph 158 tests, core 283.

Ledger

  • Under 500 ms cold needs graph-client warmup at API startup (warm path is 335 ms).
  • Under 500 KB needs a compact edge wire format (node-index edges); the string contract has a measured floor above it.

🤖 Generated with Claude Code

…es view, and expansion

The canvas used to show an arbitrary 300 nodes with no sign of the
whole. The window is now deterministic and labelled: most-connected
first with a stable tiebreak, exact scope totals, and a window-size
control up to the API cap, persisted like project selection. A Files
view shows the file-level graph (hundreds of nodes, a real overview),
with drill-down from a file into its symbols and true counts on every
list. Double-click or a keyboard action expands a node's neighbors,
merged without duplicates and marked when capped; Back and Forward
restore the exact canvas view; Reset returns to the base window.

Review drove out what the first version hid: the window underfilled
because the graph held two nodes per imported-then-indexed file (a real
File and a leftover External stub), now merged into one at index time;
barrel re-export hops were missing from the file graph; drill-down
claimed completeness past its cap; Back after expansion did nothing;
and the full window took 5.8 seconds and 2.6 MB at the cap. A scoped
edge total over 19,000 identities was the real cost; it is 56 ms now,
and the window returns in about half a second at 757 KB with a trimmed
per-node payload. Degree is persisted at index time.

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

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
v0-landing-page-build Skipped Skipped v0 Aug 22, 2026 6:28pm

@Phoenixrr2113
Phoenixrr2113 merged commit 7421b0a into main Aug 22, 2026
12 checks passed
@Phoenixrr2113
Phoenixrr2113 deleted the feat/graph-window branch August 22, 2026 18:40
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