Repository navigation
fix(Button): at the default text size a labelled button renders exactly as before - #10678
Conversation
…ly 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| SideNavHeading | 74.4 kB (+21 B) · 11.2 kB CSS (+53 B) | — | — · — · — |
| TopNavMegaMenu | 68.6 kB (+20 B) · 11.8 kB CSS (+53 B) | — | — · — · — |
| SideNavItem | 69.3 kB (+18 B) · 11.1 kB CSS (+52 B) | — | — · — · — |
72 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TabMenu | 70.7 kB (+25 B) · 11.1 kB CSS (+44 B) | — | — · — · — |
| TopNavMenu | 73.5 kB (−2 B) · 11.2 kB CSS (+55 B) | — | — · — · — |
| Calendar | 70.2 kB (+11 B) · 10.5 kB CSS (+41 B) | — | — · — · — |
| Pagination | 108.4 kB (−4 B) · 17.7 kB CSS (+51 B) | — | — · — · — |
| Typeahead | 78.5 kB (−3 B) · 12.4 kB CSS (+42 B) | — | — · — · — |
| Tokenizer | 90.2 kB (−4 B) · 18.6 kB CSS (+42 B) | — | — · — · — |
| DateRangeInput | 91.1 kB (−4 B) · 12.4 kB CSS (+36 B) | — | — · — · — |
| PowerSearch | 282.7 kB (−14 B) · 23.8 kB CSS (+44 B) | — | — · — · — |
| Selector | 98.3 kB (−9 B) · 17.3 kB CSS (+37 B) | — | — · — · — |
| TableSelectionToolbar | 69.4 kB (−3 B) · 13.2 kB CSS (+31 B) | — | — · — · — |
| ChatComposerInput | 74.5 kB (+3 B) · 11.2 kB CSS (+19 B) | — | — · — · — |
| ChatComposerTokenElement | 74.5 kB (+2 B) · 11.2 kB CSS (+19 B) | — | — · — · — |
| Carousel | 68.6 kB (−1 B) · 10.9 kB CSS (+21 B) | — | — · — · — |
| ChatComposer | 76.8 kB (+1 B) · 12.0 kB CSS (+19 B) | — | — · — · — |
| ChatDictationButton | 59.7 kB (0) · 10.0 kB CSS (+20 B) | — | — · — · — |
| DateInput · Storybook | 183.0 kB (−21 B) · 16.9 kB CSS (+41 B) | 5,698 (−3) | — · — · — |
| TopNavHeading | 73.8 kB (−3 B) · 11.0 kB CSS (+23 B) | — | — · — · — |
| DialogHeader | 62.0 kB (+1 B) · 11.5 kB CSS (+18 B) | — | — · — · — |
| Popover | 87.9 kB (−1 B) · 14.1 kB CSS (+20 B) | — | — · — · — |
| ChatSendButton | 59.6 kB (+1 B) · 9.9 kB CSS (+17 B) | — | — · — · — |
| Stepper | 60.8 kB (−2 B) · 10.1 kB CSS (+20 B) | — | — · — · — |
| Timestamp | 32.3 kB (0) · 10.2 kB CSS (+18 B) | — | — · — · — |
| Button · Storybook | 59.2 kB (−1 B) · 9.9 kB CSS (+17 B) | 690 (+1) | — · — · — |
| MobileNavToggle | 59.5 kB (−1 B) · 9.9 kB CSS (+17 B) | — | — · — · — |
| Thumbnail | 63.5 kB (−2 B) · 11.5 kB CSS (+18 B) | — | — · — · — |
| AlertDialog · Storybook | 104.2 kB (−5 B) · 14.4 kB CSS (+20 B) | 211 (0) | — · — · — |
| ChatLayoutScrollButton | 59.7 kB (−2 B) · 10.1 kB CSS (+17 B) | — | — · — · — |
| ChatLayout | 79.4 kB (−1 B) · 10.5 kB CSS (+15 B) | — | — · — · — |
| DrawerHeader | 62.2 kB (−3 B) · 12.9 kB CSS (+17 B) | — | — · — · — |
| IconButton | 59.2 kB (−3 B) · 9.9 kB CSS (+17 B) | — | — · — · — |
| Lightbox | 119.4 kB (−2 B) · 10.5 kB CSS (+16 B) | — | — · — · — |
| Toast · Storybook | 97.0 kB (−1 B) · 10.2 kB CSS (+15 B) | 1,644 (0) | — · — · — |
| ToggleButton | 85.7 kB (−6 B) · 10.0 kB CSS (+20 B) | — | — · — · — |
| Banner | 61.2 kB (−2 B) · 10.5 kB CSS (+15 B) | — | — · — · — |
| DateTimeInput · Storybook | 204.8 kB (−20 B) · 18.6 kB CSS (+33 B) | 3,613 (0) | — · — · — |
| Markdown | 179.5 kB (+1 B) · 20.3 kB CSS (+12 B) | — | — · — · — |
| SideNavCollapseButton | 60.0 kB (−4 B) · 10.0 kB CSS (+16 B) | — | — · — · — |
| MobileNav | 69.5 kB (−1 B) · 10.6 kB CSS (+11 B) | — | — · — · — |
| AppShell | 89.6 kB (−1 B) · 13.5 kB CSS (+10 B) | — | — · — · — |
| BaseTypeahead | 70.0 kB (−1 B) · 10.9 kB CSS (+10 B) | — | — · — · — |
| CodeBlock | 73.9 kB (+1 B) · 11.2 kB CSS (+8 B) | — | — · — · — |
| TableCell | 107.5 kB (−2 B) · 17.6 kB CSS (+11 B) | — | — · — · — |
| ContextMenu | 106.3 kB (−2 B) · 17.2 kB CSS (+10 B) | — | — · — · — |
| SideNav | 111.0 kB (−3 B) · 11.3 kB CSS (+11 B) | — | — · — · — |
| TopNav | 71.2 kB (−2 B) · 10.9 kB CSS (+10 B) | — | — · — · — |
| Table | 116.4 kB (−1 B) · 17.9 kB CSS (+8 B) | — | — · — · — |
| TableHeaderCell | 107.1 kB (−2 B) · 17.4 kB CSS (+9 B) | — | — · — · — |
| TimeInput | 158.6 kB (−5 B) · 15.9 kB CSS (+12 B) | — | — · — · — |
| MultiSelector | 93.6 kB (−7 B) · 16.8 kB CSS (+13 B) | — | — · — · — |
| BreadcrumbItem | 83.4 kB (−4 B) · 12.1 kB CSS (+9 B) | — | — · — · — |
| DropdownMenu | 95.7 kB (−5 B) · 17.3 kB CSS (+9 B) | — | — · — · — |
| TextInput | 66.6 kB (−5 B) · 11.1 kB CSS (+8 B) | — | — · — · — |
| MoreMenu | 96.0 kB (−8 B) · 17.3 kB CSS (+9 B) | — | — · — · — |
| lab/CommentThread | 332.7 kB (+1 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 102.4 kB (−1 B) · 773 B CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 103.6 kB (−1 B) · 1.1 kB CSS (0) | — | — · — · — |
| lab/DialogHeroHeader | 81.8 kB (−1 B) · 372 B CSS (0) | — | — · — · — |
| lab/Schedule | 104.6 kB (−1 B) · 3.9 kB CSS (0) | — | — · — · — |
| NumberInput | 70.6 kB (−9 B) · 11.4 kB CSS (+7 B) | — | — · — · — |
| lab/TourStep | 94.2 kB (−2 B) · 590 B CSS (0) | — | — · — · — |
| lab/DiffViewer | 85.6 kB (−3 B) · 2.1 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 147.3 kB (−5 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/Comments | 339.4 kB (−5 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 85.2 kB (−6 B) · 751 B CSS (0) | — | — · — · — |
| lab/TransferList | 106.5 kB (−6 B) · 1.7 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 276.1 kB (−7 B) · 454 B CSS (0) | — | — · — · — |
| ComplexSelector | 69.8 kB (−18 B) · 11.8 kB CSS (+10 B) | — | — · — · — |
| FileInput | 68.0 kB (−15 B) · 10.9 kB CSS (+7 B) | — | — · — · — |
| lab/ListInput | 100.5 kB (−9 B) · 1.6 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 113.1 kB (−9 B) · 1.9 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 295.6 kB (−12 B) · 2.6 kB CSS (0) | — | — · — · — |
| richtext/RichTextView | 274.9 kB (−18 B) · 2.3 kB CSS (0) | — | — · — · — |
Package size:
- @astryxdesign/cli 3.52 MB packed (−24 B); no new dependencies
- @astryxdesign/core 7.01 MB packed (+139 B); no new dependencies
- @astryxdesign/theme-butter 45.8 kB packed (−76 B); no new dependencies
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 35 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
Wide change (shared styles: packages/themes/butter/src/butterTheme.ts): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.
Generated by PR Enrichment workflow | View full report
|
/approve-spec 29a6633 |
There was a problem hiding this comment.
Changes requested: three test fixes, after which the change is ready for another look. The reworded component:Button FR4 is owner-approved for this head, and the Button change follows it.
AlertDialog.test.tsx:294fails because StyleX emitsmax(var(--size-element-md),1lh)without the space, so the expectation should use that string.ToastViewport.test.tsx:208-210fails for the same reason and should expectmax(var(--size-element-lg),1lh).Button.test.tsx:856passes even with no block padding, because both padding reads return''on main; assertingexpect(computed.paddingBlock).toBe('var(--spacing-2)')makes it fail without the padding.
In a real-browser run, default-size Buttons render identically to main in all eight themes, a caller's shorter height applies again, and larger text still grows the button.
[Automated review]
… height leaves harmless AlertDialog and Toast read the restored labelled Button height.
|
/approve-spec 7d59164 |
There was a problem hiding this comment.
Changes requested: the reworded component:Button FR4 is owner-approved for this head and the Button change follows it, and the AlertDialog and Toast expectations now pass, but three fixes remain.
- Miss:
component:ButtonAR6 still says every Button is at least 28 CSS pixels tall, while the reworded FR4 lets a caller's height replace the size (a 20 px caller height renders a 20 px Button), so AR6 should leave a caller's height to that caller, as it already does forwidth. .changeset/butter-button-keeps-height.mdand.changeset/table-filter-header-actions-keep-size.mdstill tell consumers that a Button's size is a minimum height, which this pull request undoes, so delete or reword them along with the matching comment atbutterTheme.ts:397-398in both Butter copies.Button.test.tsx:856passes even without block padding because jsdom returns''for both reads, so assertexpect(computed.paddingBlock).toBe('var(--spacing-2)')instead.
The branch also conflicts with main in the Button record's verification table; after the rebase, an engineering owner records the spec decision again by commenting /approve-spec <full head SHA> on the new head. Non-blocking: the FR4 verification row says "each theme" while the browser spec covers Neutral and Butter, and the new Button.tsx comment restates the code.
[Automated review]
…-default-size-exact # Conflicts: # docs/specs/components/Button/Button.spec.md
|
/approve-spec 4d59677 |
There was a problem hiding this comment.
Changes requested: the reworded component:Button FR4 is owner-approved for this head and the Button change follows it, but four fixes remain.
- Miss:
component:ButtonAR6 still says every Button is at least 28 CSS pixels tall, while the reworded FR4 lets a caller's height replace the size (a 20 px caller height renders a 20 px Button), so AR6 should leave a caller's height to that caller, as it already does forwidth. .changeset/butter-button-keeps-height.mdand.changeset/table-filter-header-actions-keep-size.mdstill tell consumers that a Button's size is a minimum height, which this pull request undoes, so delete or reword them along with the matching comment atbutterTheme.ts:397-398in both Butter copies.Button.test.tsx:856passes even without block padding because jsdom returns''for both reads, so assertexpect(computed.paddingBlock).toBe('var(--spacing-2)')instead.- Found by CI: the
lintjob fails becauseButton.test.tsx:842-844is not Prettier-formatted, whichpnpm exec prettier --write packages/core/src/Button/Button.test.tsxfixes by putting therender(...)call on one line.
Any new commit needs a fresh spec decision: an engineering owner, the author included, comments /approve-spec <full head SHA> on the new head. Non-blocking: the FR4 verification row says "each theme" while the browser spec covers Neutral and Butter, and the new Button.tsx comment restates the code.
[Automated review]
…angesets 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.
|
/approve-spec 1ed54da |
There was a problem hiding this comment.
Approved. The reworded component:Button FR4 and AR6 are owner-approved for this head, and the Button change, its tests and the changesets follow them; CI is green on this head.
The four fixes from the previous review are all in: AR6 names the caller-height exception, the Butter and table-filter changesets no longer describe a minimum height, the block-padding test now fails without the padding, and Button.test.tsx is formatted.
One optional suggestion: the size-style comment in Button.tsx gives the label line's length as the reason a caller's height replaces the declaration, while the real reason is that it is a height rather than a min-height; see the inline note for a shorter rewrite.
[Automated review]
| // At the default text size one label line is shorter than the element size, | ||
| // so a caller's height still replaces this one. A larger text size makes the | ||
| // line taller, and the button grows with its label. |
There was a problem hiding this comment.
Non-blocking (INV29): a caller's height replaces this declaration because it is a height, not a min-height, and caller xstyle merges last; the label line's length only decides which value wins. A rewrite that keeps only the reasons:
// A height, not a minimum, so a caller's height still replaces it.
// `1lh` grows the button when a larger text size makes the label line
// taller than the element size.
Summary
At the default text size, every labelled
Buttonnow renders exactly as it did before #10588, including Buttons whose caller sets a shorter height. #10588 made a labelled Button's size a minimum height and dropped its block padding. A caller's shorterheight, like the Lightbox caption's more/less toggle, was then held at the element size and moved 4 px. Under a larger text size, labelled Buttons still grow with their label, as #10416's gate needs.What changes
Button.tsx:height: max(var(--size-element-*), 1lh). The basepaddingBlock(--spacing-2) is restored.1lh, from Button's own label line height) is shorter than the element size, so the height is exactly the element size. A caller'sheightreplaces the whole declaration, as before fix(Button): a labelled button grows with its label #10588.minBlockSizedefaults go back to their pre-fix(Button): a labelled button grows with its label #10588 values, since a real height makes them unnecessary.component:ButtonFR4: "A labelled button's height is that element size, or one line of its label when the line is taller… at the default text size the height is the element size, and a caller's height replaces it."button-grows-with-textchangeset (still unreleased) describes the final behavior.Tests
Button.test.tsx"default size geometry": a caller'sheightholds with no minimum, and the block padding is restored. Both fail on main.ButtonTextSize.interaction.browser.spec.ts: at the default text size, each theme's labelled sm, md and lg Buttons (neutral and Butter) match their element-size tokens exactly. Larger text still grows them.height.Evidence (real Chrome, default text size)
Writing rubric results