fix(app): use router.push when navigating to a forked session#1530
Open
chphch wants to merge 1 commit into
Open
fix(app): use router.push when navigating to a forked session#1530chphch wants to merge 1 commit into
chphch wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 torouter.push(withencodeURIComponent, matching the normal session-open path inuseNavigateToSessionand the plain "Fork" action inuseSessionQuickActions), so the source screen stays on the stack and hardware back behaves as expected.The two other fork/open paths (
useNavigateToSession→router.push, and the non-truncating Fork action) were already correct; onlyDuplicateSheetusedreplace, 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.