Skip to content

[Due for payment 2026-07-17] [M1] Split Avatar into primitives #95597

Description

@mountiny

Problem

The shared Avatar component is monolithic: user vs workspace forking via type, image vs icon vs letter-avatar rendering, and source/error resolution all live in one file (~175 lines). This blocks removing the type prop and migrating call sites to focused components.

Solution

Extract focused pieces under src/components/Avatar/:

  • AvatarUser.tsx, AvatarWorkspace.tsx, AvatarBody.tsx
  • AvatarImage.tsx, AvatarIcon.tsx, AvatarInitials.tsx
  • useUserAvatarSource.ts, useWorkspaceAvatarSource.ts, useAvatarLoadError.ts
  • types.ts
  • index.tsx facade preserving today's public API

Add unit tests in tests/unit/AvatarTest.tsx.

PR

#95050

Dependencies

Unblocks M3 and M4. M2 (size unification) can land independently but should coordinate merge order to reduce conflicts.

Issue OwnerCurrent Issue Owner: @jmusial

Metadata

Metadata

Labels

DailyKSv2InternalRequires API changes or must be handled by Expensify staffTask

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions