feat(ui): add hosted navigation for embedding in host-owned chrome#798
Draft
mikepitre wants to merge 1 commit into
Draft
feat(ui): add hosted navigation for embedding in host-owned chrome#798mikepitre wants to merge 1 commit into
mikepitre wants to merge 1 commit into
Conversation
Hosts that embed UserProfileView or AuthView inside their own navigation chrome (e.g. the Expo SDK, or apps with their own top app bar) can now pass the new optional hostedNavigation parameter. When provided, Clerk's top app bars are hidden and the host observes stack depth and drives pop()/popToRoot() through the ClerkHostedNavigation handle. Behavior is unchanged when the parameter is omitted. Affects the ui module only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Hosts that embed
UserProfileVieworAuthViewinside their own navigation chrome (the Expo SDK, or native apps with their own top app bar) get a double header, and their back affordances can't reach the components' internal back stacks. This is the Android half of the same feature landing in clerk-ios (clerk-ios#519); the consuming side is clerk/javascript#9121, which needs this in a release before its gradle module compiles. Context: Slack thread.What this adds
A public
ClerkHostedNavigationhandle (com.clerk.ui.navigation) plus an optionalhostedNavigationparameter onUserProfileViewandAuthView(defaultnull= behavior unchanged). When passed:ClerkTopAppBaris the single choke point every screen renders through, so hiding is one early-return there.depth/canGoBackas Compose state (driven bysnapshotFlowover the component'sNavBackStack) andpop()/popToRoot()commands, wired through one sharedHostedNavigationEffectscomposable.onAddAccount, same as today.No title reporting — the host owns its header text.
Modules
source/uionly.Testing
:source:ui:testDebugUnitTest: newClerkHostedNavigationTestplus the fullcom.clerk.ui.userprofiletest package passspotlessCheckcleandetektreports the same 7 pre-existing findings as untouched main (all in files this PR doesn't modify); zero new findingsNo Paparazzi snapshot changes: the default-parameter path renders identically.
🤖 Generated with Claude Code