#21

Show provider icons in account selectors

MergedstylesshOwnermerged intofrom

Summary

  • replace generated avatars in desktop account selectors with account-provider marks
  • show the official vendored Gmail logo for Gmail accounts and the custom-domain globe for hosted mail
  • reuse the same exhaustive provider component in settings and the mobile account menu
  • include the provider type in accessible account names while keeping the decorative mark silent

Validation

  • pnpm test (63 passing)
  • focused ESLint on all changed files
  • pnpm exec tsc --noEmit
  • pnpm build
  • git diff --check
  • browser QA at 1280px and 320px with both hosted and Gmail preview accounts; no horizontal overflow and provider-aware accessible names confirmed

Activity

4
mikeyreviewed3mo ago
mikey3mo ago

Review summary

Reviewed the diff (ee2af65..d3e5f75) across all four changed files: components/mail/mail-account-icon.tsx (new), components/settings/mail-accounts-settings.tsx, components/shell/mobile-nav.tsx, components/shell/sidebar.tsx.

No blocking correctness, security, or reliability issues found.

What I checked:

  • New MailAccountIcon component: exhaustive switch over MailConnectorId ("hosted" | "gmail") with a never-typed default guarding future connector additions — verified against lib/mail/types.ts and lib/mail/connectors.ts, no third variant exists today.
  • Token references (colors.textMuted, colors.surfaceActive, radius.lg) all resolve in theme/tokens.stylex.ts.
  • /providers/gmail.svg asset exists in public/providers/.
  • No stale references to the removed ProviderIcon helper or unused imports left behind (radius/Icons still used in mail-accounts-settings.tsx; Avatar import removed from sidebar.tsx but still consumed elsewhere in components/mail/message-card.tsx, so nothing orphaned).
  • Decorative marks are correctly aria-hidden, while the new aria-labels on Menu.Item/account-switcher button (${label} account, ${email}) supply the accessible name per base-ui's normal aria-label precedence — this doesn't hide the aria-current/highlighted state, which is a separate attribute.
  • No behavior regression in the settings page: MailAccountIcon with size="large" reproduces the prior 36x36 boxed layout exactly; size="small" (mobile nav / sidebar) is a new call site, not a behavior change to existing surfaces.

Non-blocking notes:

  • No unit/component test was added for the new MailAccountIcon component, but this matches the existing convention for sibling presentational components in this tree (no tests for the old ProviderIcon, Avatar, etc.), so I wouldn't hold this up on it.

I wasn't able to run pnpm test/tsc/pnpm build myself in this environment (no pnpm available), so I'm relying on static inspection plus the validation steps already listed in the PR description.

stylessh merged commit 0ba4370 into main3mo ago

Branch stylessh/account-provider-icons has been merged.

Checking branch