Hierarchical graphs PR2+3: guest-visible demo hierarchy + drill-in navigation#60
Merged
Conversation
Adds an Altium-style hierarchy demo, visible to the guest account, that showcases high-performance / dynamic LOD via drill-in (the hierarchy is the LOD strategy — never render all ~2900 nodes at once). - services/hierarchyDemo.ts + scripts/create-hierarchy-demo.ts (npm run create-hierarchy-demo): idempotent, NON-destructive. Builds a "System Overview" graph of 16 sheet-symbol WorkItems, each with subgraphId + DRILLS_INTO a sub-graph; inter-sheet wires kept endpoint-local to the overview. 16 sub-graphs (one ~1000-node "Compute Core" perf showcase), totaling 2911 work items / 4073 edges. All createdBy:'system' isShared:true (guest-visible, read-only). Edge nodes carry both EDGE_SOURCE+EDGE_TARGET. - GraphContext.tsx: fresh-load default graph now picked by identity (Welcome, then System Overview) instead of array position — shared/system demo graphs no longer hijack the default view. (The seed surfaced this latent fragility.) Verified: 17 system/shared graphs, overview sheets resolve subgraph counts, big sub-graph = 1000 nodes, idempotent re-run skips; THE GATE 5/5. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Makes the "graphs of graphs" hierarchy navigable like Altium schematics. - GraphContext: descendInto(subgraphId) / ascendTo(graphId) / getBreadcrumb() (breadcrumb derived from the graph's path ancestors + itself). Added to the context type. - InteractiveGraphVisualization: a plain click on a sheet-symbol node (one with subgraphId) descends into its sub-graph, via a ref so the D3-bound handler isn't re-created. Grow/connect, drag, and edit/relationship icons are unaffected (handled earlier / stopPropagation). - Workspace: a breadcrumb bar (Up button + clickable ancestors) shown when inside a sub-graph. Verified by tests/diagnostics/hierarchy-navigation.spec.ts: System Overview (16 sheets) -> click descends into the 1000-node Compute Core sub-graph -> breadcrumb -> Up returns to the overview. Web typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🧪 Comprehensive Test Suite
Full-stack smoke gate runs in the CI workflow. |
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.
Builds on PR1 (#59, the
DRILLS_INTOschema). Delivers the Altium-style "graphs of graphs" experience end-to-end.Seed: guest-visible hierarchy demo (
npm run create-hierarchy-demo)services/hierarchyDemo.ts+ runner. Idempotent, non-destructive (unlikedb:seed):subgraphId+DRILLS_INTOa sub-graph; inter-sheet "wires" kept endpoint-local to the overview.createdBy:'system'+isShared:true→ visible to the guest account (read-only). Edge nodes carry bothEDGE_SOURCE+EDGE_TARGET.Navigation: drill-in / breadcrumb
GraphContext:descendInto/ascendTo/getBreadcrumb(breadcrumb derived from the graphpath).Workspace: a breadcrumb bar (Up + clickable ancestors) when inside a sub-graph.Why the hierarchy = the performance strategy
You never render all ~2900 nodes at once: the overview shows 16 sheets; descending loads one sub-graph (≤1000). This reuses the existing renderer instead of a canvas rewrite.
Also: fix fresh-load default graph
GraphContextnow picks the default graph by identity (Welcome → System Overview) instead of array position — the new shared/system demo graphs were hijacking the fresh-load view (caught by THE GATE).Verified
tests/diagnostics/hierarchy-navigation.spec.ts: overview (16 sheets) → click → descends into the 1000-node Compute Core sub-graph → breadcrumb → Up returns.Follow-up PR4: visual treatment for sheet nodes (distinct style + descend glyph + child counts).
🤖 Generated with Claude Code