Skip to content

refactor(web): expose avatar primitives for composition#34057

Merged
lyzno1 merged 1 commit intomainfrom
refactor/avatar-composition
Mar 25, 2026
Merged

refactor(web): expose avatar primitives for composition#34057
lyzno1 merged 1 commit intomainfrom
refactor/avatar-composition

Conversation

@lyzno1
Copy link
Copy Markdown
Member

@lyzno1 lyzno1 commented Mar 25, 2026

Summary

  • expose AvatarRoot, AvatarImage, and AvatarFallback from the base avatar module
  • export shared avatar size class helpers so composed usages can keep the same size tokens
  • keep the default Avatar API intact while rebuilding it on top of the exported primitives

Testing

  • ./node_modules/.bin/eslint app/components/base/avatar/index.tsx

Notes

  • the repository pre-commit type-check:tsgo currently fails on an unrelated existing error in web/app/components/base/features/new-feature-panel/annotation-reply/score-slider/base-slider/index.tsx

@lyzno1 lyzno1 requested review from iamjoel and zxhlyh as code owners March 25, 2026 05:40
Copilot AI review requested due to automatic review settings March 25, 2026 05:40
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 25, 2026
@github-actions github-actions bot added the web This relates to changes on the web. label Mar 25, 2026
@dosubot dosubot bot added the refactor label Mar 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the base web Avatar component to expose composable avatar primitives and shared size-class helpers, while keeping the existing Avatar component API intact.

Changes:

  • Export AvatarRoot, AvatarImage, and AvatarFallback from the base avatar module for composition.
  • Export shared size-token helpers (avatarSizeClasses, AvatarSize, getAvatarSizeClassNames) so composed avatars can reuse the same sizing.
  • Rebuild the default Avatar component implementation on top of the exported primitives and shared class constants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 25, 2026
@lyzno1 lyzno1 merged commit b1cfd83 into main Mar 25, 2026
25 checks passed
@lyzno1 lyzno1 deleted the refactor/avatar-composition branch March 25, 2026 05:43
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.98%. Comparing base (5f82ccc) to head (803079f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #34057   +/-   ##
=======================================
  Coverage   79.97%   79.98%           
=======================================
  Files        4609     4609           
  Lines      182612   182618    +6     
  Branches    35573    35573           
=======================================
+ Hits       146049   146064   +15     
+ Misses      33345    33336    -9     
  Partials     3218     3218           
Flag Coverage Δ
web 81.33% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants