Uh oh!
There was an error while loading. Please reload this page.
feat(auth)!: migrate auth navigation to Navigation 3 - #2469
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the FirebaseUI Android Auth navigation system from Jetpack Navigation Compose to Navigation 3, introducing a serialized AuthRoute hierarchy to persist the back stack across configuration changes and process death. Feedback on the changes highlights a flaw in the phone number masking heuristic that incorrectly handles three-digit country codes, as well as an opportunity to extract the hardcoded transition duration of 700 ms into a reusable constant.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
71ea2b2 to
dd859f5Comparedd859f5 to
c43f75bComparec43f75b to
cdf4db5Comparecdf4db5 to
371523dCompare
russellwheatley
left a comment
There was a problem hiding this comment.
LGTM - leftover bits can follow up separately
The auth module now navigates with Jetpack Navigation 3. Destinations are typed
NavKeys in aNavBackStacklist rather than string routes in aNavHost, so the address a step carries is a field on the key instead of a URI query argument, and the back stack is a plain list the library can inspect without reflection.Navigation 2 is removed outright —
api(libs.compose.navigation)is gone, replaced byapionnavigation3-runtimeandnavigation3-ui.AuthRoute.kt: extracted fromFirebaseAuthScreen, now a@Serializable sealed interfacesplit intoDestination(a realNavKey) andFlowEntry(names a flow, resolves to its start step). Also holdsresetBackStackTo,pushUniqueandpopOrNull.AuthUITransitions: threeContentTransformspecs receivingScene<NavKey>, replacing fourEnterTransition/ExitTransitionlambdas.Scene<NavKey>.authRoute()is public so a consumer can still vary the animation per destination.NavDisplaythrows on an empty back stack, so every pop goes throughpopOrNull.AuthRouteis a@Serializable sealed interface;routeandroutePatternare gone. Email steps carry their address, soAuthRoute.Email.SignUpis nowAuthRoute.Email.SignUp().Email/Phone/MfaEnrollmentareFlowEntry, not destinations.AuthRoute.Email.Step.withEmailreturns aStep, not aString.AuthUITransitionstakestransitionSpec/popTransitionSpec/predictivePopTransitionSpecinstead of the four Navigation 2 lambdas.navigation3-*transitively instead ofnavigation-compose.Usage
Maintainer note: Fixes internal CPRN-403