Repository navigation
fix(Button): a labelled button grows with its label - #10588
Conversation
Under iOS Dynamic Type the label grew while the button kept its element height, so the label stood outside its own tap target and stacked buttons took each other's taps. A labelled button's size is now a minimum height and it has no block padding, so its label's line box decides any height above the minimum; the default size is unchanged. Icon-only buttons keep their fixed square size. Button FR4 and AST-102's current-state list say so, and a browser spec checks both.
…om for its glyphs
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 48055ec |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| BreadcrumbItem | 83.4 kB (+88 B) · 12.1 kB CSS (+34 B) | — | — · — · — |
| Markdown | 179.5 kB (+25 B) · 20.1 kB CSS (+73 B) | — | — · — · — |
| TimeInput | 158.4 kB (+56 B) · 15.8 kB CSS (+36 B) | — | — · — · — |
71 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| ComplexSelector | 69.7 kB (+50 B) · 11.7 kB CSS (+40 B) | — | — · — · — |
| TextInput | 66.5 kB (+47 B) · 11.1 kB CSS (+35 B) | — | — · — · — |
| DropdownMenu | 95.6 kB (+39 B) · 17.2 kB CSS (+39 B) | — | — · — · — |
| TabMenu | 70.6 kB (+42 B) · 11.0 kB CSS (+34 B) | — | — · — · — |
| MoreMenu | 95.9 kB (+35 B) · 17.2 kB CSS (+39 B) | — | — · — · — |
| NumberInput | 70.5 kB (+38 B) · 11.4 kB CSS (+36 B) | — | — · — · — |
| SideNav | 110.9 kB (+40 B) · 11.3 kB CSS (+33 B) | — | — · — · — |
| MobileNav | 69.4 kB (+41 B) · 10.5 kB CSS (+31 B) | — | — · — · — |
| FileInput | 68.0 kB (+36 B) · 10.9 kB CSS (+35 B) | — | — · — · — |
| SideNavCollapseButton | 59.9 kB (+45 B) · 10.0 kB CSS (+26 B) | — | — · — · — |
| TopNav | 71.2 kB (+39 B) · 10.9 kB CSS (+32 B) | — | — · — · — |
| TableHeaderCell | 107.0 kB (+35 B) · 17.2 kB CSS (+35 B) | — | — · — · — |
| CodeBlock | 73.8 kB (+34 B) · 11.2 kB CSS (+34 B) | — | — · — · — |
| DateTimeInput · Storybook | 204.5 kB (+58 B) · 18.5 kB CSS (+10 B) | 3,599 (0) | — · ✓ · — |
| MultiSelector | 93.5 kB (+33 B) · 16.6 kB CSS (+35 B) | — | — · — · — |
| ChatSendButton | 59.5 kB (+35 B) · 9.9 kB CSS (+31 B) | — | — · — · — |
| ContextMenu | 106.2 kB (+25 B) · 17.0 kB CSS (+39 B) | — | — · — · — |
| MobileNavToggle | 59.4 kB (+33 B) · 9.9 kB CSS (+31 B) | — | — · — · — |
| Table | 116.4 kB (+30 B) · 17.7 kB CSS (+34 B) | — | — · — · — |
| AlertDialog · Storybook | 104.1 kB (+37 B) · 14.3 kB CSS (+26 B) | 211 (0) | — · ✓ · — |
| Banner | 61.1 kB (+35 B) · 10.4 kB CSS (+28 B) | — | — · — · — |
| IconButton | 59.1 kB (+31 B) · 9.9 kB CSS (+31 B) | — | — · — · — |
| Lightbox | 117.8 kB (+36 B) · 10.4 kB CSS (+25 B) | — | — · — · — |
| BaseTypeahead | 70.0 kB (+27 B) · 10.9 kB CSS (+33 B) | — | — · — · — |
| Button · Storybook | 59.1 kB (+28 B) · 9.9 kB CSS (+31 B) | 687 (−2) | — · ✓ · — |
| ChatLayoutScrollButton | 59.6 kB (+33 B) · 10.1 kB CSS (+26 B) | — | — · — · — |
| DateInput · Storybook | 182.7 kB (+50 B) · 16.8 kB CSS (+9 B) | 5,685 (+3) | — · ✓ · — |
| Stepper | 60.8 kB (+33 B) · 10.1 kB CSS (+25 B) | — | — · — · — |
| ToggleButton | 60.0 kB (+33 B) · 10.0 kB CSS (+25 B) | — | — · — · — |
| AppShell | 89.6 kB (+24 B) · 13.4 kB CSS (+33 B) | — | — · — · — |
| Toast · Storybook | 96.9 kB (+31 B) · 10.2 kB CSS (+26 B) | 1,644 (0) | — · ✓ · — |
| ChatLayout | 79.3 kB (+31 B) · 10.5 kB CSS (+25 B) | — | — · — · — |
| DialogHeader | 62.0 kB (+31 B) · 11.4 kB CSS (+25 B) | — | — · — · — |
| PowerSearch | 282.4 kB (+56 B) · 23.6 kB CSS (0) | — | — · — · — |
| DrawerHeader | 62.1 kB (+29 B) · 12.8 kB CSS (+26 B) | — | — · — · — |
| ChatComposer | 76.7 kB (+29 B) · 12.0 kB CSS (+25 B) | — | — · — · — |
| TableCell | 107.4 kB (+18 B) · 17.5 kB CSS (+36 B) | — | — · — · — |
| Thumbnail | 63.5 kB (+30 B) · 11.5 kB CSS (+24 B) | — | — · — · — |
| Popover | 87.9 kB (+28 B) · 14.0 kB CSS (+24 B) | — | — · — · — |
| richtext/RichTextEditor | 295.6 kB (+51 B) · 2.6 kB CSS (0) | — | — · — · — |
| Carousel | 68.6 kB (+28 B) · 10.9 kB CSS (+22 B) | — | — · — · — |
| ChatDictationButton | 59.7 kB (+25 B) · 10.0 kB CSS (+25 B) | — | — · — · — |
| lab/TransferList | 106.4 kB (+49 B) · 1.7 kB CSS (0) | — | — · — · — |
| TopNavHeading | 73.8 kB (+30 B) · 11.0 kB CSS (+18 B) | — | — · — · — |
| Pagination | 108.3 kB (+46 B) · 17.5 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 85.5 kB (+45 B) · 2.1 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 274.9 kB (+45 B) · 2.3 kB CSS (0) | — | — · — · — |
| lab/Comments | 337.1 kB (+43 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 85.1 kB (+42 B) · 751 B CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 74.4 kB (+17 B) · 11.2 kB CSS (+24 B) | — | — · — · — |
| Selector | 98.2 kB (+41 B) · 17.1 kB CSS (0) | — | — · — · — |
| TableSelectionToolbar | 69.3 kB (+27 B) · 13.1 kB CSS (+14 B) | — | — · — · — |
| lab/TransferListSelector | 113.1 kB (+41 B) · 1.9 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 250.8 kB (+39 B) · 454 B CSS (0) | — | — · — · — |
| ChatComposerInput | 74.4 kB (+14 B) · 11.2 kB CSS (+24 B) | — | — · — · — |
| DateRangeInput | 91.1 kB (+27 B) · 12.4 kB CSS (+11 B) | — | — · — · — |
| lab/ChatReactionBar | 103.5 kB (+36 B) · 1.1 kB CSS (0) | — | — · — · — |
| lab/ListInput | 100.4 kB (+36 B) · 1.6 kB CSS (0) | — | — · — · — |
| lab/TourStep | 94.2 kB (+35 B) · 590 B CSS (0) | — | — · — · — |
| lab/CommentComposer | 147.2 kB (+33 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 330.1 kB (+33 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 102.4 kB (+30 B) · 773 B CSS (0) | — | — · — · — |
| lab/Schedule | 104.5 kB (+30 B) · 3.9 kB CSS (0) | — | — · — · — |
| Tokenizer | 90.1 kB (+27 B) · 18.4 kB CSS (0) | — | — · — · — |
| Typeahead | 78.4 kB (+26 B) · 12.4 kB CSS (0) | — | — · — · — |
| Timestamp | 32.3 kB (0) · 10.2 kB CSS (+25 B) | — | — · — · — |
| TopNavMenu | 73.4 kB (+34 B) · 11.1 kB CSS (−11 B) | — | — · — · — |
| Calendar | 70.1 kB (+15 B) · 10.5 kB CSS (+1 B) | — | — · — · — |
| SideNavItem | 69.3 kB (+16 B) · 11.0 kB CSS (−8 B) | — | — · — · — |
| SideNavHeading | 74.4 kB (+11 B) · 11.2 kB CSS (−10 B) | — | — · — · — |
| TopNavMegaMenu | 68.5 kB (+10 B) · 11.7 kB CSS (−9 B) | — | — · — · — |
Package size:
- @astryxdesign/cli 3.52 MB packed (+49 B); no new dependencies
- @astryxdesign/core 6.99 MB packed (+318 B); no new dependencies
- @astryxdesign/theme-butter 45.8 kB packed (+143 B); no new dependencies
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 35 rows; run pnpm api:report.
Wide change (shared styles: packages/themes/butter/src/butterTheme.ts): add ci:run-visual or ci:run-rtl to run them.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Requesting changes: the minimum-height approach matches component:Button FR4 and default Button heights are unchanged, but two things need fixing first.
- With a mouse, the Reset button in the DateInput and DateTimeInput bottom sheet (
presentation="bottom-sheet") drops from 28 px to 20 px tall, because itsminBlockSize: {default: null, ...}override now replaces Button'smin-height; give both overridessizeVars['--size-element-sm']as the default (TouchDateField.tsx:346-348,TouchDateTimeField.tsx:344-349). - The changeset says stacked buttons "no longer take each other's taps" under iOS Dynamic Type, but on
mainiOS text does not follow Dynamic Type yet (#10416 is open), so please describe the change itself, including that a callerheightoverride no longer brings a labelled Button below its size.
Non-blocking: the table-filter template's header actions now sit at 28 px instead of 24 px, because height: 'auto' no longer lowers them.
[Automated review]
Two date sheets' Reset buttons set minBlockSize with no default, which now replaced Button's minimum and left them 20 px tall with a mouse; they default to the sm element size. The table-filter template's link-style header actions keep their 24 px with minHeight 0. AlertDialog and Toast tests read the minimum height, and the changeset describes the change itself.
|
/approve-spec 4f6929f |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is still a draft; marking it ready for review runs CI.
A labelled Button's element size is now a minimum height, as component:Button FR4 requires, and default Button heights and icon-only squares are unchanged. Both earlier findings are fixed: the DateInput and DateTimeInput bottom-sheet Reset is back at 28 px with a mouse, and the changeset now describes the change, including the caller height override.
Non-blocking: the table-filter template's Restore header action keeps the base's 24 px through minHeight: 0, under Button's 28 px floor.
[Automated review]
|
/approve-spec 585faf2 |
|
/approve-spec bc225ae |
There was a problem hiding this comment.
Requesting changes: the Button minimum-height change and the Butter theme fix work, but the CLI still bundles the old Butter theme.
- The CLI's bundled copy of the Butter theme (
packages/cli/assets/templates/themes/butter/butterTheme.ts) still setspaddingBlock: 'var(--spacing-3)'onbutton.base, so a Butter theme ejected withastryx theme ejectrenders labelledsmandmdButtons 44 px tall andscripts/check-cli-theme-bundle.test.mjsfails; runpnpm bundle:cli-themesand commit the regenerated copy.
The earlier Butter findings are fixed in the theme package: at the default text size every packaged theme keeps its Button heights, and enlarged labels stay inside their buttons. One optional wording fix for the core changeset is in the inline suggestion.
[Automated review]
|
/approve-spec ebaa4a1 |
There was a problem hiding this comment.
Requesting changes: the Button minimum-height change and the Butter theme package fix work, but the CLI still bundles the old Butter theme.
- The CLI's bundled copy of the Butter theme (
packages/cli/assets/templates/themes/butter/butterTheme.ts:398) still setspaddingBlock: 'var(--spacing-3)'onbutton.base, so a Butter theme ejected withastryx theme ejectrenders labelledsmandmdButtons 44 px tall andscripts/check-cli-theme-bundle.test.mjsfails; runpnpm bundle:cli-themesand commit the regenerated copy.
Larger text now grows every labelled Button around its label, default heights stay the same in the packaged themes, and the date sheet Reset buttons keep their 28 px floor. The optional wording suggestion for the core changeset still applies.
[Automated review]
The CLI bundles a copy of each theme for theme eject. Its Butter copy still set block padding on buttons. The changeset says block padding now counts toward a labelled Button's height.
|
/approve-spec e0e3e88 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is still a draft; marking it ready for review starts CI.
The CLI's bundled Butter theme now matches the theme package, so newly ejected Butter themes keep their button heights and the bundle drift guard passes. Larger text grows every labelled Button around its label, and default heights stay the same in Neutral and Butter.
Optional:
apps/storybook/stories/PowerSearch.stories.tsx:1771setsheight: '20px'on a labelled Button, which no longer applies; useminHeightor drop it.- The CLI changeset could also say that the Butter theme
astryx theme ejectinstalls no longer sets block padding on buttons.
[Automated review]
| '@astryxdesign/cli': patch | ||
| --- | ||
|
|
||
| [fix] The `table-filter` template's link-style header actions keep their compact height now that a labelled `Button`'s size is a minimum height. |
There was a problem hiding this comment.
Non-blocking: this CLI release also ships the regenerated Butter theme for astryx theme eject, which no longer sets block padding on buttons. A second sentence would tell people who eject Butter, for example: "The Butter theme that theme eject installs no longer sets block padding on buttons, so its labelled buttons keep their element heights."
|
/approve-spec 9792b25 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is still a draft; marking it ready for review starts it.
A labelled Button now grows with its label under larger text, its default heights stay the same in the default and Butter themes, and icon-only buttons keep their square. The merge of main changes nothing this depends on, and the earlier fixes (the date sheet Reset height and Butter's block padding in both copies) still hold.
Optional:
apps/storybook/stories/PowerSearch.stories.tsx:1771setsheight: '20px'on a labelled Button, which no longer applies; useminHeightor drop it.- The CLI changeset could add one sentence saying the Butter theme
astryx theme ejectinstalls no longer sets block padding on buttons.
[Automated review]
|
/approve-spec fee7851 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is still a draft; marking it ready for review starts it.
A labelled Button now grows with its label under larger text, its default heights stay the same in the default and Butter themes, and icon-only buttons keep their square. The merge of main changes nothing this depends on, and the earlier fixes (the date sheet Reset height and Butter's block padding in both copies) still hold.
Optional:
apps/storybook/stories/PowerSearch.stories.tsx:1771setsheight: '20px'on a labelled Button, which no longer applies; useminHeightor drop it.- The CLI changeset could add one sentence saying the Butter theme
astryx theme ejectinstalls no longer sets block padding on buttons.
[Automated review]
… height leaves harmless AlertDialog and Toast read the restored labelled Button height.
…ly as before (#10678) * test(Button): at the default text size a labelled button keeps its old geometry (red) * fix(Button): at the default text size a labelled button renders exactly as before #10588 made a labelled Button's size a minimum height and dropped its block padding, so a caller's shorter height (Lightbox's caption toggle) was held at the element size. The height is again a real height: max(element size, 1lh), with the block padding restored. At the default text size one label line is shorter than the element size, so the height is the element size and a caller's height replaces it, as before. Under a larger text size the line is taller and the button grows. The date sheet Reset defaults, Butter's padding removal and the table-filter minHeight that #10588 needed are reverted, with their changesets. * fix: keep #10588's Butter, CLI and table-filter changes, which a real height leaves harmless AlertDialog and Toast read the restored labelled Button height. * Merge remote-tracking branch 'refs/remotes/l4/main' into lane4/button-default-size-exact # Conflicts: # docs/specs/components/Button/Button.spec.md * docs(Button): AR6 leaves a caller's height to that caller, and the changesets match A caller's height now replaces a labelled Button's size, so AR6's 28 px floor names that exception. The Butter and table-filter changesets and the Butter comment no longer say a Button's size is a minimum height. The unit test asserts the restored block padding itself.
Summary
People who use large text on an iPhone tap the button they mean again. Under iOS Dynamic Type (#10416), a Button's label grows with the reader's text size while the button kept its fixed element height. At AX5 a 61 px label sat in a 32 px button, standing outside its own tap target, so stacked buttons took each other's taps: Discard triggered Save, and Reset triggered Save changes (vjeux's iPhone re-check of the Toolbar wrap). A labelled Button's size is now a minimum height: the button grows with its label, so the label stays inside the target it shows. At the default text size every button keeps its size, and icon-only buttons keep their fixed square.
This is part of the "controls grow with text" work that gates #10416.
What changes
Button.tsx:minHeightequal to the size's element size instead ofheight.--spacing-2), so the label's line box decides any height above the minimum. With a fixed height that padding had no visible effect, so default layouts are unchanged.heightat the element size; their glyph doesn't grow with the text.component:ButtonFR4 now reads: the element size is "a minimum that grows with a set text size underspec:AST-102FR4, so a label stays inside its own button… A labelled button has no block padding, so its label's line box decides any height above the minimum. Icon-only… keeps the element size, since its glyph does not grow with the text." The "(today's fixed height is a gap)" note is gone. The FR4 verification row names the new browser spec, which is also inverified_by.spec:AST-102current-state no longer lists Button among controls that hold fixed heights.ButtonTextSize.interaction.browser.spec.ts:[fix].Evidence
Real Chrome against this branch's Storybook preview and current main's. Desktop text zoom scales element sizes too (they're rem), so it can't show this defect. The check enlarges only the buttons' text (
font-size: 40px; line-height: 60px), which is what Dynamic Type does to theme text.Writing rubric results
Re-check at 4f6929f
min-height28 px), the same height as on main.