Skip to content

fix(app): use router.push when navigating to a forked session#1530

Open
chphch wants to merge 1 commit into
slopus:mainfrom
chphch:fix/fork-back-android-exit
Open

fix(app): use router.push when navigating to a forked session#1530
chphch wants to merge 1 commit into
slopus:mainfrom
chphch:fix/fork-back-android-exit

Conversation

@chphch

@chphch chphch commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Forking a session via the Duplicate (fork-with-truncation) sheet navigated to the newly created session with router.replace, which drops the current screen from the navigation back stack. On Android, pressing the hardware back button on the new session screen then had nothing to return to, so the app closed instead of returning to where the fork started. This changes that one navigation call to router.push (with encodeURIComponent, matching the normal session-open path in useNavigateToSession and the plain "Fork" action in useSessionQuickActions), so the source screen stays on the stack and hardware back behaves as expected.

The two other fork/open paths (useNavigateToSessionrouter.push, and the non-truncating Fork action) were already correct; only DuplicateSheet used replace, so this brings it in line with them.

Note: this is Android hardware-back navigation behavior, which the web test harness can't exercise. Verified by root-cause (push vs replace back-stack semantics) and pnpm typecheck (rc=0) on the identical diff.

The fork-with-truncation (Duplicate) sheet navigated to the new session
with router.replace, which removes the current screen from the back stack.
On Android, pressing the hardware back button on the new session screen
then had nothing to return to and closed the app instead of returning to
the session list. Use router.push (matching the normal open and plain Fork
paths) so back returns to where the fork started.
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