fix: smooth manage account transitions and email creation - #868
Conversation
Flatten profile detail sections into keyed lazy-list items so users with many identifiers and connected accounts do not compose off-screen rows during navigation. Add high-cardinality regression coverage.
📝 WalkthroughWalkthroughThe API now defaults email-address creation to the active session ID. The profile UI now uses memoized themes, keyed lazy lists, non-interactive rows during navigation, and an animated detail overlay with back handling. ChangesAPI session resolution
Profile rendering and navigation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant UserProfileView
participant UserProfileDetailViewWithBackHandler
participant ProfileSections
User->>UserProfileView: select profile action
UserProfileView->>UserProfileDetailViewWithBackHandler: show animated detail overlay
UserProfileDetailViewWithBackHandler->>ProfileSections: render lazy profile sections
ProfileSections->>ProfileSections: enable interaction when navigation reaches RESUMED
User->>UserProfileView: press back
UserProfileView->>UserProfileDetailViewWithBackHandler: hide detail overlay
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Send the active session ID in the create-email request so authenticated profile updates are accepted. Add a regression test covering the default query parameter.
Delay row view models, menus, remote logos, and client refreshes until the destination is resumed. Memoize resolved theme objects so the profile transition avoids rebuilding stable styling state on every composition.
Keep the account and manage-account surfaces mounted and animate only their layer translations. This prevents high-cardinality account rows from being composed or measured during forward and reverse transitions.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
source/ui/src/main/java/com/clerk/ui/theme/ClerkThemeProvider.kt (1)
99-100: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winKey typography memoization by its actual input.
Use
remember(theme?.typography)becausegenerateTypographyreads onlytheme?.typography. This avoids recreatingTypographywhen only colors or design change.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@source/ui/src/main/java/com/clerk/ui/theme/ClerkThemeProvider.kt` around lines 99 - 100, Update the typography memoization in ClerkThemeProvider around generateTypography to key remember by theme?.typography rather than the entire theme. Preserve the existing generateTypography call while ensuring color or design-only changes do not recreate Typography.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@source/ui/src/main/java/com/clerk/ui/theme/ClerkThemeProvider.kt`:
- Around line 99-100: Update the typography memoization in ClerkThemeProvider
around generateTypography to key remember by theme?.typography rather than the
entire theme. Preserve the existing generateTypography call while ensuring color
or design-only changes do not recreate Typography.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0653eda1-a04b-4ef3-9de9-f4d6ed2bcfc5
📒 Files selected for processing (16)
source/api/src/main/kotlin/com/clerk/api/network/api/UserApi.ktsource/api/src/test/java/com/clerk/api/network/api/UserApiTest.ktsource/ui/src/main/java/com/clerk/ui/theme/ClerkComposeTheme.ktsource/ui/src/main/java/com/clerk/ui/theme/ClerkThemeProvider.ktsource/ui/src/main/java/com/clerk/ui/userprofile/UserProfileView.ktsource/ui/src/main/java/com/clerk/ui/userprofile/common/UserProfileButtonRow.ktsource/ui/src/main/java/com/clerk/ui/userprofile/connectedaccount/UserProfileExternalAccountRow.ktsource/ui/src/main/java/com/clerk/ui/userprofile/connectedaccount/UserProfileExternalAccountSection.ktsource/ui/src/main/java/com/clerk/ui/userprofile/detail/UserProfileDetailView.ktsource/ui/src/main/java/com/clerk/ui/userprofile/email/UserProfileEmailRow.ktsource/ui/src/main/java/com/clerk/ui/userprofile/email/UserProfileEmailSection.ktsource/ui/src/main/java/com/clerk/ui/userprofile/phone/UserProfilePhoneRow.ktsource/ui/src/main/java/com/clerk/ui/userprofile/phone/UserProfilePhoneSection.ktsource/ui/src/test/java/com/clerk/ui/theme/ClerkThemeSnapshotTest.ktsource/ui/src/test/java/com/clerk/ui/userprofile/connectedaccount/UserProfileExternalAccountSectionTest.ktsource/ui/src/test/java/com/clerk/ui/userprofile/email/UserProfileEmailRowTest.kt
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
clerk/javascript(auto-detected)clerk/dashboard(auto-detected)
Summary
Why
The customer has enough email addresses and connected accounts that entering Manage account eagerly composed and measured substantial row content while the navigation transition was already running. Lazy rendering removed the sustained work, but destination setup still produced a visible hitch at the start of the slide.
The final transition keeps both profile surfaces at fixed full-screen positions and moves their existing graphics layers. Manage account is prepared offscreen before the user taps Profile, so the animation does not create, measure, or tear down high-cardinality content. Other profile destinations continue to use the existing Navigation3 stack.
While validating the flow, adding an email returned
authentication_invalidbecause_clerk_session_idwas populated with auser_...ID. The create-email endpoint now defaults to the activesess_...ID, consistent with the other user endpoints.Impact
Forward and reverse Manage account transitions retain the requested slide while avoiding composition and layout work during the animation. The list remains lazy and preserves its layout, scrolling, actions, and refresh behavior. Creating an email address now sends the authentication context expected by the backend.
MOBILE-621
Screen_recording_20260810_173104.mp4
Summary by CodeRabbit
New Features
Bug Fixes
Performance