Skip to content

feat(templates): dashboard-scorecard shows two headline numbers per row on a phone when they fit - #13456

Closed
josephfarina wants to merge 4 commits into
mainfrom
josephfarina/scorecard-two-up-phone-2
Closed

josephfarina wants to merge 4 commits into
mainfrom
josephfarina/scorecard-two-up-phone-2

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Template change; no record, component or package-code change.

Why

Agents building a metrics report start from dashboard-scorecard. Below 768px its six headline numbers stack one per row at every width, so a phone shows a long column of mostly empty tiles before the first chart.

What changes

  • Below 768px the scorecard grid shows two tiles per row when two fit with room for five times the value's type size inside the tile's own padding (padding={5}); otherwise one per row. The track is repeat(auto-fit, minmax(min(100%, max(calc(5 * var(--text-heading-2-size) + 2 * var(--spacing-5)), calc(50% - var(--spacing-2) / 2))), 1fr)).
    • Five covers the widest sample value, $4.82M (headings use proportional figures), in the widest theme heading face: matcha's Playwrite US Trad draws it at about 4.8 times its size.
    • The floor follows the value's own type size, so it grows with a larger browser font size and with a phone's text size setting (which scales Astryx's type sizes and leaves the root at 16px), and with a theme's tile inset.
    • This is the capped auto-fit track Grid builds for columns={{minWidth, repeat: 'fit', max}}, written in the template because Grid's minWidth takes pixels only, not a type size, and the scorecard's viewport tiers replace Grid's track template through xstyle. The source comment says the same.
  • Below 768px only (@media (not (min-width: 768px))), a tile's change figure moves under the value when the two do not fit side by side.

From 768px up the grid and the value row are unchanged. Tiles keep padding={5} and values stay Heading level 2.

Evidence

Built with the Vite plugin in the neutral, matcha, gothic and y2k themes, light and dark, with touch, at widths from 320 to 767px, at the default text size, a 125% and 150% browser font size, and a phone text size of 1.35×, 2× and 3× (the type-size scales set directly):

  • No headline number is clipped, ellipsized or pushed into its tile's padding, and no word in a tile's label or value breaks across lines, in every case where main has none. Where a single tile per row is itself too narrow for a value (matcha and y2k at 320px with 150% browser text or a 2× phone text size; the 3× phone size at the narrowest widths), main cuts or pads the number too, and this change renders those cases identically: it only stops two numbers sharing a row where they do not fit.
  • 768, 1024, 1200 and 1440px, light and dark, all four themes: full-page screenshots are byte-identical to main (32 of 32).

Tiles per row below 768px (light; dark is the same), measured on this head:

Text size Theme 320px 346px 356px 390px 412px 441px 480px 540px 610px 767px
default neutral 1 1 2 2 2 2 2 2 2 2
default gothic 1 1 1 2 2 2 2 2 2 2
default matcha 1 1 1 1 1 1 2 2 2 2
default y2k 1 1 1 1 1 1 2 2 2 2
browser 125% neutral 1 1 1 1 1 1 2 2 2 2
browser 125% gothic 1 1 1 1 1 1 1 2 2 2
browser 125% matcha 1 1 1 1 1 1 1 1 2 2
browser 125% y2k 1 1 1 1 1 1 1 1 2 2
browser 150% neutral 1 1 1 1 1 1 1 2 2 2
browser 150% gothic 1 1 1 1 1 1 1 1 2 2
browser 150% matcha 1 1 1 1 1 1 1 1 1 2
browser 150% y2k 1 1 1 1 1 1 1 1 1 2
phone ×1.35 neutral 1 1 1 1 1 2 2 2 2 2
phone ×1.35 gothic 1 1 1 1 1 1 2 2 2 2
phone ×1.35 matcha 1 1 1 1 1 1 1 1 2 2
phone ×1.35 y2k 1 1 1 1 1 1 1 1 2 2
phone ×2 neutral 1 1 1 1 1 1 1 1 2 2
phone ×2 gothic 1 1 1 1 1 1 1 1 1 2
phone ×2 matcha 1 1 1 1 1 1 1 1 1 2
phone ×2 y2k 1 1 1 1 1 1 1 1 1 2

Effect on built pages

In fresh agent-built metrics reports, judged blind against a hand-written page, the result moved within run-to-run noise: most agents rewrote the KPI row with their own Grid instead of keeping the template's. No page showed a clipped headline number. The change is for pages that keep the template as shipped.

Testing

  • Prettier on the template; check:changesets.

Scope

  • One page template; layout below 768px only.
  • Public text and artifacts contain no internal Meta context.

preflight: pass 2f8835f

@vercel

vercel Bot commented Nov 21, 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 Nov 21, 2026 11:09pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 21, 2026
@astracat-bot

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 11:32 PM UTC

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 662a000

@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.

Changes requested: on a phone set to a larger text size, the new two-per-row layout overflows, though the release note says larger text is handled.

  • page.tsx:196 sets the tile floor in rem, which iOS Dynamic Type and Android's font scale do not grow (they scale Astryx's type sizes and leave the root at 16px), so at 320px the grid stays two per row at XXXL and the accessibility sizes, $4.82M runs up to 62px past its tile's content box and labels break mid-word, where main keeps one tile per row with everything whole; a floor built from the value's own size, such as calc(4 * var(--text-heading-2-size) + 2 * var(--spacing-5)), falls back to one per row at every larger size and keeps two per row at the default size.
  • The release note's "larger text keeps every number whole" and the description's "Larger text falls back to one per row until two fit" hold only for a larger browser font size, so fix the floor or narrow the wording.

The layout direction is recorded by an engineering owner's /approve-spec for this head, and 768px and up is unchanged. CI has not run on this head, because its commit message carries [skip ci].

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: only the page template and a release note change, with no record, component or package code: verified (the two changed files).
  • Claim: below 768px the current page stacks one tile per row at every width: verified (the base track is 1fr; captures at 320 to 767px).
  • Claim: two tiles per row when two fit with at least 5.5rem of content inside the tile padding, otherwise one: verified at the default text size (track formula; captures).
  • Claim: the track is Grid's capped auto-fit track, Grid's minWidth takes pixels only, and the viewport tiers replace Grid's track through xstyle: verified in Grid's source.
  • Claim: below 768px only, the change figure moves under the value when the two do not fit: verified (page.tsx:205-209, :499; captures).
  • Claim: 768px and up is unchanged: verified (code; the 1024px and 1440px frames are pixel-identical).
  • Claim: tiles keep padding={5} and values stay Heading level 2: verified.
  • Claim: no headline number is clipped or pushed into the padding and no label or value word breaks where main has none: false at a phone's larger text sizes (first finding); holds at 100% and 150% browser font size.
  • Claim: two per row from 320px in neutral and from 390px in matcha and y2k at the default size: verified for those three themes; gothic not captured.
  • Claim: larger text falls back to one per row until two fit: holds for browser font size, false for phone text size (first finding).
  • Claim: at 150% text and 320px, matcha and y2k push $4.82M 9px into the padding as main does: not checked.
  • Claim: full-page desktop screenshots at 768 to 1440px in four themes match main: partly checked (neutral scorecard section at 1024px and 1440px).
  • Claim: agent-built report results: not checked (the author's own runs).
  • Claim: Prettier and the changeset check pass: verified.
  • Release note: two to a row under 768px when two fit, otherwise one: verified; the narrow-phone and wide-inset cases keep every number whole: verified; larger text keeps every number whole: false (second finding); the change figure moves under the value under 768px: verified; 768px and up unchanged: verified.
  • File packages/cli/assets/templates/pages/dashboard-scorecard/page.tsx: first finding (line 196).
  • File .changeset/scorecard-two-up-phone.md: second finding (line 5).

Automated review (maintainer link)

Comment thread .changeset/scorecard-two-up-phone.md Resolved
…o a phone's text size also falls back to one per row

[skip ci]
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec d883cb7

@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.

Changes requested: in the matcha theme the new two-per-row layout starts before its widest headline number fits, so the value runs into its tile's padding on common phone widths and is cut off at the card edge at larger text sizes.

  • page.tsx:197 reserves four times the type size, but matcha's heading face (Playwrite US Trad) sets $4.82M at about 4.8 times its size, so where the grid has just gone two-up the value overflows its tile (15px into the 30px padding at 412px at the default size, and cut off 6px past the card edge at 610px with Android's 2x text) where main keeps one tile per row with every value whole; a factor of at least 4.8 fixes it in all four themes (5 * leaves margin and puts neutral two-up from 356px).
  • The release note's "a theme with a wide tile inset or a larger text size … keeps every number whole" and the description's "no headline number … pushed into its tile's padding" do not hold in matcha until the floor covers its heading face.

The earlier text-size problem is fixed: the floor now follows the value's type size, and neutral, gothic and y2k keep every value whole at every width and text size checked. The factor of four came from the earlier review's suggestion, which was measured without matcha's own heading face loaded. CI has not run on this head, because its commit messages carry [skip ci].

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): the review configuration is unchanged since the last review.
  • Claim: only the page template and a release note change, with no record, component or package code: verified (the two changed files).
  • Claim: below 768px the current page stacks one tile per row at every width: verified (the base track is 1fr; base captures from 320 to 610px).
  • Claim: two tiles per row when two fit with room for four times the value's type size inside the tile padding, otherwise one, with the stated track: verified (page.tsx:197; a probe of the floor equals four times the rendered heading size plus both insets in every capture).
  • Claim: the floor grows with a larger browser font size, with a phone's text size setting and with a theme's tile inset: verified (root font size 125% and 150%, iOS text-size categories and uniform phone scales, and each theme's own inset).
  • Claim: this is Grid's capped auto-fit track, written in the template because Grid's minWidth takes pixels only and the viewport tiers replace Grid's track through xstyle: verified in Grid's source.
  • Claim: below 768px only, the change figure moves under the value when the two do not fit: verified (page.tsx:204-211, :500; captures).
  • Claim: from 768px up the grid and value row are unchanged; tiles keep padding={5} and values stay Heading level 2: verified (the 768px and 1200px tiers override the changed default track; the wrap is scoped below 768px).
  • Claim: no headline number is clipped, ellipsized or pushed into its tile's padding, and no word breaks across lines, wherever main has none: false in matcha (first finding); holds in neutral, gothic and y2k; no label or value word breaks in any capture.
  • Claim: where main already runs a value into the padding in one-per-row, the change matches it: verified for the tile count (both one per row at those sizes and widths).
  • Claim: the tiles-per-row table for four themes, five text sizes and eight widths: verified (every cell matches the thresholds measured at this head; spot captures agree).
  • Claim: full-page screenshots at 768 to 1440px match main: not reproduced at this head; the change cannot reach those widths (code).
  • Claim: agent-built report results: not checked (the author's own runs).
  • Claim: Prettier and the changeset check pass: verified.
  • Release note: two to a row below 768px when four times the type size fits, otherwise one: verified; a narrow phone, a wide-inset theme or a larger text size keeps every number whole: false in matcha (second finding); the change figure moves under the value below 768px: verified; 768px and up unchanged: verified.
  • File packages/cli/assets/templates/pages/dashboard-scorecard/page.tsx: first finding (line 197).
  • File .changeset/scorecard-two-up-phone.md: second finding (line 5).

Automated review (maintainer link)

Comment thread .changeset/scorecard-two-up-phone.md Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec f084ee3

@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.

Changes requested: the two-per-row layout now keeps every headline number whole in all four themes, and two sentences still describe it wrongly.

  • page.tsx:181-182 and the description name $58.1M as the widest sample value, the one matcha's heading face draws at about 4.8 times its size, but $4.82M is the widest in every theme (in matcha 119px against 113px at a 25px heading, about 4.8 against 4.5 times), so the comment and description should name $4.82M.
  • Miss: the release note's "…otherwise it keeps one to a row, so a narrow phone, a theme with a wide tile inset or a larger text size … keeps every number whole" does not hold where one tile per row is itself too narrow (in matcha at 320px the card cuts $4.82M off with a 2x phone text size or 150% browser text, on main and this head alike), so it should claim only what the change does, for example "never gets two numbers to a row that do not fit"; the earlier review missed these cases.

The earlier matcha overflow is fixed: with the factor at five, every two-up tile keeps its widest value clear of the tile's padding across four themes, ten text sizes and widths from 320 to 767px, and the description's tiles-per-row table matches every cell. CI has not run on this head, because its commit messages carry [skip ci].

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): the review configuration is unchanged since the last review.
  • Claim: only the page template and a release note change, with no record, component or package code: verified (the two changed files).
  • Claim: below 768px the current page stacks one tile per row at every width: verified (the base track is 1fr; one per row in every base measurement from 320 to 767px).
  • Claim: two tiles per row when two fit with room for five times the value's type size inside the tile padding, otherwise one, with the stated track: verified (page.tsx:199; the floor measures five times the rendered heading size plus both insets).
  • Claim: five covers the widest sample value, named as $58.1M and drawn at about 4.8 times its size in matcha: false (first finding); five does cover the widest value, $4.82M.
  • Claim: the floor grows with a larger browser font size, a phone's text size setting and a theme's tile inset: verified (measured at 125% and 150% root size, uniform phone scales, iOS text sizes and each theme's inset).
  • Claim: this is Grid's capped auto-fit track, written in the template because Grid's minWidth takes pixels only and the viewport tiers replace Grid's track through xstyle: verified in Grid's source.
  • Claim: below 768px only, the change figure moves under the value when the two do not fit: verified (page.tsx:209-214, :503; frames).
  • Claim: from 768px up the grid and value row are unchanged; tiles keep padding={5} and values stay Heading level 2: verified (16 of 16 light full-page frames at 768, 1024, 1200 and 1440px match main; dark not captured, and the changed styles apply only below 768px).
  • Claim: no headline number is clipped, ellipsized or pushed into its padding, and no word breaks, wherever main has none: verified (400 measurements on each side).
  • Claim: where main already runs a value into the padding at one per row, the change is identical: verified; the listed cases leave out matcha at a 2x phone text size.
  • Claim: the tiles-per-row table for four themes, five text sizes and ten widths: verified (200 of 200 cells).
  • Claim: agent-built report results: not checked (the author's own runs).
  • Claim: Prettier and the changeset check pass: verified.
  • Release note: two to a row below 768px when five times the type size fits, otherwise one: verified; a narrow phone, a wide-inset theme or a larger text size keeps every number whole: false (second finding); the change figure moves under the value below 768px: verified; 768px and up unchanged: verified.
  • File packages/cli/assets/templates/pages/dashboard-scorecard/page.tsx: first finding (lines 181-182).
  • File .changeset/scorecard-two-up-phone.md: second finding (line 5).

Automated review (maintainer link)

Comment thread .changeset/scorecard-two-up-phone.md Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 2f8835f

@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.

Approved pending CI: no build or test CI has run on this head yet, because its commit messages carry [skip ci].

Both earlier findings are fixed: the source comment and the description now name $4.82M as the widest sample value, and the release note claims only what the change does. Across all seven published themes, six text sizes and widths from 320 to 767px, two tiles share a row only where the widest value fits, with at least 19px to spare, and 768px and up renders exactly as on main.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): the review configuration is unchanged since the last review.
  • Claim: only the page template and a release note change, with no record, component or package code: verified (the two changed files).
  • Claim: on main, below 768px the six headline numbers stack one per row at every width: verified (the base track is 1fr; one per row in every base measurement from 320 to 767px).
  • Claim: two tiles per row when two fit with room for five times the value's type size inside the tile padding, otherwise one, with the stated track: verified (page.tsx:199; the floor measures five times the rendered heading size plus both insets in every theme and text size).
  • Claim: five covers the widest sample value, $4.82M, because headings use proportional figures, in the widest heading face, which draws it at about 4.8 times its size: verified (4.76 to 4.80 times in matcha; $4.82M is the widest value in all seven themes; the next widest face draws it at 3.79 times; headings set no tabular figures).
  • Claim: the floor grows with a larger browser font size, a phone's text size and a theme's tile inset: verified (browser 125% and 150%, phone 1.35x, 2x and 3x, and the 20px and 30px insets).
  • Claim: this is Grid's capped auto-fit track, written in the template because Grid's minWidth takes pixels only and the viewport tiers replace Grid's track through xstyle: verified in Grid's source.
  • Claim: below 768px only, the change figure moves under the value when the two do not fit: verified (page.tsx:209-214, :503; frames).
  • Claim: from 768px up the grid and value row are unchanged; tiles keep padding={5} and values stay Heading level 2: verified (page.tsx:498, :504; 28 of 28 full-page frames at 768, 1024, 1200 and 1440px match main in seven themes, light).
  • Claim: no headline number is clipped, ellipsized or pushed into its padding, and no word breaks, wherever main has none: verified (0 of 420 measurements on each side).
  • Claim: where one tile per row is itself too narrow, main cuts or pads the number too and the change renders those cases identically: verified for the number (identical overflow on both sides); of the listed cases, y2k at a 2x phone text size fits at 320px with 3px to spare.
  • Claim: 768 to 1440px full-page screenshots identical to main: verified in light (28 of 28); dark not captured.
  • Claim: the tiles-per-row table for four themes, five text sizes and ten widths: verified (200 of 200 cells).
  • Claim: agent-built report results: not checked (the author's own runs).
  • Claim: Prettier and the changeset check pass: verified.
  • Release note: two to a row below 768px when five times the type size fits, otherwise one: verified; never two numbers in a row where they do not fit, for a narrow phone, a wide tile inset or a larger browser or phone text size: verified (0 two-up layouts with a value past its content box); the change figure moves under the value below 768px: verified; 768px and up unchanged: verified.
  • File packages/cli/assets/templates/pages/dashboard-scorecard/page.tsx: clear (template rubric 65/100 on main and here, non-blocking).
  • File .changeset/scorecard-two-up-phone.md: clear.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 22, 2026
- #13358 fix(cli): a theme family checks its compiled registries as plain Node loads them
  Author: @josephfarina
- #13388 fix(cli): --check reads a theme family's committed compiled registries
  Author: @josephfarina
- #13464 experimental theme: a resting background color, outline or shadow keeps a part's hover and keyboard focus visible
  Author: @josephfarina
- #13433 cli(icons): icon response types say "icon meaning" and "variant"
  Author: @josephfarina
- #13456 feat(templates): dashboard-scorecard shows two headline numbers per row on a phone when they fit
  Author: @josephfarina
- #13473 docs(icons): icon-set guide's relatives line; template icons say icon component
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #13542.

@josephfarina
josephfarina deleted the josephfarina/scorecard-two-up-phone-2 branch November 22, 2026 12:07

This branch was successfully deployed

1 active deployment
Preview — 2f8835f8 Deployed Nov 21, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant