Skip to content

feat(auth)!: require the multi-step auth screens to be given navigation - #2480

Open
demolaf wants to merge 1 commit into
refactor/reauth-remove-shared-flow-couplingfrom
feat/require-navigation-on-multi-step-auth-screens
Open

feat(auth)!: require the multi-step auth screens to be given navigation#2480
demolaf wants to merge 1 commit into
refactor/reauth-remove-shared-flow-couplingfrom
feat/require-navigation-on-multi-step-auth-screens

Conversation

@demolaf

@demolaf demolaf commented Sep 5, 2026

Copy link
Copy Markdown
Member

EmailAuthScreen, PhoneAuthScreen and MfaEnrollmentScreen took their navigation parameters as nullable and fell back to internal localMode/localStep state when they were omitted. That fallback had no back stack and no BackHandler, so system back did nothing and the in-UI switch controls were the only way to move between steps — while the KDoc described those same parameters as a supported way to drive the screens from outside.

The parameters are now required and the fallback is gone, so every caller brings real navigation. Nothing new was published to support that: both slot demos were rewritten to host the screens on their own Navigation 3 back stacks using only existing public API, which is what makes the documented capability real rather than implied.

  • EmailAuthSlotDemoActivity.kt / PhoneAuthSlotDemoActivity.kt: each defines its own NavKey and back stack, so system back steps between modes/steps instead of leaving the flow. Verified on device.
  • Un-ignored and de-flaked all four @Ignored e2e tests, including change phone number navigates back to EnterPhoneNumber step — the back path this change reworks, which had no coverage before.

⚠️ Breaking Changes

  • EmailAuthScreen: mode and onNavigateToMode are now required.
  • PhoneAuthScreen and MfaEnrollmentScreen: step, onNavigateToStep, onNavigateBack and flowState are now required.
  • EmailAuthScreen no longer shows an error dialog of its own. This only affected a caller that installed LocalTopLevelDialogController itself; every caller still receives onError.

Maintainer note: Fixes internal CPRN-415

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors EmailAuthScreen, PhoneAuthScreen, and MfaEnrollmentScreen to always have their navigation steps driven externally by a host, removing the previous local state fallbacks. The demo activities are updated to host these screens on their own Navigation 3 back stacks, and several flaky UI tests are resolved by replacing arbitrary sleeps and state sampling with explicit waits on reported steps. Feedback was provided regarding PhoneAuthDestinations.kt, suggesting that the selectedCountry state should survive activity recreation using rememberSaveable to prevent potential mismatches between the country code and the entered phone number.

Comment thread auth/src/main/java/com/firebase/ui/auth/ui/screens/phone/PhoneAuthDestinations.kt Outdated
@demolaf
demolaf force-pushed the feat/require-navigation-on-multi-step-auth-screens branch 2 times, most recently from 5501907 to 06613dc Compare September 6, 2026 09:52
@demolaf
demolaf marked this pull request as ready for review September 6, 2026 10:20
@demolaf
demolaf force-pushed the feat/require-navigation-on-multi-step-auth-screens branch from 06613dc to c3d559a Compare September 6, 2026 10:32
@demolaf
demolaf force-pushed the feat/require-navigation-on-multi-step-auth-screens branch from c3d559a to d7c45c9 Compare September 6, 2026 10:55
@demolaf
demolaf force-pushed the feat/require-navigation-on-multi-step-auth-screens branch from d7c45c9 to ded9d4f Compare September 6, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant