fix(v2): right-align the list-view quantity columns - #4603
Conversation
Size, Rating and Length now read as quantities: their values and their headers sit on the right edge of the track, and tabular figures keep the digits in a straight column. The two date columns stay start-aligned but take tabular figures too. An end-aligned cell spends the track slack that used to separate it from the column beside it, so the shared gutter grows from 12px to 20px (and the mirrored LIST_GRID_GAP_PX with it). Without that, Size/Added and Length/Languages collapsed to the bare gap and the sorted Rating header filled its track edge to edge. The Released track widens to 96px: tabular figures push the widest dates past its old 84px, and they ellipsized. The header sort glyph leads the label once the label is end-aligned, so clicking a sorted column no longer shoves it sideways. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Tabular figures only equalise digit widths, so the year in "Sep 09, 1988" still stepped with the month abbreviation, up to 7.5px across rows. Pinning Added and Released to the right edge puts the fixed-width tail (comma, day, year) on the same x in every row. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Aligns v2 gallery list quantity columns and date values to the right, using tabular figures and synchronized skeleton layouts.
Changes:
- Updated column alignment, numeric formatting, track widths, and grid gaps.
- Applied alignment consistently to headers, hydrated rows, and skeleton rows.
- Added skeleton parity coverage for column alignment.
File summaries
| File | Description |
|---|---|
| frontend/src/v2/components/Gallery/listColumns.ts | Updated as part of this pull request. |
| frontend/src/v2/components/Gallery/GameListSkeletonRow.vue | Updated as part of this pull request. |
| frontend/src/v2/components/Gallery/GameListSkeletonParity.test.ts | Updated as part of this pull request. |
| frontend/src/v2/components/Gallery/GameListRow.vue | Updated as part of this pull request. |
| frontend/src/v2/components/Gallery/GameListHeader.vue | Updated as part of this pull request. |
Review details
Suppressed comments (4)
frontend/src/v2/components/Gallery/GameListRow.vue:135
- The new
numericcontract is not covered by the regression test:rightEdges()only checks--end, so dropping the--nummapping or any numeric flags would still leave the test green. Please assert that the hydrated metric cells expose the numeric modifier, or otherwise verify the tabular-figure styling.
"game-list-row__cell--num": column?.numeric === true,
frontend/src/v2/components/Gallery/GameListRow.vue:136
alignis documented as applying to the cell body, butcellModifiers()is only used for the metric and action cells. The hydrated platform, title, language, and region branches still ignore the config, so changing any of those columns toendwould leave the header and skeleton aligned differently from hydrated rows. Apply the same modifier to every body cell or derive the body fromcolumns.
/** Alignment / figure modifiers for a cell, read off the column config so
* the body cannot drift from the header above it. */
function cellModifiers(key: ListColumn["key"]) {
const column = columns.value.find((col) => col.key === key);
return {
"game-list-row__cell--end": column?.align === "end",
"game-list-row__cell--num": column?.numeric === true,
};
frontend/src/v2/components/Gallery/GameListSkeletonParity.test.ts:91
- This regression test covers the new
--endclasses, but it never asserts that the newnumericflag produces--numon hydrated cells. A regression could removefont-variant-numeric: tabular-numswhile all current assertions remain green, so add a numeric-class assertion for the configured columns.
const expected = getListColumns(true).map((col) => col.align === "end");
const pending = mount(GameListRow, { props: { position: 0 } }).element;
const hydrated = mountHydratedRow().element;
const bootstrap = mount(GameListSkeletonRow).element;
expect(rightEdges(pending)).toEqual(expected);
expect(rightEdges(hydrated)).toEqual(expected);
expect(rightEdges(bootstrap)).toEqual(expected);
frontend/src/v2/components/Gallery/listColumns.ts:79
- The new
numericcontract is not covered by the regression test:rightEdges()only checks--end, so the suite still passes if the--numbinding orfont-variant-numeric: tabular-numsis removed. Add a hydrated-row assertion for the metric cells to protect the tabular-figure behavior.
numeric: true,
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The row fixture was an object literal forced through `as unknown as SimpleRom`, which the v2 rules prohibit and which hid a real type error: `metadatum.first_release_date` is an epoch number, and the fixture passed a date string. A complete `SimpleRom` default now fails the build when a required field changes, behind a factory that takes per-test overrides. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The parity assertions only checked the `--end` wiring, so dropping the `--num` mapping or a `numeric` flag from the config would have stayed green while the tabular figures quietly went proportional. Verified the new assertion fails when the mapping is removed. Also narrows the `align` doc: only the value and action cells read it, the structural cells lay themselves out, so the field no longer claims a reach it does not have. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Each of the three rationale comments in the list-row parity test now states its invariant on a single line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EUpZ4rcSyfZbnUeJ3X9JJB
Description
Explain the changes or enhancements you are proposing with this pull request.
In the v2 gallery list view, Size, Added, Released, Rating and Length now read as quantities: the value and its column header both sit on the right edge of the track, and tabular figures keep the digits in a straight column.
Dec 09, 2024/Sep 09, 1988below).LIST_GRID_GAP_PXwith it. Without that,Size/AddedandLength/Languagescollapsed to the bare 12px gap, and a sortedRatingheader (label + glyph = 56px) filled its track edge to edge.ListColumn.alignwas declaration-only: the header read it, the row never did, so flipping a column toendproduced a right-aligned header over left-aligned values. The row now reads its classes off the same config viacellModifiers(), in the hydrated and the per-position skeleton branch alike.ListColumn.numericis new, for the tabular figures.The skeleton flavours follow so the placeholders stay in parity:
GameListSkeletonRowis its own grid, so it needed the wider gutter, and its placeholder bars needed to move to the right edge for the end-aligned columns. Measured with the tail rows held open, the bars sit atrightSlack=0on those columns, so nothing jumps when a row hydrates.No issue to link: this came out of a design pass on the list view rather than a filed bug.
Checklist
Please check all that apply.
Screenshots (if applicable)
Before, dark theme: the date columns are start-aligned, so the year steps with the month abbreviation ("Sep" is wider than "Jul", "May" the widest).
After, dark theme: Added and Released share the right-aligned edge with Size, Rating and Length, and every row's year starts at the same x.
After, light theme, same view:
Notes for reviewers
GameListSkeletonRowis only visible before the first page lands, and this dev library has 21 roms against a 72-row page size, so it cannot be driven into view locally. That flavour rests onGameListSkeletonParity.test.ts, which asserts the per-column right-edge flags of all three row flavours against the column config.vue-tscis clean,npm run buildsucceeds,trunk fmt && trunk checkis clean.AI assistance disclosure
Implemented with Claude Code (Anthropic), driving the change end to end: the column-config edit, the component changes, the regression test, and the browser verification and screenshots above. Reviewed by me before opening.