fix(mobile): dismiss to Agents list after remote session exit - #5423
Conversation
Replace the success-path router.replace with router.dismissTo so POP_TO truncates the exited agent-chat route off the (app) stack and focuses the existing (tabs) entry. The next back gesture no longer returns to the exited session page.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of temporary exit-navigation debug removal found no leftover debug hooks or correctness issues. Files Reviewed (4 files)
Previous Review Summaries (7 snapshots, latest commit ff1ab93)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit ff1ab93)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of temporary router-method wrappers in ExitDebugMount found no correctness issues. Files Reviewed (1 file)
Previous review (commit d1c880e)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of navigation-container state listeners and pending deep-link debug logging found no correctness issues. Files Reviewed (2 files)
Previous review (commit 5fe299b)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of fuller navigation-state debug dumps in layout and session detail found no correctness issues. Files Reviewed (2 files)
Previous review (commit 2201b78)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of (app) stack debug logging in layout and session detail found no correctness issues. Files Reviewed (2 files)
Previous review (commit 52aa327)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of temporary exit-navigation debug logging found no correctness issues. Files Reviewed (2 files)
Previous review (commit 702b54e)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of comment and test-label updates around Files Reviewed (2 files)
Previous review (commit 8d1708e)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by grok-4.6 · Input: 46.4K · Output: 4.6K · Cached: 233.5K Review guidance: REVIEW.md from base branch |
dismissTo with the nested tabs route left the exited agent-chat route on the (app) stack, so a back gesture returned to the exited session. Use dismissAll to pop the stack to (tabs), then navigate to the Agents tab.
Summary
After you exit a remote session with feedback, the app returns you to the Agents list. A back gesture no longer reopens the exited session.
The exit helper navigates with
dismissToinstead ofreplace, so the exitedagent-chatroute is popped from the stack and a back gesture cannot return to it. The helper'srouterparameter now uses a new localExitRemoteSessionRoutertype that requiresdismissTo, and it no longer accepts the sharedAgentSessionRouterLikeshape, which still serves the other navigation helpers. The feedback flow (toast, retry, non-retryable classification) is unchanged.Files
apps/mobile/src/components/agents/exit-remote-session-with-feedback.ts— swapsrouter.replace(SESSIONS_ROUTE)forrouter.dismissTo(SESSIONS_ROUTE); drops theAgentSessionRouterLikeimport and adds a localExitRemoteSessionRoutertype withdismissTo: (href: Href) => void.Test: 1 test file updated (
apps/mobile/src/components/agents/exit-remote-session-with-feedback.test.ts).Generated: none.
Verification
Three rounds (6, 7, 8) on iOS ran the two cases.
Session exitedtoast.Round 6 reproduced a stale session page after the back gesture, because the old harness flow tapped a session row. The corrected flow fixed it; round 8 does not reproduce it.
Recording: none.
Human steps: none needed.
Visual Changes
Agents list after session exit. The user exits a remote session with feedback and the app shows the Agents list with a
Session exitedtoast. In the picture, the toast sits above theSearch sessions...field, and the AGENTS tab is selected at the bottom.Agents list after the back gesture. After a left-edge back gesture, the app stays on the Agents list and the exited session page does not return. In the picture, the large
Agentsheader and the session list are visible, and no chat screen appears.Reviewer Notes
None.