fix(auth)!: remove the sign-in controls made redundant by per-step navigation - #2482
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the authentication screens (EmailAuthScreen, PhoneAuthScreen, and MfaEnrollmentScreen) to delegate their navigation state (current mode or step) entirely to the hosting environment using a real back stack (e.g., Navigation 3). Local step and mode state, along with in-form navigation buttons, have been removed in favor of system back-press handling and host-driven navigation. Additionally, verification teardown has been unified so that backing out of code entry properly cancels the verification in flight. Tests and demo activities have been updated to host these screens using the new back-stack pattern, and several flaky tests have been stabilized. There are no review comments provided, so I have no additional feedback to offer.
7cc73df to
04ed088
Compare
04ed088 to
d9b2cc2
Compare
#2480 made every email mode its own destination, but three in-form controls still duplicated what system back does — and back itself fell short in two places, so removing them first would have made the flow worse.
Back now does the whole job: off phone code entry it runs the same teardown "change number" does, so a late auto-verification can no longer sign the user in on the number they just abandoned; and when it reveals an email step it keeps the address typed so far instead of emptying the field. With that true, the three controls are redundant and go.
SignUpUI.kt/ResetPasswordUI.kt: theSIGN INaction-row buttons are removed — the reset-link dialog's dismiss still navigates to sign-in.SignInEmailLinkUI.kt: theSIGN IN WITH PASSWORDtoggle and its divider are removed.SignInUI's email-link toggle stays, being the only way into that mode.PhoneAuthScreenTest.kt: zero-pad the generated German mobile number — unpadded it was an invalid length for ~2.8h out of every 27.8h, failing that test deterministically inside the window.Two harnesses drove the modes from a plain variable rather than a back stack, one of them pinning the resulting password carry-over as expected behaviour; both now host on a real
NavDisplay, which is what lets the removals stand. The full unit and e2e suites pass.SignUpUIandSignInEmailLinkUI:onGoToSignInremoved.FirebaseAuthTestTags:SignUp.SIGN_IN_BUTTON,ResetPassword.SIGN_IN_BUTTONandEmailLink.PASSWORD_SIGN_IN_BUTTONremoved.AuthUIStringProvider:signInWithPasswordremoved, along with its 85 translations.Preview
Sign up
Recover password
Email-link sign-in
Maintainer note: Fixes internal CPRN-408, CPRN-410