Skip to content

fix(site/src): give built-in emoji avatars a consistent inset - #28492

Merged
tracyjohnsonux merged 14 commits into
mainfrom
fix/emoji-avatar-padding
Aug 25, 2026
Merged

fix(site/src): give built-in emoji avatars a consistent inset#28492
tracyjohnsonux merged 14 commits into
mainfrom
fix/emoji-avatar-padding

Conversation

@tracyjohnsonux

@tracyjohnsonux tracyjohnsonux commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Built-in emoji avatars (/emojis/*.png) rendered inconsistently: edge to edge on user avatars (users table, organization members, group member lists, exposed by the avatar IconField from #26652), and with the tighter icon padding on pages that pass variant="icon" such as workspace proxies.

Avatar gains an emoji variant with a proportional inset of 20% per side, expressed as calc(var(--avatar-*) * 0.2) so it tracks the avatar size tokens. Built-in emoji sources, detected by the shared isBuiltInEmojiUrl helper (site/src/utils/emojis.ts, which also generates the URLs for IconField), always resolve to it, including at call sites that pass variant="icon" for data-dependent sources; the override is documented on AvatarProps. Non-emoji icon avatars are unchanged. Added BuiltInEmoji{Lg,Md,Sm}Size stories.

Investigation notes
  • Suspected MUI-removal regression, but the demui Avatar change (chore(site): demui <Avatar /> and <AvatarCard /> #24527) was style-mechanics only (css prop to style, CSSObject to CSSProperties).
  • Insets have always been opt-in via variant="icon" (compound variants in avatarVariants). Group rows/headers and workspace proxies pass it; user avatar call sites (UsersTable, OrganizationMembersTable, GroupMembersPage, GroupsPageView member column) do not.
  • Emoji user avatars only became reachable with feat: allow editing user avatars #26652, which reuses the group/template emoji picker that produces /emojis/<unified>.png URLs, exposing the missing inset.
  • The icon variant's padding is proportionally tighter at md/sm (12.5%) than lg (20%), which made default-size emojis look oversized, so emojis get their own size-keyed inset instead of reusing the icon variant.
  • Fixed in the shared component rather than at each call site so all current and future emoji avatars are consistent.

🤖 Generated by Coder Agents on behalf of @tracyjohnsonux

@linear-code

linear-code Bot commented Aug 24, 2026

Copy link
Copy Markdown

ENG-3277

@tracyjohnsonux
tracyjohnsonux marked this pull request as ready for review August 25, 2026 04:58
@tracyjohnsonux tracyjohnsonux changed the title fix(site/src/components/Avatar): pad built-in emoji avatars like icons fix(site/src): give built-in emoji avatars a consistent inset Aug 25, 2026
Comment thread site/src/components/Avatar/Avatar.tsx Outdated
Comment on lines +56 to +68
size: "lg",
variant: "emoji",
className: "p-[calc(var(--avatar-lg)*0.2)]",
},
{
size: "md",
variant: "emoji",
className: "p-[calc(var(--avatar-default)*0.2)]",
},
{
size: "sm",
variant: "emoji",
className: "p-[calc(var(--avatar-sm)*0.2)]",

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.

I think these classNamees can be probably fine with a style: {}. I'll have an agent follow up but other than that this is easy 🙂

@tracyjohnsonux
tracyjohnsonux enabled auto-merge (squash) August 25, 2026 05:51
@tracyjohnsonux
tracyjohnsonux merged commit 7540042 into main Aug 25, 2026
26 checks passed
@tracyjohnsonux
tracyjohnsonux deleted the fix/emoji-avatar-padding branch August 25, 2026 05:54
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants