Skip to content

feat(layout): Lay out table cards at an overview, keys, or full density - #301

Open
mhiro2 wants to merge 7 commits into
feat/relationship-linesfrom
feat/display-density
Open

mhiro2 wants to merge 7 commits into
feat/relationship-linesfrom
feat/display-density

Conversation

@mhiro2

@mhiro2 mhiro2 commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a card density (overview / keys / full) chosen at generation time; layout sizes every card for the rows it lists, so relationship lines always meet a listed row or the card's edge
  • Expose the density through --density on render / export, the density config key, the WASM API, and a Columns selector in the playground
  • Replace the HTML viewer's per-table collapse, which hid rows but kept card heights and line endpoints, with the density
  • Leave an unset density listing every column, falling back to overview past the existing large-schema limit

Changes

  • 3a6c768 : feat(layout): lay out table cards at an overview, keys, or full density
    • LayoutSpec::density drops unlisted columns from a copy of the layout graph before sizing and routing, so heights, port rows, and routes match the drawn rows
    • keys lists primary/foreign key columns plus every column a relationship names, and ends with a +N columns row; overview cards are a header alone
    • An audit test checks line endpoints on five fixtures in two directions at every density
  • cfb9af0 : feat(cli): choose the card density with --density and config files
    • render / export accept --density, and [render] / [export] / [diff] accept density; the flag wins over the config file
  • 054a10a : feat(playground): pick the card density from the playground
    • WASM render, export, and diff requests take density, and the playground keeps the choice in its shareable URL
  • 3349c3a : feat(render-html): replace table collapse with the card density
    • Removes the header indicator, the c URL parameter, session storage, and HtmlRenderOptions::enable_collapse
    • Cards no longer reserve header width for the indicator, so cards sized by a long name get narrower
  • 6d79871 : docs: describe card density and drop the viewer's table collapse
    • Covers the densities and their fallback in the CLI and configuration references, README, skill, and ARCHITECTURE.md
  • 7b51ffb : test(wasm): set the density in the browser-only diff request fixtures
  • d3d8ec9 : fix(layout): match relationship columns regardless of identifier case
    • The keys density and the port row lookup compare normalized identifiers, so a relationship naming parentcode still meets the ParentCode row

mhiro2 added 7 commits October 9, 2026 22:19
Cards always listed every column, or none at all once a schema passed
the large-schema limit, so reading how tables connect meant scanning
past every non-key column.

LayoutSpec gains a card density. Overview cards are a header alone;
keys cards list primary and foreign key columns plus every column a
relationship names, and end with a "+N columns" row for the rest; full
cards list everything. Layout drops unlisted columns before sizing and
routing, so card heights and line endpoints always match the rows on
screen. Leaving the density unset lists every column and falls back to
the overview past the old hide-columns limit.
render and export take --density overview|keys|full, and the render,
export, and diff config sections take a density key; the flag wins
over the config file. The three commands now share one helper that
builds their layout settings.
The WASM render, export, and diff requests accept a density, and the
playground's appearance panel gains a Columns selector (auto, all
columns, keys, overview) that is kept in the shareable URL.
Collapsing a table in the viewer only hid its rows: the card kept its
height and every relationship line still ended at a row that was no
longer drawn. Cards are now sized for what they show by choosing a
density when the diagram is generated, so the per-table collapse is
removed along with its header indicator, the "c" URL parameter, its
session storage, and the HtmlRenderOptions::enable_collapse switch.
Cards no longer reserve header width for the indicator, so cards whose
width followed a long name get narrower.
The CLI reference gains a card density section covering the three
densities, the large-schema fallback, and --density on render and
export; the configuration reference, README, and agent skill list the
new flag and config key. ARCHITECTURE.md explains how layout drops
unlisted columns before sizing and routing, and no longer mentions the
viewer's per-table collapse or its URL parameter.
The wasm32-only diff tests build WasmDiffRequest literally and missed
the density field added for the playground.
Schema JSON keeps column casing while foreign keys resolve their
columns case-insensitively, so a relationship naming `parentcode` for
a `ParentCode` column was missed in two places: the keys density
dropped the column from the card, and the port lookup attached the
line at the card's middle instead of the column's row. Both now
compare normalized identifiers.
@mhiro2
mhiro2 added this pull request to stack #294 October 9, 2026 13:36
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Schema review

Tip

✅ No risk findings — schema changes look safe to merge.

This branch has not been deployed

No deployments
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