Skip to content

feat(templates): add the collapsible table page template - #6065

Merged
ernestt merged 3 commits into
mainfrom
template-table-collapsible
Oct 7, 2026
Merged

ernestt merged 3 commits into
mainfrom
template-table-collapsible

Conversation

@ernestt

@ernestt ernestt commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Adds table-collapsible, a new page template. Purely additive — table-grouped is untouched.

Why a second table-with-sections template

The two are the same silhouette solving opposite problems, and the split is the point:

table-grouped (existing) table-collapsible (new)
Structure One collection, split into sections Four separate tables
Columns One set, shared by every section Each group defines its own
Reach for it when The rows agree The rows do not agree

useTableGroupedRows is right when every group is the same kind of thing and grouping is just a sort you can collapse — issues by status, orders by month. It is the wrong tool the moment the groups stop agreeing on what the columns mean. Utilization is a credit-card idea, pending payout is a processor idea, cost basis is an investment idea. Forcing all three into one grid produces a table that is mostly em-dashes, under a header row true of no row beneath it.

So each group owns a table, and the Card supplies the boundary the shared header row used to.

The template header comment carries the rule for extending it: the test for splitting is column divergence, not group count. Twelve groups with identical columns still belong in one table with the plugin.

What it demonstrates

  • Divergent columns per group — the reason the layout exists
  • One shared range (1W/1M/3M/YTD/1Y) in the page header driving all four tables
  • Independent sorting per table
  • Row expansion into a full-width history chart, cursor-synced across charts in the same group via Recharts syncId
  • Compact layout below 720px — folds to name plus headline figure with a coloured delta, with liability inversion so a rising credit-card balance reads red

Screenshots

Overview Row expanded
Compact (<720px) Expand all

Blocked on core

Do not merge before these land — the template calls three props that do not exist on main yet:

Rubric

85/100 (B). Full marks on structure, tokens, a11y and responsive behaviour. The two deductions:

  • Custom CSS (0/15) — driven by the icon-to-chevron hover cross-fade on the group headers. Worth noting the rubric is ambiguous here: scoring by CSS properties and by style keys give materially different numbers for the same file. Flagging rather than tuning the template to a metric I cannot read unambiguously.
  • Naming — table-collapsible and table-grouped are both collapsible, so the name does not separate them on its own. Chosen deliberately with that tradeoff understood; the description carries the differentiation instead, which is the field that actually drives retrieval.

Test plan

  • pnpm -F @astryxdesign/cli typecheck:strict — clean
  • pnpm -F @astryxdesign/cli typecheck:template-docs — clean
  • Preview verified at four viewports, zero console errors in all four
  • table-grouped byte-identical to main

ernestt and others added 2 commits September 4, 2026 17:51
Several tables on one page, each in a collapsible card with its own
columns, for groups that do not share a schema. Utilization is a
credit-card idea, pending payout is a processor idea, cost basis is an
investment idea; forcing all three into one grid gives a table that is
mostly em-dashes under a header true of no row beneath it.

Sits beside table-grouped rather than replacing it. That one takes a
single collection of like rows and splits it into collapsible sections
sharing one column set; this one is for when the rows do not agree.

Every table sorts on its own, one time range in the page header drives all
of them, and rows expand in place into a full-width history chart. Below
720px each table folds to its name and headline figure.

Co-authored-by: Cursor <[email protected]>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 5, 2026
@vercel

vercel Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 5, 2026 1:15am UTC

Request Review

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot

astracat-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Sep 24, 2026, 3:54 AM UTC

@ernestt

ernestt commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Answering the playground question here for the record: the missing charts are not this PR's doing. recharts was never in the playground's module scope, so every chart in every dashboard template has been rendering as nothing — the runner returns a proxy of () => null for unresolved modules, which is why it failed silently rather than erroring.

Fixed on main in #6263, along with a warning for unresolved modules and a test that every template import resolves. Once that lands, the AreaChart in this template will draw in the playground with no change needed here.

@humbertovirtudes humbertovirtudes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Narrowing the layout after sorting a desktop-only column leaves an invisible active sort controlling row order. The 1,474-line copyable interaction surface also has no committed functional tests, depends on the blocked row-expansion work in #5995, and needs explicit accessible treatment for expanded charts. Please clear or map hidden sort keys, add behavior coverage, and resolve the dependency before approval.

astracat-bot[bot]
astracat-bot Bot previously requested changes Sep 24, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this template — the heterogeneous-groups case is well motivated, and keeping it additive beside table-grouped with the column-divergence rule in the header makes the choice between them clear.

One change is needed before approval:

  • Compact mode can keep an invisible sort active. Sorting by a desktop-only column (for example, credit cards by Limit) and then narrowing below 720px leaves the rows in that order while the compact layout shows only name and headline — the sorted column, its control, and its indicator are gone, so the order looks arbitrary and cannot be cleared from compact mode. Please clear or map unsupported sort keys when the column set switches to compact, and add focused regression coverage for the wide-to-compact transition.

Two smaller notes: the PR description's "Blocked on core" section and custom-CSS rubric deduction appear stale for the current code, which no longer uses those props or the hover cross-fade — updating the description would avoid confusing reviewers. The bulk Expand-all chart cost measured as a single bounded long task, so it is not part of this request.

[Automated review]

@ernestt
ernestt dismissed stale reviews from astracat-bot[bot] and humbertovirtudes October 7, 2026 23:42

Abandoning

@ernestt
ernestt merged commit 7a615a4 into main Oct 7, 2026
41 of 42 checks passed
@github-actions
github-actions Bot deleted the template-table-collapsible branch October 8, 2026 06:25

This branch was successfully deployed

1 active deployment
Preview — 78147744 Deployed Sep 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants