fix(schema): draw every table in a whole-DB graph, linked or not#63
Merged
Conversation
The data-flow graph dropped tables that didn't participate in any view/MV/dictionary/Distributed relationship whenever the database had *some* lineage — so a database of mostly-standalone tables showed only the few linked boxes and hid the rest. Reverses that pruning: a whole-DB view now keeps every object as a node, drawing lineage edges between the linked ones and standalone cards for the rest (matching the no-relationships case, which already did this). Table-focus (1-hop neighbourhood) is unchanged — it's a deliberately scoped view. Cross-DB scoping in the full view is still handled by expandLineage, which seeds the focus DB and BFS-walks only the connected nodes of other databases, so this doesn't pull unrelated tables in from neighbouring databases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019kE9qbgBNBrfNgwg9fRsMJ
…db prefix Two UX refinements on the whole-DB graph: - Lay the connected lineage out first and grid the edge-less "single" tables beneath it (new `isolatedLast` option on dagreLayout, used by both the inline preview and the full view), instead of dagre ranking the orphans across the top. - Drop the redundant "<db>." prefix from a node's label when it's in the focused database; nodes from another database keep their qualified id so the cross-DB origin stays visible. Applied once in buildSchemaGraph, so both the inline short view and the full-view cards pick it up. ids/edges (and click-to-SHOW-CREATE) are unaffected — only the display label changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019kE9qbgBNBrfNgwg9fRsMJ
BorisTyshkevich
added a commit
that referenced
this pull request
Jun 28, 2026
Schema data-flow graph improvements (#63): the whole-DB graph now draws every table (linked or not), packs the unlinked "single" tables into a grid below the lineage, and drops the redundant "<db>." prefix from node labels for objects in the focused database (cross-DB nodes stay qualified). No new runtime deps. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019kE9qbgBNBrfNgwg9fRsMJ
BorisTyshkevich
added a commit
that referenced
this pull request
Jun 28, 2026
Code-review follow-ups for the zoom-bridge (#62) and schema-graph (#63) PRs. Correctness / behavior: - ch-client: the transitive-lineage nodeCap now counts only *linked* nodes, not every standalone table — so a single large DB of mostly-unrelated tables no longer truncates on round 1 and skips its cross-DB lineage walk (#63 review). - schema-graph: guard the db-prefix label strip with `&& n.name` so a node with an empty name can't be rewritten to a blank title (#63 review). Altitude / cleanup: - dot-layout: split the schema-specific "lineage first, singles gridded below" policy out of the generic dagre wrapper into a dedicated `schemaLayout()`; `dagreLayout` reverts to its plain generic form (no opts). Drops the dead `usedCols` (== cols) term and the always-built `connected` set on the pipeline path (#62/#63 review). - dom: extract the fixed-popover anchor recipe (divide client coords by the zoom) into a pure, 100%-covered `fixedAnchor()` helper; the File menu and the Save/user popover now share it instead of hand-transcribing the math — which also moves the previously-untested anchoredPopover arithmetic under test (#62). - app: simplify `dragCtx.scale` to report the page zoom without the redundant per-axis ternary (dragValue already ignores scale for the % axes) (#62). - dom: note in zoomScale that the measured element is immaterial (page-global) (#62). Tests added for schemaLayout (grid extent + no-lineage + no-singles + empty), fixedAnchor (both corners + floors), the ·inner label-skip, and the linked-only nodeCap. All 1020 tests pass; dot-layout/dom back to 100% coverage. Claude-Session: https://claude.ai/code/session_019kE9qbgBNBrfNgwg9fRsMJ Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
When you open a database's data-flow graph, tables that aren't part of any relationship (view/MV/dictionary/Distributed lineage) were dropped whenever the database had some lineage — a confusing "where are my tables?" UX. Two follow-up refinements were folded in (see commits).
Changes
Draw every table in a whole-DB graph —
buildSchemaGraphno longer prunes isolated nodes; lineage edges are drawn between the linked ones, standalone cards for the rest. Table-focus (1-hop) is unchanged; cross-DB scoping in the full view is still handled byexpandLineage(seeds the focus DB, BFS the rest), so neighbouring databases don't dump their unrelated tables in.Singles packed at the end — new opt-in
isolatedLastondagreLayout: the connected lineage lays out first (top), and the edge-less "single" tables are gridded into a roughly-square block beneath it, instead of dagre ranking the orphans across the top. Used by both the inline preview and the full view.Drop the redundant
db.prefix on node labels when the node is in the focused database (e.g.dashboards, notbentoclick.dashboards); nodes from another database keep their qualified id so the cross-DB origin stays visible. Applied once inbuildSchemaGraph, so both the inline short view and the full-view cards pick it up. ids/edges (and click-to-SHOW-CREATE) are untouched — only the display label changes.Tests
Updated/added unit tests for all three: keep-isolated, label strip vs cross-db keep, and
isolatedLastgrid packing (mixed + no-lineage). Full suite 1013 passing;dot-layout.js100% all metrics,schema-graph.jscoverage green.Verification
Built, deployed to antalya (
play-sql.html), drove the live cluster onbentoclick(15 tables, one 3-node lineage chain + 12 standalone):dashboards_raw → dashboards_mv → dashboards), the 12 singles gridded in a 4-col block at y 711–925. ✅dashboards,_asset_dash_*— nobentoclick.prefix — in both the full view and the inline short view. ✅🤖 Generated with Claude Code
https://claude.ai/code/session_019kE9qbgBNBrfNgwg9fRsMJ