Skip to content

feat(schema): transitive cross-DB lineage + node detail pane (#47, PR2)#50

Merged
BorisTyshkevich merged 2 commits into
mainfrom
feat/issue-47-detail-pane
Jun 26, 2026
Merged

feat(schema): transitive cross-DB lineage + node detail pane (#47, PR2)#50
BorisTyshkevich merged 2 commits into
mainfrom
feat/issue-47-detail-pane

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What & why

PR2 of #47 — the second half of the schema-graph parity work, on top of #48 (PR1, now merged). The fullscreen graph now walks lineage transitively across database boundaries and a clicked node opens a detail pane. Reimplemented on the existing dagre + inline-SVG renderer (no Cytoscape), per CLAUDE.md.

Note: supersedes #49, which GitHub auto-closed when the PR1 branch was deleted on merge. Same commit, now targeting main.

Changes

File What
src/core/schema-graph.js node() now takes explicit db/name (threaded via zip/rowId) so a dotted database name survives, not just a dotted table. New pure expandLineage(graph, seedDb, {cap}) — undirected BFS both directions across DB boundaries, 600-node soft cap → truncated, tags external = db !== seedDb. New externalDbs.
src/net/ch-client.js loadLineageTransitive — loads each frontier of referenced DBs concurrently, merges rows, stops at dbCap/nodeCap (→ truncated). loadTableDetail — full columns (key flags + compression sizes), per-partition sums, DDL; best-effort via tryQueryData, three reads in parallel.
src/ui/schema-detail.js (new) openDetailPane — resizable strip in the overlay: columns / keys / partitions / DDL + "Insert SHOW CREATE"; drag-resize clamped (measured once per drag); reuses columnRoles.
src/ui/explain-graph.js External nodes render dimmed/dashed (.eg-node--ext); fullscreen node-click opens the detail pane (openNodeDetail); truncation banner in the bar.
src/core/dot-layout.js Pass external through the layout (alongside kind/db/name).
src/ui/app.js expandSchemaGraphloadLineageTransitiveexpandLineageloadSchemaCards(reachedDbs), surfacing truncated; new openNodeDetail(node).
src/styles.css .eg-node--ext, .graph-overlay-note, .schema-detail*.

Tests

New schema-detail.test.js + extended schema-graph / ch-client / dot-layout / explain-graph / app specs (expandLineage BFS/cap/both-directions/dotted-DB, transitive concurrent loader, detail pane resize/close/insert/sections, external styling through layout, truncation banner). 930 tests pass; per-file coverage gate green.

Review

High-effort multi-angle review (correctness / removed-behavior / cross-file / reuse / efficiency / altitude / conventions). No correctness bugs survived — the MV implicit-.inner node is provably created with valid parts (the undefined-arg path only hits an already-existing node). Applied the efficiency/altitude findings: concurrent frontier loads (was one-DB-at-a-time), external through the layout (dropped a side-channel), measure-once resize.

Deploy

Deployed to github.demo (user_files/github-play-sql.html, no restart). Drag a DB → Expand: rich cards, external-DB objects dimmed/dashed, truncation banner on large graphs, click a node → detail pane (columns/keys/partitions/DDL + Insert SHOW CREATE).

Closes #47 (together with #48).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XmDqY6Bxf5b1fyQE8XwA2u

BorisTyshkevich and others added 2 commits June 26, 2026 15:45
Second half of issue #47, stacked on PR1 (#48). The fullscreen schema graph
now walks lineage transitively across database boundaries and a clicked node
opens a detail pane — reaching parity with the system-audit generator.

- src/core/schema-graph.js: node() takes explicit db/name (threaded via zip/
  rowId) so a dotted *database* name stays intact, not just a dotted table. New
  pure expandLineage(graph, seedDb, {cap}) — undirected BFS in both directions
  across DB boundaries, 600-node soft cap -> truncated, tags external = db !==
  seedDb. New externalDbs(graph, loaded).
- src/net/ch-client.js: loadLineageTransitive() loads each frontier of referenced
  databases concurrently, merging rows, until none new or a db/node cap is hit
  (-> truncated). loadTableDetail() pulls full columns (key flags + compression
  sizes), per-partition part/row/byte sums, and DDL — all best-effort via
  tryQueryData, three reads in parallel.
- src/ui/schema-detail.js (new): openDetailPane() — a resizable strip docked in
  the overlay with the columns / keys / partitions / DDL and an "Insert SHOW
  CREATE" action; drag-resize clamped, measured once per drag; reuses columnRoles.
- src/ui/explain-graph.js: external nodes render dimmed/dashed (.eg-node--ext,
  carried through dagreLayout); fullscreen node-click opens the detail pane
  (openNodeDetail) instead of inserting DDL; truncation banner in the overlay bar.
- src/core/dot-layout.js: pass `external` through the layout (with kind/db/name).
- src/ui/app.js: expandSchemaGraph rewired to loadLineageTransitive -> expandLineage
  -> loadSchemaCards(reachedDbs), surfacing truncated; new openNodeDetail(node).
- src/styles.css: .eg-node--ext, .graph-overlay-note, .schema-detail* classes.

Reviewed at high effort (8 angles); no correctness bugs survived. Applied the
efficiency/altitude findings: concurrent frontier loads, external through the
layout (dropping a side-channel), measure-once resize.

Tests: new schema-detail.test.js + extended schema-graph / ch-client /
dot-layout / explain-graph / app specs. 930 tests pass; per-file coverage gate
green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmDqY6Bxf5b1fyQE8XwA2u
CI's v8 branch counter put explain-graph.js at 89.91% (just under the 90%
floor) where local was 90.0% — the config notes v8 branch counting is
platform-sensitive. Add inline + fullscreen tests that click an external
(ext:) leaf and assert it's a no-op, covering the startsWith('ext:') guard in
schemaClick/schemaDetailClick. Lifts branches to 91.66%.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmDqY6Bxf5b1fyQE8XwA2u
@BorisTyshkevich BorisTyshkevich merged commit f8fa873 into main Jun 26, 2026
4 checks passed
@BorisTyshkevich BorisTyshkevich deleted the feat/issue-47-detail-pane branch June 26, 2026 13:53
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.

Schema lineage full-screen: rich node cards, cross-DB transitive lineage & a detail pane (parity with system-audit)

1 participant