Repository navigation
Closed
Labels
hardeningComponent hardening and quality sweep
Description
Summary
The AvatarGroupOverflow "+N" indicator is a fixed-size circle. With larger counts (e.g. +4912) the text is wider than the circle and appears to clip / crowd the edges. For longer content, let the indicator grow horizontally into a pill (stadium shape) so the number always fits with comfortable padding, while short counts (+5) stay a circle.
Current behavior
AvatarGroupOverflow renders at a fixed square size with a full radius:
dynamicStyles.size(s) => { width: s, height: s } // fixed square
styles.base => { borderRadius: radiusVars['--radius-full'] } // → circle
Because width is pinned to the avatar size, a multi-digit +N has nowhere to go and reads as clipped (see before/after below).
Proposed behavior
- Keep the circle for short content: minimum width = the avatar size (so a single/double-digit
+Nis a perfect circle, matching the avatars). - Let it grow for longer content: switch
width: s→minWidth: s(withheight: sfixed) and add horizontal padding, so wide content expands the indicator horizontally. - Keep
borderRadius: --radius-full— atheight/2it renders as a circle when narrow and a stadium/pill when wide, automatically. No shape prop needed. - Preserve the existing overlap, border ring, opaque background, and interactive (button) states.
Before → after:
| Fixed circle (clips) | Pill grows to fit |
|---|---|
(+4912) cramped in a circle |
( +4912 ) in a stadium/pill |
Design notes
- This is a purely visual/layout change to
AvatarGroupOverflow— likely no new public prop (the pill is automatic based on content width). If we want to cap growth, amaxWidth+ truncation is a follow-up, not required here. - Add horizontal padding via a spacing token so it scales with size; vertical size stays locked to the avatar height so the row stays aligned.
- Overlap math (
marginInlineStart) is unaffected — it keys off the leading edge, which doesn't move. - Themeability: the overflow already emits
themeProps('avatar-group-overflow'); the pill dimensions should stay token-driven so themes aren't broken.
Acceptance criteria
-
+5(short) renders as a circle sized to the avatars, unchanged from today. -
+4912(long) renders as a horizontally-grown pill with the full number visible and comfortable padding — no clipping/crowding. - Row stays vertically aligned with the avatars (height unchanged).
- Overlap, border ring, opaque background, and hover/active/focus (button variant) states all preserved.
- Renders correctly across themes + light/dark.
- Custom
childrencontent (not just+N) also grows to fit.
Notes
- Small, self-contained visual fix — fits the hardening/quality track. Related family: Avatar: show name tooltip by default, auto-disable when wrapped in a tooltip/hovercard #4164, IconButton: show label tooltip by default, allow disabling/overriding (mirror Avatar #4164) #4165 (Avatar/IconButton tooltip work).
Activity
fix(Avatar): AvatarGroupOverflow grows to a pill for long +N counts
fix(Avatar): AvatarGroupOverflow grows to a pill for long +N counts (m…