fix(mobile): avoid duplicate Clerk auth back buttons - #4803
fix(mobile): avoid duplicate Clerk auth back buttons#4803gabrielelpidio wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 08daccb. Configure here.
ApprovabilityVerdict: Needs human review An unresolved review comment identifies a potential bug where successful sign-in may incorrectly dismiss the screen instead of showing the Account view. This logic concern warrants human verification. You can customize Macroscope's approvability policy. Learn more. |

What changed
AuthViewis active.Why
The email-code step has its own Clerk back action, while the enclosing settings route also rendered a native back button. Both navigation layers were visible in the same sheet, producing stacked back buttons.
Keeping one navigation owner per state removes the duplicate control without changing the signed-in account screen.
User impact
The Clerk email-code flow now shows one coherent set of navigation controls. Users can still leave the auth flow through Clerk's dismiss action, and signed-in account settings retain the existing native header.
Validation
pnpm vp test run apps/mobile/src/features/settings/SettingsAuthRouteScreen.logic.test.tspnpm --filter @t3tools/mobile typecheckpnpm vp lint apps/mobile/src/features/settings/SettingsAuthRouteScreen.tsx apps/mobile/src/features/settings/SettingsAuthRouteScreen.logic.ts apps/mobile/src/features/settings/SettingsAuthRouteScreen.logic.test.tsgit diff --checkUI changes
No screenshots included. The Clerk email-code flow requires configured interactive authentication and was not launched during this pass.
Generated by GPT-5 in the Codex harness.
Note
Hide duplicate native back button on Clerk auth screen in settings
resolveSettingsAuthHeaderOptionsinSettingsAuthRouteScreen.logic.tsto deriveheaderShownandtitlefromisLoaded/isSignedInstate.navigation.goBack().isLoaded=false) and when signed in, but hidden when loaded and signed out.Macroscope summarized 08daccb.
Note
Low Risk
Localized settings auth UI and header options only; no auth backend or session logic changes.
Overview
Fixes stacked back buttons in settings sign-in by choosing a single navigation owner per Clerk session state.
resolveSettingsAuthHeaderOptionsnow drivesNativeStackScreenOptions: the native stack header stays visible while the session is still loading or when the user is signed in (Account), andheaderShownis false once Clerk is loaded and the user is signed out soAuthViewcan own back/dismiss chrome.AuthViewisisDismissiblewithonDismiss→navigation.goBack(), so users can leave the flow without the hidden native back button. Unit tests cover loading, signed-out auth, and signed-in account header behavior.Reviewed by Cursor Bugbot for commit 08daccb. Bugbot is set up for automated code reviews on this repo. Configure here.