Repository navigation
feat(templates): add the model comparison page template - #6251
Conversation
A comparison matrix: candidates across the top, criteria down the side, and a label column that stays put while the candidates scroll past it. This is the transpose of every other table in the set. Elsewhere a row is a record and a column is a field; here a column is the record and a row is one attribute measured across all of them. That flip is what makes the layout work, because comparison is a vertical scan and a vertical scan only works if the thing being compared shares a column. It is also the shape that makes useTableGroupedRows correct: every group is measured against the same models, so one header row is true of every section beneath it. The matrix is derived rather than authored. MODELS holds each model's specs once, SPEC_ROWS declares each criterion as a get(model) accessor, and the table is the product of the two, so adding a model gives every row a cell and adding a criterion gives every model a value. Blended cost is a pure function of the two prices above it and cannot drift from them. The columns are a selection, not a list. Each heading owns a Selector that swaps the model underneath it, which makes the header a control rather than a caption — the interesting question is rarely how four models rank but how this one looks against that one, and that needs the axis to be editable. Best-in-row is scoped to the visible set for the same reason: scoping it to the catalog would let a column sit unmarked through the whole matrix because it loses to a model the reader never asked about and cannot see. Only comparable rows get a winner. A criterion declares better: higher or lower, and rows that declare neither get no mark, because marking a winner where values are merely different tells the reader a preference the data does not support. Ties are all marked rather than one being chosen arbitrarily. Winners render semibold as well as washed, so the ranking survives for readers who cannot separate the hues. Co-authored-by: Cursor <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
Release-process check: this adds a new page template under The sibling template PRs each carry one: #6195 ---
'@astryxdesign/cli': patch
---
[feat] Add the model comparison page template
<one-line summary>
@ernestt
Nothing else is outstanding: all 27 checks are green apart from |
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: 35 accessibility violation(s) found — 2 critical, 33 serious. Button pattern - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
Checkbox pattern - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 1 issue(s)
CodeEditorPerf - 1 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
LogStream - 1 issue(s)
MediaTheme Auto - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
Radio group pattern - 1 issue(s)
RadioList - 1 issue(s)
RichTextEditor - 2 issue(s)
SelectableCard - 1 issue(s)
Stepper - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Visual RegressionStatus: No visual change across 2 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
This is a useful comparison pattern, but builders who copy the ready template would inherit three accessibility failures in its core states:
- In Neutral dark mode, nine unit labels inside highlighted winner cells render at 4.18:1. Pair the winner background with a readable foreground, then recheck every shipped theme and mode.
- The outline jumps from the page
h1toh3section headings, and each grouped native table row carries unsupportedaria-expanded. Keep the sections at semantic level 2 and put disclosure state only on a valid control/role, or avoid collapsible grouping until the owning plugin does so. - Keyboard and touch users cannot reach the modality explanations because those tooltips anchor to non-focusable elements. At narrow widths, horizontal scrolling also leaves the group heading visible while moving its collapse control completely off-screen. Provide a non-hover explanation and keep each essential group action reachable while its heading is visible.
Ernest’s existing comment already covers the required CLI changeset. After these are fixed, please rerun light/dark, LTR/RTL, narrow/wide, axe, and the additive route-lock check.
…ine level 2 The page title is the only heading above the group headings, so an h3 skipped a level for anyone navigating the page by headings. Keep the level-3 type scale and expose the sections as level 2.
There was a problem hiding this comment.
Thanks — the section outline is now correct, and best markers stay off knowledge-cutoff, boolean, provider, and modality rows.
The 390px LTR state still scrolls the 220px criterion axis completely off-screen, leaving one anonymous model column; all six group actions are off-screen too. Please keep the comparison labels and group controls reachable while model columns scroll.
The earlier Neutral-dark unit contrast (4.18:1), unsupported aria-expanded on six table rows, and hover-only modality explanations also remain unchanged on this head.
There was a problem hiding this comment.
Thanks—the required CLI Changeset is now present. The template implementation itself is byte-for-byte unchanged from the previously reviewed head, so the remaining user-facing blockers are unchanged:
- At 390px in LTR, horizontal scrolling removes the criterion labels and all group controls, leaving model values without context.
- Neutral dark still renders highlighted unit labels at 4.18:1; grouped table rows still carry invalid
aria-expanded; and modality explanations still have no keyboard path.
Please keep labels and group actions reachable while model columns scroll, and clear those accessibility failures across the same narrow/wide, LTR/RTL, and light/dark states.
There was a problem hiding this comment.
The earlier narrow-layout and accessibility blockers are addressed on this head. Criterion labels and group controls stay pinned during horizontal scrolling, disclosure state remains on the button, modality explanations have one keyboard/touch target, and highlighted units use an AA-safe foreground. Focused tests and exact-head CI pass.
humbertovirtudes
left a comment
There was a problem hiding this comment.
The latest commit only separates release notes, so the implementation blockers remain. The Core grouped-row changes duplicate #6222 and part of #5612, sticky chevron stacking lacks a Table isolation boundary, and the 1,449-line interactive template has no committed functional tests. Criterion cells also need row-header semantics, while narrow-layout reachability, focus restoration, keyboard and touch inspection, and best-value semantics need correction and browser evidence before approval.
There was a problem hiding this comment.
This is a promising comparison template, but approval is waiting on a maintainer to provide or identify the current governing specification for the exact ready composition and the shared 16px grouped-row disclosure control. In particular, the spec needs to settle the selectable transposed matrix, model-count bounds, collapsible grouping, default-on best-value treatment, and synthetic uptime.
Independent accessibility fixes are also needed:
- Render the criterion label in each data row as a row header so assistive technology can associate every model value with its criterion.
- Expose the best-value marker nonvisually; today toggling Highlight best changes only styling.
- Restore focus to a surviving selector or Add model after a keyboard user clears a model column.
- Provide current browser evidence for wide/narrow, LTR/RTL, light/dark, keyboard, touch, contrast, and scrolled group-control reachability.
[Automated review]
The comparison table template (#6251) correctly matches "a pricing page with three plans and a comparison table" — the request literally describes a comparison matrix. Two independent blind labelers both chose table-comparison as the best start. Updates the test expectation from table-page to table-comparison. The test's purpose ("starts a page the words describe from its template") is unchanged; table-comparison is now the template those words describe.
…docsite lock (#7156) * fix(cli): update build test expectation for table-comparison template The comparison table template (#6251) correctly matches "a pricing page with three plans and a comparison table" — the request literally describes a comparison matrix. Two independent blind labelers both chose table-comparison as the best start. Updates the test expectation from table-page to table-comparison. The test's purpose ("starts a page the words describe from its template") is unchanged; table-comparison is now the template those words describe. * fix: register new table templates in sandbox routes and docsite lock Adds table-collapsible and table-comparison to the sandbox static-route manifest (next-export-routes.json, +2 routes) and refreshes the docsite ShadCN route lock (routes.lock.json, +2 entries). No old route changed.
A comparison matrix: candidates across the top, criteria down the side, and a label column that stays put while the candidates scroll past it. New page template,
Table - Frozen Column— the first in that category.Why it is transposed
Every other table in the set puts a record in a row and a field in a column. Here a column is the record — one language model — and a row is a single attribute measured across all of them.
That flip is what makes the layout work. Comparison is a vertical scan, and a vertical scan only works if the thing being compared shares a column. It is also the shape that makes
useTableGroupedRowscorrect rather than decorative: every group here — overview, pricing, performance, limits — is measured against the same models, so one header row is true of every section beneath it. Groups chunk a long criteria list; they are not a sign that the records differ.The matrix is derived, not authored
Six visible models times nineteen criteria is a hundred and fourteen cells, and hand-writing them guarantees a typo nobody finds.
MODELSholds each model's specs once,SPEC_ROWSdeclares each criterion as aget(model)accessor, and the table is the product of the two. Add a model and every row gains a cell; add a criterion and every model gains a value. Blended cost is a pure function of the two prices above it, so it cannot drift from them.The columns are a control, not a caption
MODELSis the catalog andslotsis what the reader chose, so each heading owns aSelectorthat swaps the model underneath it. The interesting question is rarely "how do these four rank" but "how does this one look against that one", and that needs the axis to be editable. A model already in another slot is shown disabled rather than hidden, so the list reads the same in every column and you can see why an option is unavailable.Best-in-row is scoped to the visible set for the same reason. Scoping it to the catalog instead is the subtle bug: a column could sit unmarked through the whole matrix because it loses to a model the reader never asked about and cannot see.
What gets a winner, and what does not
A criterion declares
better: 'higher' | 'lower', and rows that declare neither — a provider name, a modality list, a yes/no — get no mark at all. Marking a winner on a row where the values are merely different quietly tells the reader a preference the data does not support.Ties are all marked.
bestByRowcompares against the extreme value rather than picking an index, because choosing arbitrarily among equals is a bug that survives review by looking decisive.Winners are washed and semibold. The wash is blue rather than green: green reads as "passed" on rows where the winner is merely the cheapest, and it collides with the operational green in the uptime strip. Two encodings means the ranking survives for readers who cannot separate the hues.
The frozen label column
useTableStickyColumns({startKeys: ['spec']}). Scrolled sideways, an unpinned matrix is a grid of anonymous numbers. Six models, scrolled to the right edge:Measured rather than eyeballed: at 388px of horizontal overflow the first spec cell sits at offset 0 from the visible start edge,
position: sticky,z-index: 1.The model columns are
proportional()with a minimum. The pinned run is a single column at offset zero, so the rest divide what it leaves and fall back to scrolling once their minimum no longer fits — three columns fill the table instead of stranding a third of the page, and the seventh becomes a scroll rather than seven unreadable slivers.Rubric score: B (88/100)
Graded against Contributing Templates, rubric 1.3. Not yet recorded in the wiki ledger — happy to publish it on merge.
Layoutroot, single pagerechartsis outside the self-contained allowlistTwo things are worth a reviewer's attention.
Custom CSS is the whole gap (−10). Six of the nine declarations are the winner's wash, where only
backgroundColoris the intent and the other five cancel the cell's padding so the fill reaches the cell edges. There is no Astryx prop for "give this cell a background". A cell-emphasis affordance onTablewould take this category to 15/15 and the template to 98 — deliberately not attempted here, because it overlaps a heat-map feature that deserves its own design.The other three pin the group label:
They reach only as far as the label. The collapse chevron belongs to the plugin and cannot be pinned from userland, so it is still stranded off-screen when the table is scrolled sideways — that is the bug #6222 fixes. Once
useTableGroupedRowspins its own wrapper these three become redundant; I verified that by deleting them and re-rendering against that change, and there is aSYNC:comment on them so the follow-up is not lost. Removing them now was the alternative, and it costs no points either way — nine and six both land in the rubric's 4–10 band — but it leaves the heading bands blank on a scrolled table, so they stay until the plugin can do the job properly.rechartscosts 2 points and is a known, corpus-wide exception rather than something this template can fix. Nine page templates import it; the two that have been audited,dashboard(95) anddashboard-portfolio(83), both took the same −2 with published findings naming the same cause. There is no chart component inpackages/core/srcto move to. Notably the uptime strip draws with Recharts'Rectanglecomponent rather than a bare<rect>, which is how it keeps component purity at 30 wheredashboard-portfoliodropped to 15 on four raw SVG tags.Verification
ESLint clean, Prettier clean, and all pre-commit gates pass. The docsite typecheck reports 6 errors both with and without this change — pre-existing in my worktree, none attributable here. The ShadCN route lock gains exactly one additive entry,
templates/table-comparison; no existing route moved.Made with Cursor