Skip to content

feat: DSYS-476 Migrate AvatarIcon to ADR-0003 and ADR-0004#996

Draft
cursor[bot] wants to merge 2 commits intomainfrom
cursor/enum-shared-type-migration-6dcd
Draft

feat: DSYS-476 Migrate AvatarIcon to ADR-0003 and ADR-0004#996
cursor[bot] wants to merge 2 commits intomainfrom
cursor/enum-shared-type-migration-6dcd

Conversation

@cursor
Copy link
Contributor

@cursor cursor bot commented Mar 25, 2026

Description

Migrates the AvatarIcon component to follow ADR-0003 (String Unions) and ADR-0004 (Centralized Types Architecture).

  • Creates AvatarIconSeverity const object (replacing the enum) and AvatarIconPropsShared type in @metamask/design-system-shared
  • Exports the new shared types from the shared package index
  • Updates both the React and React Native packages to import AvatarIconSeverity from the shared package instead of duplicating it in each platform's types/index.ts
  • Removes the AvatarIconSeverity enum from both platform-specific types/index.ts files
  • Updates all component files (constants, component implementation, stories, tests) to import from the correct source
  • Updates Toast.types.ts in React Native which also referenced AvatarIconSeverity

Note: AvatarIconSize remains platform-specific as it is an alias for AvatarBaseSize, which has different values per platform (string labels in React, pixel numbers in React Native).

Related issues

Fixes: DSYS-476

Manual testing steps

  1. Run yarn build from repo root — should complete with no errors
  2. Run yarn test from repo root — all tests should pass with 100% coverage
  3. Run yarn lint from repo root — no lint errors

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I've included tests if applicable
  • I've documented my code using JSDoc format if applicable
  • I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Open in Web View Automation 

cursoragent and others added 2 commits March 25, 2026 17:10
- Create AvatarIconSeverity const object and AvatarIconPropsShared type in design-system-shared
- Export from shared package index
- Update React package to import AvatarIconSeverity from shared
- Update React Native package to import AvatarIconSeverity from shared
- Remove AvatarIconSeverity enum from platform-specific types/index.ts files
- Update constants, component, stories, tests, and figma files to import from correct sources
- Update Toast.types.ts to import AvatarIconSeverity from shared package

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@github-actions
Copy link
Contributor

📖 Storybook Preview

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant