Repository navigation
fix(Button): inherit default icon size - #5762
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsIcon (@astryxdesign/core) · View in Storybook
IconButton (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 36 accessibility violation(s) found — 2 critical, 34 serious. Button pattern - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
Checkbox pattern - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 1 issue(s)
CodeEditorPerf - 1 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
LogStream - 1 issue(s)
MediaTheme Auto - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
Radio group pattern - 1 issue(s)
RadioList - 1 issue(s)
RichTextEditor - 2 issue(s)
SelectableCard - 1 issue(s)
Stepper - 1 issue(s)
TableGroupedRows - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Visual Regression21 of 420 shot(s) changed. View the report A change here is a question, not a failure: check whether the after is the
and 1 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
2e82834 to
126f0f5
Compare
cixzhang
left a comment
There was a problem hiding this comment.
Thanks for fixing the compact Button sizing. The Button→Icon relationship now lives in two writable maps, and the new context separately copies Icon’s size union; the test checks only data-size. A later scale change can pass while those contracts drift. Could one source drive the wrapper and inherited default, with their rendered sizes tested together?
[Reviewed by Robohands]
cixzhang
left a comment
There was a problem hiding this comment.
Thanks — the shared size source and rendered-size coverage now resolve the previous drift risk. One public contract still disagrees: Icon documents omitted size as always defaulting to md, but Icon.tsx:252 now lets a parent replace that default. Builders reading Icon’s API will not know their icon can render smaller. Could we update Icon’s English, Chinese, dense, and source docs to describe the contextual default?
[Reviewed by Robohands]
0a698b9 to
f3cca8c
Compare
f3cca8c to
a40b24c
Compare
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Thanks for fixing the oversized glyph in small and medium buttons — the Button-to-Icon mapping, shared size scale, and rendered-size tests (including explicit-size precedence) look sound.
One thing blocks approval: Icon's own contract and docs still promise the old default. Icon.spec.md lists md as the Size default with the released default preserved and runtime unchanged, the size JSDoc in Icon.tsx says @default 'md', and Icon.doc.mjs (English, Chinese, and dense) lists 'md' with no contextual rule — yet an unsized Icon in a sm/md Button now renders sm. Builders reading the Icon API will expect the wrong size.
Please update those Icon surfaces to state the actual precedence: explicit size first, then the Button/IconButton context (sm for sm/md controls, md for lg), then the standalone md fallback, and update the contract's compatibility classification to match. Button and IconButton docs already describe this correctly.
[Automated review]
a40b24c to
bd79727
Compare
|
/approve-spec bd79727 |
There was a problem hiding this comment.
Thanks for fixing the oversized glyph in small and medium buttons — and for aligning the contract behind it.
The Button-to-Icon mapping, shared size scale, and rendered-size tests (including explicit-size precedence and the standalone fallback) look sound. Icon's contract now establishes the precedence — explicit size first, then the owning Button/IconButton default (sm for sm/md controls, md for lg), then the standalone md fallback — and Icon's JSDoc and consumer docs in all locales state the same rule, so builders will expect the size the code actually renders.
No blocking findings remain. A few CI checks were still pending at review time rather than failing; please let those finish as usual.
[Automated review]
Superseded by the rebased implementation and Code Bunny approval on bd79727.
cixzhang
left a comment
There was a problem hiding this comment.
Verified on exact head bd79727: contextual Button icon sizing matches the current size-cascade and Button/Icon contracts; explicit Icon sizes and the standalone md fallback remain unchanged. Code Bunny and required CI are green.









Summary
Test plan
pnpm vitest run packages/core/src/Icon/Icon.test.tsx packages/core/src/Button/Button.test.tsx packages/core/src/IconButton/IconButton.test.tsxASTRYX_STRICT_LINT=1 pnpm exec eslint packages/core/src/Button/Button.tsx packages/core/src/Icon/Icon.tsx packages/core/src/Icon/IconDefaultSizeContext.ts packages/core/src/IconButton/IconButton.test.tsxpnpm -F @astryxdesign/core buildpnpm check:repo