fix(#179): move data-skipping indexes from schema graph cards to the detail drawer#205
Merged
Merged
Conversation
…detail drawer Expanded schema-graph cards no longer render the inline `idx: …` line. Because a card's width is the widest rendered text line, long index names/types inflated the card and distorted graph spacing (a heavily-indexed table spread far wider than the same columns with no indexes). Card geometry — width, height, layout, node spacing — is now completely independent of index count, name, and type. The full index metadata moves into a new **Data-skipping indexes (N)** section of the bottom detail drawer, after Columns: every index (never a capped subset), with Name, Expression, full Type (`type_full` preferred so `bloom_filter(0.01)` / `tokenbf_v1(…)` stay distinguishable, falling back to `type`), Granularity, and compressed size. Long Name/Expression/Type cells ellipsize with the full value on hover (the same `cappedCell` idiom the column cells use); the section is omitted when a table has no skipping indexes. The index rows are fetched once per detail-open, in `loadTableDetail`'s existing parallel batch — not reused from the schema-graph payload: that payload carries only name/type/expr, can't reach the drawer's click handler without threading arrays through the dagre layout (worse coupling), and the drawer needs `type_full` + `granularity` besides. The now-dead skip-index read `loadSchemaCards` issued on every graph load is removed. - src/core/schema-cards.js: drop MAX_IDX/skipLine from the card model + cardSize; buildCardModel/buildCardGraph no longer take/pass skip indices. - src/ui/explain-graph.js: stop drawing the .eg-skipidx row. - src/net/ch-client.js: loadTableDetail returns `indexes`; loadSchemaCards no longer fetches skip indices. - src/ui/schema-detail.js: render the Data-skipping indexes section. - styles.css: remove the dead .eg-skipidx rule. README/CHANGELOG reconciled. No new runtime dependency. Coverage gate green; render verified in a browser. Closes #179 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RUxymHWoFwRYJzyv3FgByc
a5d0f7a to
4bf986c
Compare
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.
What & why
Closes #179. Follow-up to the #177 compact-type work.
Expanded schema-graph cards used to append an inline
idx: …line. Since acard's width is its widest rendered text line, long index names/types inflated
the card and distorted graph layout — a heavily-indexed table spread far wider
than the same columns with no indexes, pushing related nodes apart. The graph
card is an overview surface; a flattened, capped index list is detailed metadata
that doesn't belong in card geometry.
This removes indexes from the card entirely (card width/height/layout/spacing are
now independent of index count, name, and type) and shows the complete index
metadata in a new drawer section.
Schema graph card
idx:line; no.eg-skipidxelement or CSS.schema-cards.js) dropsMAX_IDX/idxOverflow/skipLine;buildCardModel/buildCardGraphno longer take or pass skip indices, andcardSize()no longer counts an index row.Bottom detail drawer (
schema-detail.js)Granularity, and compressed size.
type_fullis preferred overtypeso parameterised indexes(
bloom_filter(0.01),tokenbf_v1(30720, 4, 0)) stay distinguishable; fallsback to
typewhen absent.same
cappedCellidiom the column cells already use — no new CSS).fields (granularity/sizes) degrade safely.
Data source (
ch-client.js)loadTableDetailnow returns{ columns, indexes, partitions, ddl, comment },fetching the index rows once per detail-open in its existing parallel batch
(
name, expr, type, type_full, granularity, compressed/uncompressed/marksfromsystem.data_skipping_indices).name/type/expr, can't reach the drawer's click handler without threadingarrays through the dagre
carry()layout (the "worse coupling" the issuewarns against), and the drawer requires
type_full+granularity. Theissue's escape hatch ("extending the existing detail query is acceptable when
reuse would create worse coupling") applies.
loadSchemaCardsissued on every graph loadis removed (one fewer query on graph open).
Checklist
npm testpasses (per-file coverage gate;schema-detail.js100/100/100/100)npm run buildsucceeds (single-filedist/sql.html)src/core/, fetch insrc/net/, DOM insrc/ui/CHANGELOG.md[Unreleased]updated (grants table + Changed entry)Verification
Unit tests assert the exact rendered DOM (section ordering, headers, all rows,
type_fullpreference + fallback, ellipsis +title, empty-table omission).Additionally rendered in a real browser via a throwaway harness with sample OTel
index data to confirm layout/alignment/ellipsis — screenshot matched.
🤖 Generated with Claude Code