Skip to content

fix(#179): move data-skipping indexes from schema graph cards to the detail drawer#205

Merged
BorisTyshkevich merged 1 commit into
mainfrom
fix/skipidx-drawer-179
Jul 13, 2026
Merged

fix(#179): move data-skipping indexes from schema graph cards to the detail drawer#205
BorisTyshkevich merged 1 commit into
mainfrom
fix/skipidx-drawer-179

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What & why

Closes #179. Follow-up to the #177 compact-type work.

Expanded schema-graph cards used to append an inline idx: … line. Since a
card'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

  • No more idx: line; no .eg-skipidx element or CSS.
  • Card model (schema-cards.js) drops MAX_IDX / idxOverflow / skipLine;
    buildCardModel/buildCardGraph no longer take or pass skip indices, and
    cardSize() no longer counts an index row.

Bottom detail drawer (schema-detail.js)

  • New Data-skipping indexes (N) section after Columns, before Partitions.
  • Shows every index (never a capped subset): Name, Expression, full Type,
    Granularity, and compressed size.
  • type_full is preferred over type so parameterised indexes
    (bloom_filter(0.01), tokenbf_v1(30720, 4, 0)) stay distinguishable; falls
    back to type when absent.
  • Long Name/Expression/Type cells ellipsize with the full value on hover (the
    same cappedCell idiom the column cells already use — no new CSS).
  • Section omitted entirely when the table has no skipping indexes; missing
    fields (granularity/sizes) degrade safely.

Data source (ch-client.js)

  • loadTableDetail now 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/marks from
    system.data_skipping_indices).
  • 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 carry() layout (the "worse coupling" the issue
    warns against), and the drawer requires type_full + granularity. The
    issue's escape hatch ("extending the existing detail query is acceptable when
    reuse would create worse coupling") applies.
  • The now-dead skip-index read loadSchemaCards issued on every graph load
    is removed (one fewer query on graph open).

Checklist

  • npm test passes (per-file coverage gate; schema-detail.js 100/100/100/100)
  • Tests added/updated in the same change (card model, graph render, drawer, network)
  • npm run build succeeds (single-file dist/sql.html)
  • Layers kept honest: pure model in src/core/, fetch in src/net/, DOM in src/ui/
  • No new runtime dependency
  • README + CHANGELOG.md [Unreleased] updated (grants table + Changed entry)
  • Reconciled: Move data-skipping indexes out of schema graph cards and into the detail drawer #179 is a standalone bug, not a roadmap-Roadmap to 1.0.0 #68 track item

Verification

Unit tests assert the exact rendered DOM (section ordering, headers, all rows,
type_full preference + 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

…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
@BorisTyshkevich BorisTyshkevich force-pushed the fix/skipidx-drawer-179 branch from a5d0f7a to 4bf986c Compare July 13, 2026 04:33
@BorisTyshkevich BorisTyshkevich merged commit 8822d42 into main Jul 13, 2026
6 checks passed
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.

Move data-skipping indexes out of schema graph cards and into the detail drawer

1 participant