Repository navigation
feat(core): Avatar adopts Icon's abbreviated size scale - #4140
Merged
Merged
Conversation
Rename Avatar/AvatarGroup named sizes tiny/xsmall/small/medium/large → xsm/sm/md/lg/xl. Pixel values are unchanged (20/24/36/48/128px); the default moves from small to md (same 36px). Avatar's tiers stay larger than Icon's because avatars align with media rather than glyphs. Adds a v0.1.8 codemod (rename-avatar-size-scale) so 'astryx upgrade' migrates call sites automatically.
cixzhang
requested review from
ejhammond,
imdreamrunner and
josephfarina
as code owners
July 21, 2026 12:17
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
July 21, 2026 12:17
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsAvatar · View in Storybook
AvatarGroup · View in Storybook
Chat · View in Storybook
Item · View in Storybook
Table · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 6 accessibility violation(s) found — 1 critical, 5 serious. Avatar - 1 issue(s)
AvatarGroup - 1 issue(s)
Chat - 1 issue(s)
Item - 2 issue(s)
Table - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
The Avatar size-scale rename codemod incorrectly rewrote the 'medium' literal in the TaskPriority union to 'lg', while all priority data and the PRIORITY_COLOR/PRIORITY_LABEL record keys still use 'medium' — a type error unrelated to Avatar sizing. TaskPriority is a task-tracker enum, not an Avatar size, so revert that one token.
Contributor
Author
|
The build/build-sandbox failure was collateral from the size-scale rename: it rewrote the |
The context-blind type-union and object-property passes renamed common words (small/medium/large) in any file importing Avatar, which rewrote an unrelated TaskPriority union and broke the sandbox build. Restrict small/medium/large renames to Avatar/AvatarGroup `size` JSX attributes (where the component is known); keep the broader passes only for the Avatar-unique names tiny/xsmall. Adds precision-guard tests.
The precise/ambiguous split left size option arrays partially renamed (unique tiny/xsmall migrated, ambiguous small/medium/large not), so the codemod couldn't reproduce committed Storybook callsites. Treat an array containing an Avatar-unique name (tiny/xsmall) as the full size enum and rename all its members; add a standalone-array pass for `[...].map()` size lists. Unrelated arrays/unions without a unique name stay untouched, preserving the TaskPriority fix.
This was referenced Aug 24, 2026
cixzhang
added a commit
that referenced
this pull request
Aug 24, 2026
… widen it to the trigger line (#5377) * refactor(MultiSelector): rename formatTriggerCount to formatValue and widen it to the trigger line formatValue now receives the selected items ({value, label}[]) and formats the trigger for triggerDisplay 'count' and 'labels'; 'badges' renders elements, so it is excluded. The prop is unreleased, so no codemod or deprecation is needed. Defaults are unchanged when the prop is absent. * fix(storybook): Chat story uses Avatar size 'sm' after the abbreviated size scale #3933 landed a story with size="small" after #4140 replaced Avatar's named sizes with the abbreviated scale, so build-storybook's typecheck fails on main and blocks every PR based on it.
cixzhang
added a commit
that referenced
this pull request
Aug 24, 2026
…tory (#5381) Avatar's named scale became `xsm | sm | md | lg | xl` (#4140); the align story landed afterwards with `size="small"` (#3933), so `pnpm -F @astryxdesign/storybook typecheck` fails on main and takes the `build` job with it. Every open PR is blocked behind it. Every other Avatar in the file uses a token from the current scale.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Avatar and AvatarGroup now use the same abbreviated size scale as Icon —
sizeacceptsxsm/sm/md/lg/xlinstead oftiny/xsmall/small/medium/large. Pixel values are unchanged (20/24/36/48/128px); only the names move. The default shifts fromsmalltomd, which is the same 36px.tinyxsmxsmallsmsmallmd← defaultmediumlglargexlWhy
Icon, Spinner, and Avatar each spoke a different size dialect (#2672), so composing them or generating code meant learning three vocabularies. This aligns Avatar's names with Icon's while keeping its larger values — avatars align with media, not glyphs, and these tiers match EPS's avatar sizes. Standardizing the default to
mdcompletes the alignment.Risk
Breaking rename of a public prop's string values. Shipped with a
v0.1.8codemod (rename-avatar-size-scale) that migrates call sites viaastryx upgrade. Because the values don't change, rendered output is identical; only the API surface moves. Callers relying on the default need no change (small→md, both 36px).Codemod precision.
small/medium/largeare common English words (priorities, statuses, breakpoints), so the codemod renames those three only on asizeJSX attribute of an Avatar/AvatarGroup element (alias-aware, import-scoped) — never blind in object properties or type unions, which would corrupt unrelated literals. The Avatar-unique namestiny/xsmallare additionally migrated in size-keyed props, Storybookoptions, and union types within files importing Avatar. Rare ambiguous object-property cases (e.g.args: {size: 'small'}where the component isn't statically known) are intentionally left for manual migration rather than risk a wrong rewrite.Testing
pnpm test(Avatar, AvatarGroup, codemod, registry — all green), core + docs + template-docs typecheck, lint, and changeset checks pass. Added 10 codemod tests covering each rename, alias/import-source scoping, numeric passthrough, and negative cases (non-Avatar files and non-size strings left untouched). Repo call sites (stories, templates, example apps, docs) migrated with the codemod itself.