Skip to content

fix(Button): a labelled button grows with its label - #10588

Merged
cixzhang merged 13 commits into
mainfrom
lane4/button-grows-with-text
Nov 8, 2026
Merged

cixzhang merged 13 commits into
mainfrom
lane4/button-grows-with-text

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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:
    • Labelled buttons take minHeight equal to the size's element size instead of height.
    • The base style drops its block padding (--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.
    • Icon-only buttons keep a fixed height at the element size; their glyph doesn't grow with the text.
  • component:Button FR4 now reads: the element size is "a minimum that grows with a set text size under spec:AST-102 FR4, 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 in verified_by.
  • spec:AST-102 current-state no longer lists Button among controls that hold fixed heights.
  • New ButtonTextSize.interaction.browser.spec.ts:
    • At the default size, each size's height equals its minimum.
    • With the labels' text enlarged and element sizes untouched, as iOS does, every labelled button contains its label (Primary, Size Variants, Icon With Text).
  • Changeset: core patch, [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.

Story main: label past its button (top / bottom) this branch
Primary, Icon With Text, With End Slot 12 / 11 px (button stays 32 px) 0 (button grows to 60 px)
Size Variants (sm / md / lg) 14 / 13, 12 / 11, 10 / 9 px 0 (60 px each)
Pagination page buttons 12 / 11 px 0; arrows (icon-only) stay 32 px

Writing rubric results

  • R1 narration: none; FR4 and the AST-102 line are present tense.
  • R2 research in the record: none; the measurements stay here.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives: none.
  • R5 pull request or issue references: none.

Re-check at 4f6929f

  • DateInput's bottom-sheet Reset is 28 px tall with a mouse (min-height 28 px), the same height as on main.
  • At the default text size, these stories are pixel-identical to main at 402 px and 1024 px: Button Primary, ButtonGroup Horizontal, AlertDialog Default, Toast Default, Toolbar Three Slot, Card With Inner Layout, OverflowList Default and TablePagination Default.
  • At 250% text and 402 px, labels past their button edges per story (main → this head): ButtonGroup 3→0, Toolbar 2→0, Card 2→0, OverflowList 8→0, TablePagination 5→0, Toast 1→0, Button 1→0.

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

vercel Bot commented Nov 7, 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 8, 2026 8:56am UTC

Request Review

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

astracat-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 8, 2026, 9:00 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 7, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 7, 2026
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 48055ec

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 7, 2026
@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · fee7851

Storybook · Sandbox · built from this PR's head

Modified components

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

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

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 its minBlockSize: {default: null, ...} override now replaces Button's min-height; give both overrides sizeVars['--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 main iOS text does not follow Dynamic Type yet (#10416 is open), so please describe the change itself, including that a caller height override 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]

Comment thread packages/core/src/Button/Button.tsx Resolved
Comment thread .changeset/button-grows-with-text.md Resolved
Comment thread packages/core/src/Button/Button.tsx Resolved
@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 22:29
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.
@cixzhang
cixzhang marked this pull request as draft November 7, 2026 22:53
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 4f6929f

@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: 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]

@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 23:30
@cixzhang
cixzhang marked this pull request as draft November 8, 2026 00:01
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 585faf2

@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec bc225ae

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

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 sets paddingBlock: 'var(--spacing-3)' on button.base, so a Butter theme ejected with astryx theme eject renders labelled sm and md Buttons 44 px tall and scripts/check-cli-theme-bundle.test.mjs fails; run pnpm bundle:cli-themes and 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]

Comment thread .changeset/button-grows-with-text.md Resolved
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec ebaa4a1

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

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 sets paddingBlock: 'var(--spacing-3)' on button.base, so a Butter theme ejected with astryx theme eject renders labelled sm and md Buttons 44 px tall and scripts/check-cli-theme-bundle.test.mjs fails; run pnpm bundle:cli-themes and 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]

@cixzhang
cixzhang marked this pull request as ready for review November 8, 2026 04:51
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.
@cixzhang
cixzhang marked this pull request as draft November 8, 2026 05:26
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec e0e3e88

@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: 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:1771 sets height: '20px' on a labelled Button, which no longer applies; use minHeight or drop it.
  • The CLI changeset could also say that the Butter theme astryx theme eject installs 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.

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.

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

@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9792b25

@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: 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:1771 sets height: '20px' on a labelled Button, which no longer applies; use minHeight or drop it.
  • The CLI changeset could add one sentence saying the Butter theme astryx theme eject installs no longer sets block padding on buttons.

[Automated review]

@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec fee7851

@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: 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:1771 sets height: '20px' on a labelled Button, which no longer applies; use minHeight or drop it.
  • The CLI changeset could add one sentence saying the Butter theme astryx theme eject installs no longer sets block padding on buttons.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 8, 2026 09:44
@cixzhang
cixzhang merged commit 7bc8230 into main Nov 8, 2026
131 checks passed
cixzhang added a commit that referenced this pull request Nov 8, 2026
… height leaves harmless

AlertDialog and Toast read the restored labelled Button height.
cixzhang added a commit that referenced this pull request Nov 8, 2026
…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.
@github-actions
github-actions Bot deleted the lane4/button-grows-with-text branch November 9, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — fee78512 Deployed Nov 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) 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