Skip to content

feat(schema): rich node cards on the fullscreen lineage graph (#47, PR1)#48

Merged
BorisTyshkevich merged 1 commit into
mainfrom
feat/issue-47-rich-schema-cards
Jun 26, 2026
Merged

feat(schema): rich node cards on the fullscreen lineage graph (#47, PR1)#48
BorisTyshkevich merged 1 commit into
mainfrom
feat/issue-47-rich-schema-cards

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What & why

PR1 of #47 — enrich the full-screen schema-lineage graph with rich per-table cards, leaving the inline (compact) data-pane graph untouched. The generator we're matching uses Cytoscape + 3 plugins; we reimplement the ideas on the existing dagre + inline-SVG renderer to stay within CLAUDE.md's two-runtime-dep budget and the 100%-per-file coverage model.

Fullscreen nodes are now cards showing engine · rows · compressed-bytes plus the top-16 columns with PK / SK / PARTITION / SAMPLING badges and a skip-index line. The rich dataset is fetched lazily on Expand — the inline graph's shape and behavior are frozen.

Changes

File What
src/core/schema-cards.js (new, pure, 100%) buildCardModel / cardSize / columnRoles / buildCardGraph. Deterministic geometry (no DOM measurement) so dagre sizes cards and happy-dom tests them.
src/net/ch-client.js Lineage query also selects total_rows/total_bytes + partition/sorting/primary/sampling keys; new loadSchemaCards() pulls system.columns + system.data_skipping_indices via the tryQueryData best-effort seam (graceful on denial / older ClickHouse). The two reads run concurrently.
src/core/dot-layout.js dagreLayout honors explicit node w/h (cards), else label-width + fixed height (pipeline/inline) — regression-safe.
src/ui/explain-graph.js Rich card SVG renderer; openSchemaFullscreen draws cards; shared graphSvgWithEdges scaffold for the plain + rich renderers.
src/ui/app.js, src/ui/results.js New expandSchemaGraph(focus) action (parallel lineage + cards load, toast on failure); Expand button rewired.
src/styles.css Card / badge / divider classes.

Tests

New schema-cards.test.js + extended ch-client / dot-layout / explain-graph / app / results specs. 906 tests pass; per-file coverage gate green.

Review

Ran a high-effort multi-angle review (correctness, removed-behavior, cross-file, reuse, efficiency, altitude, conventions). No correctness bugs survived verification; applied the cleanup/efficiency/UX findings (parallelized the card reads, de-duplicated the SVG scaffold, centralized card vertical metrics into CARD.*, added expand-failure feedback).

Deploy / verify

Deployed to github.demo (user_files/github-play-sql.html, no restart). Inline graph unchanged; fullscreen Expand shows the rich cards. Cross-DB referenced nodes render header-only here — the transitive cross-DB walk + node detail pane land in PR2.

Closes part of #47 (PR1; PR2 to follow).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XmDqY6Bxf5b1fyQE8XwA2u

Enrich the FULL-SCREEN schema-lineage graph with per-table cards while
leaving the inline (compact) data-pane graph untouched. This is PR1 of
issue #47 (parity with the system-audit generator); PR2 adds the
transitive cross-DB walk + node detail pane.

Implemented on the existing dagre + inline-SVG renderer rather than
adopting the generator's Cytoscape stack, to stay within CLAUDE.md's
two-runtime-dep budget and the 100%-per-file coverage model.

- src/core/schema-cards.js (new, pure): buildCardModel / cardSize /
  columnRoles / buildCardGraph. Deterministic geometry (no DOM
  measurement) so dagre can size cards and happy-dom can test them.
- src/net/ch-client.js: lineage query also selects total_rows/total_bytes
  and partition/sorting/primary/sampling keys; new loadSchemaCards() pulls
  system.columns (key-role flags) + system.data_skipping_indices via the
  tryQueryData best-effort seam (graceful on denial / old ClickHouse).
- src/core/dot-layout.js: dagreLayout honors explicit node w/h (cards),
  else falls back to label-width + fixed height (pipeline/inline).
- src/ui/explain-graph.js: rich card SVG (title, engine/rows/bytes header,
  divider, columns with PK/SK/PARTITION/SAMPLING badges, +N more, skip-index
  line); openSchemaFullscreen now draws cards. Shared graphSvgWithEdges
  scaffold across the plain + rich renderers.
- src/ui/app.js + results.js: new expandSchemaGraph(focus) action loads the
  enriched dataset (lineage + cards in parallel) and opens the overlay;
  Expand button rewired to it, with a toast on load failure.
- src/styles.css: card / badge / divider classes.

Tests: new schema-cards.test.js + extended ch-client/dot-layout/explain-graph/
app/results specs. 906 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
@BorisTyshkevich BorisTyshkevich merged commit f02f1d8 into main Jun 26, 2026
4 checks passed
@BorisTyshkevich BorisTyshkevich deleted the feat/issue-47-rich-schema-cards branch June 26, 2026 13:48
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