Skip to content

fix(mobile): avoid duplicate Clerk auth back buttons - #4803

Open
gabrielelpidio wants to merge 1 commit into
mainfrom
agent/fix-mobile-clerk-auth-back-button
Open

fix(mobile): avoid duplicate Clerk auth back buttons#4803
gabrielelpidio wants to merge 1 commit into
mainfrom
agent/fix-mobile-clerk-auth-back-button

Conversation

@gabrielelpidio

@gabrielelpidio gabrielelpidio commented Jul 29, 2026

Copy link
Copy Markdown

What changed

  • Let Clerk own the signed-out authentication navigation chrome.
  • Hide the app's native stack header while AuthView is active.
  • Restore the native header while Clerk session state loads and for the signed-in account view.
  • Route Clerk's dismiss action back through the enclosing settings navigator.
  • Add focused tests for each header-ownership state.

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.ts
  • pnpm --filter @t3tools/mobile typecheck
  • pnpm 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.ts
  • git diff --check

UI 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

  • The native header is now hidden when Clerk auth is loaded and the user is signed out, preventing a duplicate back button from appearing alongside the Clerk auth UI's own navigation controls.
  • Introduces resolveSettingsAuthHeaderOptions in SettingsAuthRouteScreen.logic.ts to derive headerShown and title from isLoaded/isSignedIn state.
  • The auth view is now dismissible; dismissing it calls navigation.goBack().
  • Behavioral Change: header is shown while session is restoring (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.

resolveSettingsAuthHeaderOptions now drives NativeStackScreenOptions: the native stack header stays visible while the session is still loading or when the user is signed in (Account), and headerShown is false once Clerk is loaded and the user is signed out so AuthView can own back/dismiss chrome.

AuthView is isDismissible with onDismissnavigation.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.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f9e5d22-5e4e-4bbc-852c-147eb216be3d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jul 29, 2026
@gabrielelpidio
gabrielelpidio marked this pull request as ready for review July 29, 2026 15:15

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/mobile/src/features/settings/SettingsAuthRouteScreen.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant