Skip to content

fix(ios): chat can return to originating control screen#98023

Closed
Solvely-Colin wants to merge 5 commits into
mainfrom
codex/ios-control-chat-return
Closed

fix(ios): chat can return to originating control screen#98023
Solvely-Colin wants to merge 5 commits into
mainfrom
codex/ios-control-chat-return

Conversation

@Solvely-Colin

@Solvely-Colin Solvely-Colin commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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 Control tab 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:gen
  • git diff --check
  • xcodebuild -project apps/ios/OpenClaw.xcodeproj -scheme OpenClaw -destination 'platform=iOS Simulator,name=iPhone 17' -only-testing:OpenClawTests/RootTabsPresentationTests test passed: 44 tests in RootTabsPresentationTests
  • Feedback follow-up commit c70747eaff3: xcodebuild -project apps/ios/OpenClaw.xcodeproj -scheme OpenClaw -destination 'platform=iOS Simulator,name=iPhone 17' -only-testing:OpenClawTests/RootTabsPresentationTests -only-testing:OpenClawTests/RootTabsSidebarRegressionTests test passed: 49 tests across RootTabsPresentationTests and RootTabsSidebarRegressionTests
  • Control-root follow-up commit 6bee857d31e: focused xcodebuild printed Test run with 60 tests in 3 suites passed after 3.862 seconds for RootTabsPresentationTests, RootTabsSidebarRegressionTests, and SwiftUIRenderSmokeTests; Xcode then hung finalizing the test log and was terminated.
  • Conflict-resolution commits 77bb2411c6 and 3111d436d4 merge current origin/main into the PR branch. The conflicts were in RootTabs.swift, RootTabsPhoneControlHub.swift, and RootTabsPresentationTests.swift; resolution keeps main's Chat-first phone shell/native navigation chrome and preserves the PR's contextual Chat return target.
  • XcodeBuildMCP focused conflict-resolution run passed: 67 tests across RootTabsPresentationTests, RootTabsSidebarRegressionTests, and SwiftUIRenderSmokeTests.
  • XcodeBuildMCP broader source-guard run built and ran 101 tests, with 99 passing and 2 unrelated RootTabsSourceGuardTests failures already present on current origin/main in Settings source guards.
  • git diff --check
  • .agents/skills/autoreview/scripts/autoreview --mode local clean: no accepted/actionable findings reported after the Control-root follow-up
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main clean after conflict resolution: no accepted/actionable findings reported
  • XcodeBuildMCP build_run_sim on iPhone 17 succeeded with --openclaw-screenshot-mode --openclaw-initial-tab control --openclaw-initial-destination activity.
  • Hosted proof bundle: https://github.com/Solvely-Colin/pr-proof-assets/tree/main/openclaw/pr-98023

Corrected Control-root proof:

Control tab returns to the main Control hub; Chat header back returns to Activity

Original Activity-return proof:

Activity Control detail opens Chat, then the contextual return affordance returns to Activity

Copilot AI review requested due to automatic review settings June 30, 2026 04:28
@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios size: S maintainer Maintainer-authored PR labels Jun 30, 2026
@clawsweeper

clawsweeper Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 2, 2026, 5:17 PM ET / 21:17 UTC.

Summary
The branch adds phone-only iOS navigation state so Chat opened from a Control detail can show a contextual header back action and updates focused RootTabs tests.

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.

  • Native i18n sync: 1 new Swift label, 0 inventory files updated. The diff adds a user-facing back label but does not include the generated native inventory update required by the native-i18n gate.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Run the native i18n sync path and include the generated apps/.i18n/native-source.json update for the new back label.
  • Rerun pnpm native:i18n:check or the native-i18n CI job after the inventory update.

Mantis proof suggestion
A short visual iPhone simulator proof would help maintainers confirm the latest Control-tab root reset plus Chat header-back behavior after the i18n repair. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify on iPhone that Activity opens Chat with a Back to Activity affordance, bottom Control returns to the Control hub, and header back returns to Activity.

Risk before merge

  • [P1] The live native-i18n check is failing because the generated native string inventory was not updated for the new back-label source string.
  • [P1] The protected maintainer label means cleanup automation should not close or merge this PR without explicit maintainer handling.

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] There is a narrow mechanical repair target: sync the native i18n inventory for the new Swift back-label source string; final merge still stays with maintainers because of the protected label.

Security
Cleared: The diff is limited to iOS Swift navigation state and focused tests, with no workflows, dependencies, secrets, package metadata, or code-execution surfaces changed.

Review findings

  • [P2] Sync the native i18n inventory for the new back label — apps/ios/Sources/RootTabsNavigation.swift:247-248
Review details

Best 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:

  • [P2] Sync the native i18n inventory for the new back label — apps/ios/Sources/RootTabsNavigation.swift:247-248
    The branch adds a user-facing Swift label through chatReturnTitle(for:), but the PR files do not update apps/.i18n/native-source.json. The live native-i18n job now fails with inventory drift, so this needs the generated inventory update before merge.
    Confidence: 0.92

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 155c2f4e7eb0.

Label changes

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (recording): Sufficient: hosted simulator recording/contact-sheet proof shows the Activity detail, Chat, bottom Control returning to the hub, and header back returning to Activity after the fix.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This is a normal-priority iPhone navigation bug fix with a narrow iOS blast radius and one mechanical merge blocker.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (recording): Sufficient: hosted simulator recording/contact-sheet proof shows the Activity detail, Chat, bottom Control returning to the hub, and header back returning to Activity after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: hosted simulator recording/contact-sheet proof shows the Activity detail, Chat, bottom Control returning to the hub, and header back returning to Activity after the fix.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. Sufficient: hosted simulator recording/contact-sheet proof shows the Activity detail, Chat, bottom Control returning to the hub, and header back returning to Activity after the fix.
Evidence reviewed

PR surface:

Other +139. Total +139 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 6 152 13 +139
Total 6 152 13 +139

Acceptance criteria:

  • [P1] pnpm native:i18n:check.
  • [P1] pnpm apple:i18n:check if the native inventory update changes Apple catalog coverage.
  • [P1] xcodebuild -project apps/ios/OpenClaw.xcodeproj -scheme OpenClaw -destination 'platform=iOS Simulator,name=iPhone 17' -only-testing:OpenClawTests/RootTabsPresentationTests -only-testing:OpenClawTests/RootTabsSidebarRegressionTests test.

What I checked:

  • repository policy read: Root AGENTS.md was read fully; its PR review depth, proof, protected-label, and generated inventory guidance affected this review. (AGENTS.md:19, 155c2f4e7eb0)
  • scoped iOS policy read: The scoped iOS AGENTS.md was read fully; it only adds App Store release guardrails and did not change the navigation-code verdict. (apps/ios/AGENTS.md:1, 155c2f4e7eb0)
  • live PR state: Live GitHub state shows head 3111d43, MERGEABLE, assigned to steipete, and carrying the protected maintainer label plus proof labels. (3111d436d409)
  • current main lacks contextual Chat return: Current main constructs the phone Chat tab without headerLeadingAction, so Chat has no contextual Control-detail return affordance. (apps/ios/Sources/RootTabs.swift:163, 155c2f4e7eb0)
  • current main clears the Control detail path: Current main routes Overview, Activity, Workboard, and Sessions Chat buttons through openPhoneRootDestination(.chat), which removes the phone Control navigation path before switching tabs. (apps/ios/Sources/Design/RootTabsPhoneControlHub.swift:127, 155c2f4e7eb0)
  • PR head wires the Chat return action: PR head passes phoneChatReturnAction into the phone Chat tab and passes requested Control destination/root request IDs into RootTabsPhoneControlHub. (apps/ios/Sources/RootTabs.swift:168, 3111d436d409)

Likely related people:

  • Solvely-Colin: GitHub commit metadata ties this handle to prior merged work on RootTabs, RootTabsPhoneControlHub, and RootTabsSidebarRegressionTests, including sidebar navigation reset and iPad/iPhone control-surface changes this PR extends. (role: recent area contributor; confidence: high; commits: 54b09580f61b, bf89552e6783; files: apps/ios/Sources/RootTabs.swift, apps/ios/Sources/Design/RootTabsPhoneControlHub.swift, apps/ios/Tests/RootTabsSidebarRegressionTests.swift)
  • steipete: Recent merged iOS navigation and settings modernization touched RootTabsPhoneControlHub and RootTabsPresentationTests, and this live PR is assigned to steipete. (role: recent adjacent owner; confidence: medium; commits: 313560d5b98e; files: apps/ios/Sources/Design/RootTabsPhoneControlHub.swift, apps/ios/Tests/RootTabsPresentationTests.swift)
  • Lokimorty: A recent merged settings-detail back-navigation fix changed the same RootTabs and phone Control hub navigation boundary that this PR follows. (role: recent adjacent contributor; confidence: medium; commits: 9d3e2633658c; files: apps/ios/Sources/RootTabs.swift, apps/ios/Sources/Design/RootTabsPhoneControlHub.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 into ChatProTab via headerLeadingAction, and clear it on normal tab navigation away from Chat.
  • Extend RootTabsPhoneControlHub to 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.

Comment thread apps/ios/Tests/RootTabsPresentationTests.swift
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 30, 2026
@clawsweeper clawsweeper Bot added the P2 Normal backlog priority with limited blast radius. label Jun 30, 2026
@Solvely-Colin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 30, 2026
@steipete steipete self-assigned this Jul 2, 2026
…t-return

# Conflicts:
#	apps/ios/Sources/Design/RootTabsPhoneControlHub.swift
#	apps/ios/Sources/RootTabs.swift
#	apps/ios/Tests/RootTabsPresentationTests.swift
@Solvely-Colin

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 2, 2026
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Landed the repaired implementation in #99245 as 32762dad539d056aaabf906ed73cf230b2c63a94.

The maintainer rewrite keeps this PR's intended iPhone behavior and proof while moving cross-tab routing to typed requests, correlating the production NodeAppModel.openChat event, clearing retained Chat Settings state, dismissing the Workboard card sheet, and covering the real Overview session-row path. Exact-head simulator E2E, 35/35 focused guards, hosted CI, and fresh Codex autoreview all passed. Colin's contribution is preserved with Co-authored-by credit.

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.

@steipete steipete closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants