fix(mobile): avoid duplicate Clerk auth back buttons - #4803
gabrielelpidio wants to merge 3 commits 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 |
ApprovabilityVerdict: Needs human review This PR introduces significant terminal buffer management changes (async chunked feeding, epoch tracking, generation handling) beyond the stated auth button fix. The scope of runtime behavior modifications across native iOS and TypeScript warrants human review. You can customize Macroscope's approvability policy. Learn more. |
|
The signed-in state has the same issue fwiw, but it seems you intentionally had it not touch the signed-in state? |
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 d9a445c. Configure here.

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
Fix duplicate back buttons in mobile Clerk auth by hiding the native header during sign-in
resolveSettingsAuthHeaderOptionsin SettingsAuthRouteScreen.logic.ts to derive header visibility from Clerk load/sign-in state; the native header is hidden when Clerk controls its own navigation chrome.onDismisscallback that callsnavigation.goBack().bufferEpoch/bufferStart/bufferEndtracking across the terminal buffer state machine in terminalSession.ts, enabling append-vs-replace decisions via the newgetTerminalBufferUpdateutility.Macroscope summarized 699c574.
Note
Medium Risk
Terminal display logic changes on web, mobile JS, and native iOS simultaneously; incorrect append/replace could corrupt or flash terminal output. Settings auth changes are limited to header visibility and dismiss navigation.
Overview
This PR combines mobile settings auth navigation fixes with terminal buffer synchronization across client-runtime, web, and iOS native.
Settings auth (mobile):
resolveSettingsAuthHeaderOptionsdrives stackheaderShownand title from ClerkisLoaded/isSignedIn—the native header stays visible while the session restores and on the signed-in account screen, but is hidden whileAuthViewis shown so Clerk’s back/dismiss UI isn’t doubled.AuthViewis dismissible andonDismisscallsnavigation.goBack().Terminal buffers: Session state now tracks
bufferEpoch,bufferStart, andbufferEnd(absolute positions in the retained window). Snapshots/restarts/clears bump epoch; output updates end positions so rollover stays appendable.getTerminalBufferUpdatechooses append, replace, or none using epoch and position overlap instead of relying only on version or string prefix.That metadata flows through mobile
TerminalSurface/ native props; replay/hidden-buffer paths bump epoch or reset start onThreadTerminalRouteScreen. WebThreadTerminalDrawerapplies updates viagetTerminalBufferUpdate. iOST3TerminalViewfeeds Ghostty in 8KB chunks on the main queue, appending when epoch and positions align and resetting the surface when epoch changes or the renderer falls behind.Reviewed by Cursor Bugbot for commit 699c574. Bugbot is set up for automated code reviews on this repo. Configure here.