Repository navigation
fix(templates): dashboard chart labels show whole instead of clipped by the chart edge - #12432
josephfarina wants to merge 3 commits into
Conversation
…by the chart edge The progress timeline put its "Today" label above the plot with a 4 px top margin, so the chart cut off all but its last pixels at every width. The chart now reserves the label line plus its gap. Y axes whose ticks outgrew a fixed width (comparison trend, overview trend and burndown under touch text) size themselves to their widest tick. The phone-fit browser check now fails on any chart label its chart clips.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approval waits on an engineering owner's decision, and two points need fixing first.
No current spec governs how these dashboard templates lay out their charts, so an engineering owner needs to accept what this pull request ships (a taller timeline top margin so "Today" shows, and Y axes as wide as their widest tick) by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.
width="auto"on the three Y axes (dashboard/page.tsx:528,dashboard-comparison/page.tsx:551,dashboard-progress/page.tsx:900) pushes every Y-axis tick number past the chart's left edge, where it disappears, inastryx experimental renderfiles read without scripts (17 ticks thatmainshows), because the render measures no layout and the axis shrinks to 8 px; a numericwidththat fits the widest tick at the touch text size (about 32, 49 and 56 px) works in both, or the render's chart document could measure tick text.- The description says "the other 55 ready page templates", but 57 page templates are ready, so there are 54 others; please change the number.
In the running app the fix works: the new browser check fails on main with exactly the seven clipped labels and passes here.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the timeline's "Today" label shows only a sliver at every width, in the app and in a rendered page. Verified at 390 and 1280 px: it starts 12 to 13 px above the chart's top edge.
- Claim:
1200Kin the comparison trend, and under touch text100/120in the overview and320 ptsin the burndown, are clipped. Verified: the new check lists exactly these onmain. - Claim: a
position: 'top'reference-line label sits above the plot, and the 4 px top margin left it outside the chart. Verified: its baseline sits 5 px above the plot. - Claim: those Y axes had fixed 30 or 40 px widths narrower than their widest tick. Verified: less the 8 px tick allowance, each left less room than its widest tick at the touch text size.
- Claim: the timeline's top margin is the label's size plus its gap, from named constants the label also uses. Verified (
dashboard-progress/page.tsx, lines 190-191, 690-695 and 722-727). - Claim: the clipped axes use
width="auto". Verified at all three axes. - Claim: the charts package's reference line already keeps its label inside the plot, and these templates call Recharts directly. Verified.
- Claim: no layout, color or data change beyond the room the labels need. True in the running app; false in rendered files without scripts, where the axes collapse (first blocking point).
- Claim: after the change every label sits inside its chart at those sizes, in the app and in the rendered file. True in the app and in the rendered file with its script; false without scripts.
- Claim: the other 55 ready page templates have no clipped chart text. No clipped text, verified; the count is 54 (second blocking point).
- Claim: the new check failed on an earlier, narrower version of the change. Not checkable: that version is not in the history; the check fails on
mainand passes here. - Claim: one defect, with no new public API, default or interaction model, and no internal context in public text. Verified.
- Claim: both phone-fit browser cases pass. Verified.
- Claim: the listed Node tests pass (83 files). Verified: 83 files, 551 tests at this head.
- Claim: before and after checked in a real browser at 375, 390 and 1280 px, light and dark. Rechecked at 390 and 1280 px in light.
- Release note: a patch for the CLI package. Verified: the templates ship in it.
- Release note: the timeline's "Today" label gets room above the plot. Verified.
- Release note: axes sized to their widest tick no longer clip it. True in the app; false in rendered files without scripts.
- File
.changeset/template-chart-labels-whole.md: overstated for rendered files (first blocking point). - File
.github/scripts/template-phone-fit.browser.test.mjs: clear. - File
.github/workflows/ci.yml: clear. - File
dashboard/page.tsx: blocking (Y-axis width). - File
dashboard-comparison/page.tsx: blocking (Y-axis width). - File
dashboard-progress/page.tsx: blocking (burndown Y-axis width); the timeline margin is clear.
|
Owner decision (engineering owner, covering this pull request): in the dashboard page templates, the timeline chart has a taller top margin so its "Today" label shows whole, and each Y axis is as wide as its widest tick label, so no tick number is clipped, including in pages rendered without scripts. |
|
/approve-spec 72c5f20 |
width="auto" sizes the axis from a measured layout, so a page painted without one (a script-less render) put every tick past the chart edge. Each axis now has a width that holds its widest tick label at the touch type size.
|
/approve-spec faf5c49 |
There was a problem hiding this comment.
One small fix is needed before this can merge; the chart-label fix itself works and has an engineering owner's approval for this head.
- Miss:
.changeset/template-chart-labels-whole.mdhas no contributor credit line, socheck:changesetsfails the Lint job at this head; add@josephfarinaon its own line after the description.
Both earlier points are fixed: the Y axes now keep every tick visible in rendered files without scripts, and the description's template count is right. Two non-blocking notes stand, both unchanged from main: dashboard-comparison and dashboard-progress grade C on the template rubric, and dashboard-progress/page.tsx is over 1,000 lines. The main CI workflow at this head was cancelled because CI was full, so it needs a re-run (or the next push) before merge.
Claims and files checked
Review mode: incremental; reason: none
- Claim: the timeline's "Today" label shows only a sliver, in the app and in a rendered page. Verified at 390 and 1280 px: on
mainit starts 12 px above the chart's top edge. - Claim:
1200Kin the comparison trend, and under touch text100/120in the overview and320 ptsin the burndown, are cut off. Verified for1200Kand100/120; the new check fails onmainfor the burndown too, where its ticks also wrap onto two lines. - Claim: a top-positioned reference-line label sits above the plot, and the 4 px top margin left it outside the chart. Verified.
- Claim: those Y axes had fixed 30 or 40 px widths narrower than their widest tick. Verified at the touch text size.
- Claim: the timeline's top margin is the label's size plus its gap, from named constants the label also uses. Verified (
dashboard-progress/page.tsx, lines 190-191, 690-695 and 722-728). - Claim: each clipped axis gets a fixed width that holds its widest tick at the touch text size. Verified: 40, 56 and 64 px against about 32, 49 and 56 px needed.
- Claim: a fixed width is used because an auto width needs a layout pass, which a script-less render does not run. Verified: the earlier auto widths hid every tick in rendered files.
- Claim: the charts package's own reference line keeps its label inside the plot, and these templates call Recharts directly. Verified.
- Claim: the smallest restoration is the margin plus axis widths 40 to 64, 40 to 56 and 30 to 40 px. Verified.
- Claim: no layout, colour or data change beyond the room the labels need. Verified; each axis keeps 7 to 8 px of spare room at the touch text size.
- Claim: after the change every label sits inside its chart, in the app and in rendered files. Verified at 390 and 1280 px in the app and in rendered files without scripts; the rendered file with its script was not rechecked.
- Claim: the other 54 ready page templates have no clipped chart text. Verified: the new check passes for every ready template.
- Claim: the new check failed on an earlier, narrower version of the change. Not checkable: that version is not in the history; it fails on
mainand passes here. - Claim: one defect, with no new public API, default or interaction model, and no internal context in public text. Verified.
- Claim: both phone-fit browser cases pass. Verified.
- Claim: the listed Node tests pass (83 files, 547 tests). Verified: 83 files and 551 tests pass at this head.
- Claim: checked in a real browser at 375, 390 and 1280 px, light and dark. Rechecked at 390 and 1280 px in light.
- Release note: a patch for the CLI package. Verified: the templates ship in it.
- Release note: the timeline's "Today" label gets room above the plot. Verified.
- Release note: Y axes wide enough for their widest tick no longer clip it. Verified.
- Release note format: false, it has no contributor credit line (the blocking point).
- File
.changeset/template-chart-labels-whole.md: blocking (contributor credit). - File
.github/scripts/template-phone-fit.browser.test.mjs: clear. - File
.github/workflows/ci.yml: clear. - File
dashboard/page.tsx: clear. - File
dashboard-comparison/page.tsx: clear; the rubric note is unchanged frommain. - File
dashboard-progress/page.tsx: clear; the rubric and page-size notes are unchanged frommain.
|
/approve-spec 8e9d1d3 |
There was a problem hiding this comment.
Approved pending CI: the main CI run on this head was cancelled because CI was full, so it needs a re-run before merge. The chart-label fix does what the engineering owner approved for this head, and the changeset now carries its contributor credit, so check:changesets and the Lint job pass.
Two non-blocking notes stand, both unchanged from main: dashboard-comparison and dashboard-progress grade C on the template rubric (raw gradient tags and custom StyleX), and dashboard-progress/page.tsx is over 1,000 lines.
Claims and files checked
Review mode: incremental; reason: none
- Claim: the timeline's "Today" label shows only a sliver, in the app and in a rendered page. Verified: on the base the new check reports it clipped with touch and with a mouse, 12 px above the chart's top edge.
- Claim:
1200Kin the comparison trend, and under touch text100/120in the overview and320 ptsin the burndown, are cut off. Verified: the new check on the base lists exactly those labels. - Claim: a top-positioned reference-line label sits above the plot, and the 4 px top margin left it outside the chart. Verified.
- Claim: those Y axes had fixed 30 or 40 px widths narrower than their widest tick. Verified at the touch text size.
- Claim: the timeline's top margin is the label's size plus its gap, from named constants the label also uses. Verified (
dashboard-progress/page.tsx, lines 190-191, 690-695 and 722-728). - Claim: each clipped axis gets a fixed width that holds its widest tick at the touch text size. Verified: 40, 56 and 64 px against about 32, 49 and 56 px needed.
- Claim: a fixed width is used because an auto width needs a layout pass, which a script-less render does not run. Verified: the earlier auto widths hid every tick in rendered files.
- Claim: the charts package's own reference line keeps its label inside the plot, and these templates call Recharts directly. Verified.
- Claim: the smallest restoration is the margin plus axis widths 40 to 64, 40 to 56 and 30 to 40 px. Verified.
- Claim: no layout, colour or data change beyond the room the labels need. Verified; each axis keeps 7 to 8 px of spare room at the touch text size.
- Claim: after the change every label sits inside its chart, in the app and in rendered files. Verified in the app at this head and in rendered files without scripts at the previous revision, whose template code is identical; the rendered file with its script was not rechecked.
- Claim: the other 54 ready page templates have no clipped chart text before or after. Verified: on the base the new check flags only the three dashboard templates, and here none.
- Claim: the new check failed on an earlier, narrower version of the change. Not checkable: that version is not in the history; it fails on the base and passes here.
- Claim: one defect, with no new public API, default or interaction model, and no internal context in public text. Verified.
- Claim: both phone-fit browser cases pass. Verified at this head.
- Claim: the listed Node tests pass (83 files, 547 tests). Verified: 83 files and 551 tests pass at this head.
- Claim: checked in a real browser at 375, 390 and 1280 px, light and dark. Rechecked at 390 and 1280 px in light.
- Release note: a patch for the CLI package. Verified: the templates ship in it.
- Release note: the timeline's "Today" label gets room above the plot. Verified.
- Release note: Y axes wide enough for their widest tick no longer clip it. Verified at the default and touch text sizes.
- Release note format: category tag and contributor credit present. Verified:
check:changesetspasses. - File
.changeset/template-chart-labels-whole.md: clear. - File
.github/scripts/template-phone-fit.browser.test.mjs: clear. - File
.github/workflows/ci.yml: clear. - File
dashboard/page.tsx: clear. - File
dashboard-comparison/page.tsx: clear; the rubric note is unchanged frommain. - File
dashboard-progress/page.tsx: clear; the rubric and page-size notes are unchanged frommain.
…d of clipped by the chart edge
…d of clipped by the chart edge
- #12252 docs(cli): agent docs name the prop names that differ from other libraries Author: Joey Farina <[email protected]> - #12154 fix(core): a numeric typography weight builds through an extended base's adaptation rules Author: Joey <[email protected]> - #12092 fix(cli): theme build reads the Core it builds with for variant declarations, and names the build command alone Author: Joey Farina <[email protected]> - #12316 fix(core): a shorthand never follows its own longhand in one style merge Author: josephfarina <[email protected]> - #12357 fix(core): a Table stays the scroll region when a host scrolls every table's parent Author: Joey Farina <[email protected]> - #12349 fix(core): end a mouse drag a sandboxed frame never saw released Author: josephfarina <[email protected]> - #12425 fix(cli): use a stored doc parse only with the zod release that made it Author: Joey <[email protected]> - #12396 fix(AppShell): with the standard width points, a server-rendered shell hides its inline side nav on a phone before its script runs Author: Joey <[email protected]> - #12438 fix(charts): end dots draw whole and a thinned axis keeps its last label Author: Joey Farina <[email protected]> - #12448 fix(cli): upgrade outside a project names the project, not --from Author: Joey Farina <[email protected]> - #12459 fix(templates): the dashboard scorecard fits a phone screen Author: Joey Farina <[email protected]> - #12428 fix(core): Field labels draw in a bolder face than their description Author: Joey Farina <[email protected]> - #12435 fix(theme-matcha): dark menus, popovers and muted fills take the theme's deep gray neutral Author: Joey <[email protected]> - #12432 fix(templates): dashboard chart labels show whole instead of clipped by the chart edge Author: Joey Farina <[email protected]> - #12441 fix(cli): mark icon-set generated calls pure so apps drop unused icons Author: Joey Farina <[email protected]> - #12472 fix(MetadataListItem): a value breaks only a word longer than its line Author: Joey <[email protected]>
|
Landed in #12718. |
User impact
Anyone who starts from the
dashboard-progresstemplate sees only a sliver of the "Today" label above the dashed today line in the milestone timeline, at every width (375, 390 and 1280 px, light and dark), in the app and in a rendered page. The same class of clip cuts off Y-axis tick labels indashboard-comparison("1200K"), and, under the larger touch text of the neutral theme on a phone, indashboard("100", "120") and thedashboard-progressburndown ("320 pts").Problem and solution fit
position: 'top'above the plot area, and an outer<svg>clips what it draws outside its box. The chart had a 4 px top margin, so the 11 px label sat 13 px above the SVG's top edge.The fix reserves room where the label is placed instead of moving it: the timeline's top margin is the label's size plus its gap, and each clipped Y axis gets a width that holds its widest tick label at the touch type size. The width is fixed rather than Recharts'
width="auto", because "auto" measures layout, and a page painted without a layout pass (a script-less render) would then put every tick past the chart edge.Expected behavior and authority
Templates are starting points that must show their content whole on a phone and on desktop (the existing phone-fit browser check).
@astryxdesign/charts' ownreferenceLinealready clamps its label inside the plot; these templates call Recharts directly, so the fix belongs in the templates.Smallest restoration
dashboard-progress: top margin = label size + label gap (both named constants, the label uses them too); burndown Y axis 40 -> 64 px.dashboard-comparison: Y axis 40 -> 56 px.dashboard: Y axis 30 -> 40 px.Evidence
template-phone-fit.browser.test.mjsgains "shows every chart label whole, inside its chart". It failed on the timeline/comparison-only version of this change (it found the touch-text clips indashboardand the burndown) and passes with the full change.Scope
Components: page templates (dashboard, dashboard-comparison, dashboard-progress), template phone-fit browser check
Testing
ASTRYX_TEMPLATE_PHONE_FIT_BROWSER=1 vitest run .github/scripts/template-phone-fit.browser.test.mjs(both tests pass).vitest run packages/cli/api/template packages/cli/foundation/discovery/template- packages/cli/api/render/render.templates internal/eslint-plugin-astryx/no-raw-color.test.mjs --project node: 83 files, 547 tests pass.