feat(ui): Immutable attributes in UserProfile#7931
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: d4f717d The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR prevents modification of immutable user attributes. It adds an optional 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/ui/src/components/UserProfile/AccountPage.tsx`:
- Line 34: Remove the debug console.log from the render path in AccountPage.tsx:
eliminate the line logging immutableAttributes (console.log('[clerk-ui]
immutableAttributes:', [...immutableAttributes])); instead, if you need
non-production diagnostics, move logging out of the render flow into a
development-only guard (e.g., check process.env.NODE_ENV === 'development') or
use the project's logger utility and log at a non-verbose level outside the
component render (referencing immutableAttributes and the AccountPage component
to locate the code).
ℹ️ Review info
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (10)
.changeset/bumpy-wings-travel.mdpackages/shared/src/types/userSettings.tspackages/ui/src/components/UserProfile/AccountPage.tsxpackages/ui/src/components/UserProfile/EmailsSection.tsxpackages/ui/src/components/UserProfile/PhoneSection.tsxpackages/ui/src/components/UserProfile/UsernameSection.tsxpackages/ui/src/components/UserProfile/__tests__/EmailsSection.test.tsxpackages/ui/src/components/UserProfile/__tests__/PhoneSection.test.tsxpackages/ui/src/components/UserProfile/__tests__/UsernameSection.test.tsxpackages/ui/src/contexts/components/UserProfile.ts
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Description
When an attribute is marked as
immutablein the user settings, do not allow users to add, remove, or edit it. We currently support phone number, email address, and username. Do not show the three dot action menu if there are no available actions.Sample screenshot with username, phone, and email immutable. Note that there is no add button, nor is there an action menu to remove:
Sample screenshot with same settings, but with two emails on account. Now the action menu is rendered, but the only option is to change which email is primary (which we do not block if an attribute is immutable):
If a user tries to connect an OAuth account which would add a new email address to their profile, we follow the existing patterns and display the apierror. There are no new UI changes here, as per the design.
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Tests
Chores