Skip to content

Follow-Up Work

Items identified during UX component design that are deferred to future work.

Avatar Rewrite to Compose ImageDisplay (Option B)

Section titled “Avatar Rewrite to Compose ImageDisplay (Option B)”

Context: During the design review of UI Components, the question was raised whether the existing Avatar atom could be reimplemented using the new ImageDisplay molecule, since both render images with loaded/loading/error states and initials-based placeholders.

Current decision: Keep Avatar as-is for this project. The only change is extracting getInitials to a shared utility (minor modification). The full rewrite is deferred.

Option B proposal: Avatar becomes a thin wrapper that passes imageUrl and entityName to ImageDisplay and applies circular clipping plus its own size variants.

Pros:

  • Single image rendering path — loaded/loading/error states defined once in ImageDisplay.
  • Future improvements to image rendering (shimmer, error badge, lazy loading) automatically apply to Avatar.
  • Less total code.
  • When Avatar editing becomes a use case (user profile images), the entire upload/preview/crop pipeline is reused with a different ImageFieldConfig.

Cons:

  • Avatar is circular with size variants (sm/default/lg); ImageDisplay is rectangular with a size hint. The shape difference means ImageDisplay would need a displayShape: 'square' | 'circle' parameter to be shape-agnostic.
  • Existing Avatar consumers could see subtle visual regressions if the rendering path changes (shimmer timing, Radix fallback delayMs).
  • Risk of destabilizing a widely-used component mid-project.

Prerequisites:

  • ImageDisplay must be stable and battle-tested in grid and form contexts first.
  • Add displayShape: 'square' | 'circle' to ImageFieldConfig to support circular crops and display.
  • The ImagePreviewEditor crop preview would show a circular crop guide when displayShape is 'circle'.

Estimated effort: ~2-3 hours of implementation + testing. Main work is making ImageDisplay shape-agnostic, updating Avatar to compose it, and verifying all existing Avatar stories render correctly.

When to do it: After the Item Image Upload project ships and ImageDisplay is proven in production. The Avatar editing use case (user profile images) would be the natural trigger.


Copyright: (c) Arda Systems 2025-2026, All rights reserved