fix(ios): chat can return to originating control screen#98023
fix(ios): chat can return to originating control screen#98023Solvely-Colin wants to merge 5 commits into
Conversation
|
Codex review: needs changes before merge. Reviewed July 2, 2026, 5:17 PM ET / 21:17 UTC. Summary PR surface: Other +139. Total +139 across 6 files. Reproducibility: yes. from source inspection, though I did not run a local simulator in this read-only review. Current main routes Control-detail Chat buttons through openPhoneRootDestination(.chat), clears the phone Control path, and gives Chat no contextual leading action. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the phone-only navigation fix, add the generated native i18n inventory for the new back-label string, then let the assigned maintainer decide and land it. Do we have a high-confidence way to reproduce the issue? Yes from source inspection, though I did not run a local simulator in this read-only review. Current main routes Control-detail Chat buttons through openPhoneRootDestination(.chat), clears the phone Control path, and gives Chat no contextual leading action. Is this the best way to solve the issue? Yes, with one mechanical cleanup outstanding. RootTabs owns phone tab selection and Chat header wiring while RootTabsPhoneControlHub owns the phone detail stack, so the request-ID handoff is the right boundary once the native i18n inventory is synced. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 155c2f4e7eb0. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Other +139. Total +139 across 6 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
Pull request overview
Fixes iOS (iPhone) navigation so when Chat is opened from a specific Control detail screen (e.g., Sessions, Overview), Chat shows a contextual leading “back” affordance that returns the user to the originating Control detail instead of feeling like a dead end; iPad/sidebar routing remains unchanged.
Changes:
- Add phone-only “return to Control detail” state in
RootTabs, wire it intoChatProTabviaheaderLeadingAction, and clear it on normal tab navigation away from Chat. - Extend
RootTabsPhoneControlHubto accept and apply a requested Control destination (with a request id) and route “open chat” events through a callback that preserves return context. - Add/adjust iOS tests to cover the new return-label helper and new initializer requirements.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/ios/Tests/SwiftUIRenderSmokeTests.swift | Updates smoke test construction of RootTabsPhoneControlHub with new parameters. |
| apps/ios/Tests/RootTabsPresentationTests.swift | Adds a unit test for the new “Back to …” label helper. |
| apps/ios/Sources/RootTabsNavigation.swift | Introduces chatReturnTitle(for:) helper used by the Chat back affordance. |
| apps/ios/Sources/RootTabs.swift | Implements phone-only return-to-Control behavior and requested destination routing into the phone Control hub; wires Chat header leading action. |
| apps/ios/Sources/Design/RootTabsPhoneControlHub.swift | Adds requested-destination application logic and routes Control-detail “open chat” through the new callback. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…t-return # Conflicts: # apps/ios/Sources/Design/RootTabsPhoneControlHub.swift # apps/ios/Sources/RootTabs.swift # apps/ios/Tests/RootTabsPresentationTests.swift
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Landed the repaired implementation in #99245 as The maintainer rewrite keeps this PR's intended iPhone behavior and proof while moving cross-tab routing to typed requests, correlating the production Thank you, @Solvely-Colin, for the report, implementation baseline, and before/after proof. I recreated the branch because this fork has Allow edits by maintainers disabled; enabling it on future PRs lets us apply repair commits directly without replacing the PR. |
What Problem This Solves
Fixes an issue where iPhone users who open Chat from a Control detail, including Sessions, can lose the visible path back to the Control screen they came from. This addresses the feedback that opening a "session" felt like a dead end while keeping the existing product model that a session is a chat.
Follow-up UX correction: tapping the bottom
Controltab from Chat should return to the main Control hub, while the Chat header back affordance should return one level to the originating Control detail.Why This Change Was Made
The phone Control hub now records the Control detail that launched Chat and passes Chat a contextual leading header action like "Back to Sessions" or "Back to Overview". Returning applies the pending Control destination even if the Control hub appears after the request, and the return state is cleared when the user leaves Chat through normal tab navigation.
The Control tab also has an explicit phone root-reset request. Detail-driven Chat returns suppress that reset for the one intentional return hop, so the header back affordance preserves detail context while normal Control tab navigation lands on the main Control hub.
This PR was AI-assisted. I reviewed the change, generated focused test coverage, ran the simulator proof below, and understand the behavior being changed.
User Impact
On iPhone, users can move from Sessions, Overview, Activity, or Workboard into Chat and then use the visible back affordance to return to the originating Control detail. If they tap the bottom Control tab instead, they land on the main Control hub. iPad/sidebar routing is unchanged.
Evidence
pnpm ios:gengit diff --checkxcodebuild -project apps/ios/OpenClaw.xcodeproj -scheme OpenClaw -destination 'platform=iOS Simulator,name=iPhone 17' -only-testing:OpenClawTests/RootTabsPresentationTests testpassed: 44 tests inRootTabsPresentationTestsc70747eaff3:xcodebuild -project apps/ios/OpenClaw.xcodeproj -scheme OpenClaw -destination 'platform=iOS Simulator,name=iPhone 17' -only-testing:OpenClawTests/RootTabsPresentationTests -only-testing:OpenClawTests/RootTabsSidebarRegressionTests testpassed: 49 tests acrossRootTabsPresentationTestsandRootTabsSidebarRegressionTests6bee857d31e: focused xcodebuild printedTest run with 60 tests in 3 suites passed after 3.862 secondsforRootTabsPresentationTests,RootTabsSidebarRegressionTests, andSwiftUIRenderSmokeTests; Xcode then hung finalizing the test log and was terminated.77bb2411c6and3111d436d4merge currentorigin/maininto the PR branch. The conflicts were inRootTabs.swift,RootTabsPhoneControlHub.swift, andRootTabsPresentationTests.swift; resolution keeps main's Chat-first phone shell/native navigation chrome and preserves the PR's contextual Chat return target.RootTabsPresentationTests,RootTabsSidebarRegressionTests, andSwiftUIRenderSmokeTests.RootTabsSourceGuardTestsfailures already present on currentorigin/mainin Settings source guards.git diff --check.agents/skills/autoreview/scripts/autoreview --mode localclean: no accepted/actionable findings reported after the Control-root follow-up.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainclean after conflict resolution: no accepted/actionable findings reportedbuild_run_simoniPhone 17succeeded with--openclaw-screenshot-mode --openclaw-initial-tab control --openclaw-initial-destination activity.Corrected Control-root proof:
e53|tap|button|Chat.e18|tap|button|Back to Activity||OpenClawChatBackToControlDetailButton.Control,Overview,Activity,Sessions, and other hub rows.Back to Activityrestored the Activity detail.Original Activity-return proof:
e53|tap|button|Chat.e18|tap|button|Back to Activity||OpenClawChatBackToControlDetailButton.Activity,Gateway Online,Recent activity, and the Control tab selected.mainchat, andCommandCenterTab.isRecentChatSessionfilters that out, so there is no non-default session row to tap in the local fixture recording. The same implementation path is covered byRootTabsPresentationTests:.sessionsmaps toBack to Sessions, andRootTabsPhoneControlHubpasses.sessionswhen opening Chat fromCommandSessionsScreen.