Skip to content

Conversation

@alexcarpenter
Copy link
Member

@alexcarpenter alexcarpenter commented Jan 21, 2026

Description

Follow up to #7560

Extract <ProviderIcon /> component to ensure consistency across the usages. Ensures icons are inverted properly, not just within sign-in or sign-up components.

BEFORE AFTER
Screenshot 2026-01-21 at 11 45 32 AM Screenshot 2026-01-21 at 11 43 45 AM

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features

    • Added a ProviderIcon for consistent provider icon rendering across the UI.
  • Refactor

    • Replaced varied icon implementations with the unified ProviderIcon in multiple UI components to simplify rendering.
  • Tests

    • Added comprehensive tests for ProviderIcon and updated existing tests to verify accessible icon labeling and behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: fe0801e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/ui Minor
@clerk/chrome-extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 21, 2026 6:10pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

Adds a new ProviderIcon component at packages/ui/src/common/ProviderIcon.tsx and re-exports it from packages/ui/src/common/index.ts. Replaces prior Image/ProviderInitialIcon rendering across multiple UI components (SignIn, SignUp, UserProfile, Web3, SocialButtons, etc.) to consolidate icon logic. Adds a changeset documenting the minor release and introduces tests for ProviderIcon; updates existing tests to locate icons via accessible labels instead of asserting image src.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main changeset objective of extracting a new ProviderIcon component for consistent icon rendering across the UI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 21, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7633

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7633

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7633

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7633

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7633

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7633

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7633

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7633

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7633

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7633

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7633

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7633

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7633

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7633

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7633

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7633

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7633

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7633

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7633

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7633

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7633

commit: fe0801e

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/ui/src/components/UserProfile/ConnectedAccountsSection.tsx`:
- Around line 156-170: The component dereferences
providerToDisplayData[account.provider] in multiple places but only guards it
inside ImageOrInitial, causing a runtime crash when provider data is missing;
centralize retrieval by creating a single providerData variable from
providerToDisplayData[account.provider] at the top of the render (used by
ImageOrInitial, label rendering, and descriptors), then use safe fallbacks
(e.g., a generic icon URL or a fallback name like account.provider or "Unknown
provider") wherever providerData is undefined; update ImageOrInitial, the label
text usage, and any
descriptors.socialButtonsProviderIcon.setId(account.provider) usage to reference
this providerData/fallback so no direct dereference of
providerToDisplayData[account.provider].name remains.

isDisabled={card.isLoading}
src={strategyToDisplayData[strategy].iconUrl}
alt={`Connect ${strategyToDisplayData[strategy].name}`}
sx={theme => ({ width: theme.sizes.$5 })}
Copy link
Member Author

Choose a reason for hiding this comment

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

Unsure why we'd increase the size of the web3 icons here. I removed, so its consistent with the SSO icons, but let me know if this was intentional.

Copy link
Member

@brkalow brkalow left a comment

Choose a reason for hiding this comment

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

👏 nice cleanup

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/ui/src/common/__tests__/ProviderIcon.test.tsx`:
- Line 49: Remove the unused "container" variable from the render()
destructuring in the ProviderIcon.test.tsx test cases; locate the render(...)
calls that currently do "const { container, ... } = render(...)" and delete
"container" from the destructured list (or simply use "render(...)" without
destructuring if nothing else is needed) so ESLint's no-unused-vars is not
triggered — apply this change for all test cases that currently destructure
container (the occurrences noted in the review).

@alexcarpenter alexcarpenter force-pushed the alexcarpenter/consolidate-provider-icon-component branch from 855c0b4 to 0c61521 Compare January 21, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants