Skip to content

fix(ios): back from settings details returns to the originating screen#98898

Merged
steipete merged 4 commits into
openclaw:mainfrom
Lokimorty:fix/ios-detail-back-returns-to-origin
Jul 2, 2026
Merged

fix(ios): back from settings details returns to the originating screen#98898
steipete merged 4 commits into
openclaw:mainfrom
Lokimorty:fix/ios-detail-back-returns-to-origin

Conversation

@Lokimorty

@Lokimorty Lokimorty commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users opening a settings detail view from another screen would be returned to the wrong place when pressing Back. For example, tapping the connection status pill on the Chat tab opens the Gateway detail, but Back landed on the Settings tab root instead of returning to Chat. The same canonical-back behavior affected every gateway entrance (Talk, Agent, all Control hub screens, Docs), the voice-settings entrances on the Talk tab, and the Approvals screen's "Open Notifications" shortcut (which reset Back to the Settings root on both iPhone and iPad).

Why This Change Was Made

On the iPhone, settings detail entrances previously navigated by switching the whole app to the Settings tab with the route pre-pushed, so the back stack always unwound inside Settings. Each phone tab (Chat, Talk, Agent) now owns a NavigationStack (PhoneTabSettingsHost) that pushes SettingsRoute details locally, and the Control hub pushes the gateway detail onto its own stack (openGatewayDetail), so Back pops to the exact screen the user came from — including nested cases like Control > Usage > Gateway. Cross-route settings shortcuts now append to the path instead of replacing it. Deliberately unchanged: global flows (deep links, onboarding auto-open, the gateway problem banner, the exec-approval notification dialog) still jump to the canonical Settings tab, and the iPad sidebar keeps its selection model (no Back button is involved there).

User Impact

Pressing Back from the Gateway, Voice, or Notifications settings details now returns users to the screen they navigated from — Chat stays Chat, Talk stays Talk, and Control hub screens keep their place — instead of dumping them on the Settings tab. Tab-bar behavior, iPad layout, and deep-link/onboarding flows are unchanged.

Evidence

  • Full app build green including the SwiftFormat (lint) and SwiftLint build phases: IOS_DEST="generic/platform=iOS Simulator" pnpm ios:build** BUILD SUCCEEDED **.
  • Audited every navigation entrance in apps/ios/Sources (all openSettings/openChat/openSessions/gatewayAction/navigateToRoute closures, NavigationLink/navigationDestination registrations, and path mutations); the four multi-entrance detail views (gateway, voice, notifications, sessions) are the complete set — sessions already pushed locally and is untouched.
  • Updated RootTabsSourceGuardTests pin the new wiring: gateway is never opened as a root-tab handoff from the hub, cross-route shortcuts append rather than replace, and phone tab order is preserved; all string assertions were mechanically re-checked against the final sources.
  • Multi-agent review of the diff (8 finder angles + adversarial verification) surfaced no confirmed defects; verifiers refuted each candidate with documented SwiftUI semantics or pre-existing identical usage (e.g. view-destination NavigationLinks inside pushed SettingsProTab(directRoute:) work unchanged, as they already did on the iPad sidebar stack).
  • Made sure i18n is synced.
  • Please ask Mantis to walk through each of the flows for visual validation.

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 2, 2026, 3:06 AM ET / 07:06 UTC.

Summary
The branch changes iOS phone settings-detail navigation so Gateway, Voice, and Notifications routes push on the originating stack, updates source guards and i18n inventory, and adds a UI test for Chat and Talk Back behavior.

PR surface: Other +88. Total +88 across 7 files.

Reproducibility: yes. by source inspection, not by a simulator run: current main routes the affected phone and hub shortcuts through Settings-tab selection or path replacement. The PR adds a UI test, but its back-button selector needs repair before it can serve as reliable proof.

Review metrics: 1 noteworthy metric.

  • Settings-entry routing changed: 3 phone tab wrappers, 1 Control hub route, 1 notifications shortcut changed. The diff changes several visible navigation entrances, so maintainers should require proof that all affected Back paths still behave correctly.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • [P1] Fix the new UI test to tap a real native back button instead of BackButton.
  • Attach redacted simulator or device proof for Gateway, Voice, and Notifications returning to their originating screens.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Only build/source-audit/CI/test claims and a Mantis request are present; add redacted iPhone simulator/device screenshots, recording, live output, linked artifact, or logs showing after-fix Back behavior, then update the PR body or ask for @clawsweeper re-review.

Mantis proof suggestion
A short iPhone visual proof would directly demonstrate the changed Back behavior across the affected settings entrances, and the author has already requested that walkthrough. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify on iPhone that Back from Gateway, Voice, and Notifications returns to the originating Chat, Talk, Control, or Approvals screen.

Risk before merge

  • [P1] The PR still lacks redacted real iOS behavior proof; the body and comments show build/source-audit/CI/test claims and a Mantis request, not an observed after-fix simulator or device flow.
  • [P1] The added UI test taps a BackButton identifier that is not defined in the app sources, so a real UI-test run can fail before proving the Back behavior.

Maintainer options:

  1. Prove the iOS Back flows before merge (recommended)
    Fix the UI-test back-button query and attach redacted simulator or device proof showing Gateway, Voice, and Notifications return to their originating screens.
  2. Accept build and source evidence only
    Maintainers could intentionally merge with only source, CI, and unit-style evidence, but that would leave the visible navigation behavior unproven.

Next step before merge

  • [P1] Contributor or maintainer follow-up is needed because the remaining blockers are real simulator/device proof and a UI-test selector repair; ClawSweeper should not substitute for the missing external proof gate.

Security
Cleared: The diff is limited to iOS SwiftUI navigation, iOS tests, and native i18n line-reference updates; no dependency, workflow, secret, package, or supply-chain surface was changed.

Review findings

  • [P2] Use a real native back-button query — apps/ios/UITests/OpenClawSnapshotUITests.swift:73
Review details

Best possible solution:

Keep the local-stack navigation fix, repair the UI-test back-button selector, then add redacted iPhone simulator or device proof for Gateway, Voice, and Notifications Back flows.

Do we have a high-confidence way to reproduce the issue?

Yes by source inspection, not by a simulator run: current main routes the affected phone and hub shortcuts through Settings-tab selection or path replacement. The PR adds a UI test, but its back-button selector needs repair before it can serve as reliable proof.

Is this the best way to solve the issue?

No as a mergeable PR yet: the local NavigationStack direction is the right owner-boundary fix, but the test selector and missing real iOS proof must be resolved before merge.

Full review comments:

  • [P2] Use a real native back-button query — apps/ios/UITests/OpenClawSnapshotUITests.swift:73
    The new UI test taps navigationBars["Gateway"].buttons["BackButton"], but the app never sets a BackButton accessibility identifier and existing UI tests query native back buttons by visible labels. A simulator UI run can fail before proving the navigation fix; query the actual visible back button for both Gateway and Voice.
    Confidence: 0.82

Overall correctness: patch is incorrect
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add merge-risk: 🚨 other: Merging without real iOS visual proof and with a questionable UI-test selector could leave the user-visible Back behavior unverified across affected settings entrances.

Label justifications:

  • P2: This is a normal-priority visible iOS navigation bug fix with limited blast radius, but it still needs a test repair and real behavior proof before merge.
  • merge-risk: 🚨 other: Merging without real iOS visual proof and with a questionable UI-test selector could leave the user-visible Back behavior unverified across affected settings entrances.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Only build/source-audit/CI/test claims and a Mantis request are present; add redacted iPhone simulator/device screenshots, recording, live output, linked artifact, or logs showing after-fix Back behavior, then update the PR body or ask for @clawsweeper re-review.
Evidence reviewed

PR surface:

Other +88. Total +88 across 7 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 7 161 73 +88
Total 7 161 73 +88

What I checked:

Likely related people:

  • steipete: Authored the merged iOS navigation/settings modernization that current main builds on, and recent history touches RootTabsPhoneControlHub, SettingsProTab, source guards, and the added UI-test proof path. (role: recent iOS navigation contributor; confidence: high; commits: 313560d5b98e, d350799b6170, 4c2f141c9403; files: apps/ios/Sources/RootTabs.swift, apps/ios/Sources/Design/RootTabsPhoneControlHub.swift, apps/ios/Sources/Design/SettingsProTab.swift)
  • zhangLei99586: Current-main blame attributes sampled RootTabs phone settings handoff lines and SettingsProTab notification path replacement to this broad baseline commit, though the commit subject is not iOS-specific so routing confidence is low. (role: baseline code contributor; confidence: low; commits: 273729bd95ef; files: apps/ios/Sources/RootTabs.swift, apps/ios/Sources/Design/SettingsProTab.swift)
  • mbelinky: CONTRIBUTING.md lists this handle for the iOS app area, making them a likely reviewer for the visible iOS navigation behavior. (role: listed iOS app area maintainer; confidence: medium; files: CONTRIBUTING.md, apps/ios/Sources/RootTabs.swift, apps/ios/Sources/Design/SettingsProTab.swift)
  • ngutman: CONTRIBUTING.md lists this handle for the iOS app and macOS app area, making them a likely reviewer for companion-app UX decisions. (role: listed iOS app area maintainer; confidence: medium; files: CONTRIBUTING.md, apps/ios/Sources/Design/RootTabsPhoneControlHub.swift, apps/ios/UITests/OpenClawSnapshotUITests.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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. and removed status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jul 2, 2026
@Lokimorty
Lokimorty force-pushed the fix/ios-detail-back-returns-to-origin branch from 85a9451 to 61a93c6 Compare July 2, 2026 04:29
@Lokimorty

Copy link
Copy Markdown
Contributor Author

@openclaw-mantis visual task: verify on iPhone that Back from Gateway, Voice, and Notifications returns to the originating Chat, Talk, Control, or Approvals screen.

@steipete
steipete force-pushed the fix/ios-detail-back-returns-to-origin branch from f4faafe to d350799 Compare July 2, 2026 06:53
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Jul 2, 2026
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

OpenClaw QA Artifacts

Summary

PR #98898 iOS before/after proof

Gateway from Chat

  • Before: opening Gateway from Chat switches selection to Settings.
  • After: Gateway stays inside Chat's navigation stack; Chat remains selected.

Back from Gateway

  • Before: Back lands at the Settings root.
  • After: Back returns to Chat. The same test also proves Voice & Talk returns to Talk.

Files

  • 01-before-gateway-settings-tab.png
  • 02-after-gateway-chat-tab.png
  • 03-before-back-settings-root.png
  • 04-after-back-chat.png

Evidence

@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Land-ready maintainer verification

Exact head: 32c6f1447415b1fb28d8b1bbe966e9dd11e0943e

Maintainer repair completed before landing:

  • kept Gateway and Voice details on the originating Chat, Talk, Agent, or Control navigation stack;
  • corrected the stale Voice source guard;
  • added a stable accessibility identifier and real phone UI regression covering Chat → Gateway → Back and Talk → Voice → Back;
  • synced native-i18n inventory.

Before / after

Before After
Gateway incorrectly selects Settings Gateway preserves Chat selection
Back incorrectly lands at Settings root Back returns to Chat

Artifact manifest

Verification

  • xcodebuild -project apps/ios/OpenClaw.xcodeproj -scheme OpenClawUITests -destination 'platform=iOS Simulator,id=287E61C4-E15A-4794-A8DF-3E6AC37AAF97' -derivedDataPath /tmp/openclaw-98898-resync-derived -resultBundlePath /tmp/openclaw-98898-resync-ui.xcresult CODE_SIGNING_ALLOWED=NO test -only-testing:OpenClawUITests/OpenClawSnapshotUITests/testSettingsBackReturnsToOriginatingPhoneTab
  • swiftformat --lint --config config/swiftformat apps/ios/Sources/Design/ChatProTab.swift apps/ios/Tests/RootTabsSourceGuardTests.swift apps/ios/UITests/OpenClawSnapshotUITests.swift
  • Broad RootTabsSourceGuardTests: 31 pass; two unrelated failures reproduced identically on current main.
  • Fresh autoreview: current-main gateway control retained, exact six-file tree has no accepted/actionable findings.
  • Exact-head hosted gates: CI 28578067909 and Workflow Sanity 28578067778: terminal green. No Testbox workflows were scheduled for the direct signed-head update; the native gate verifier accepted the authoritative exact-head workflows present. The final conflict-free rebase changed only ancestry onto current main, leaving the reviewed six-file iOS diff unchanged.

Known proof gaps: none.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts agents Agent runtime and tooling size: L channel: mattermost Channel integration: mattermost size: XL app: android App: android and removed size: M size: L labels Jul 2, 2026
Lokimorty and others added 4 commits July 2, 2026 09:58
Detail views reachable from multiple places (gateway, voice, notifications
settings) previously opened by switching to the canonical Settings tab, so
Back landed on the Settings root instead of the screen the user came from.
Phone tabs now push SettingsRoute details on their own NavigationStack via
PhoneTabSettingsHost, the Control hub pushes the gateway detail onto its own
stack, and the Approvals->Notifications shortcut appends instead of replacing
the path (phone and iPad). Global flows (deep links, onboarding, problem
banner, notification dialog) still jump to the canonical Settings tab.
@steipete
steipete force-pushed the fix/ios-detail-back-returns-to-origin branch from 3f10827 to 32c6f14 Compare July 2, 2026 08:58
@openclaw-barnacle openclaw-barnacle Bot removed the channel: mattermost Channel integration: mattermost label Jul 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed app: android App: android scripts Repository scripts agents Agent runtime and tooling size: XL labels Jul 2, 2026
@steipete
steipete merged commit 9d3e263 into openclaw:main Jul 2, 2026
83 of 88 checks passed
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

LeonidasLux pushed a commit to LeonidasLux/openclaw that referenced this pull request Jul 3, 2026
openclaw#98898)

* fix(ios): back from settings details returns to the originating screen

Detail views reachable from multiple places (gateway, voice, notifications
settings) previously opened by switching to the canonical Settings tab, so
Back landed on the Settings root instead of the screen the user came from.
Phone tabs now push SettingsRoute details on their own NavigationStack via
PhoneTabSettingsHost, the Control hub pushes the gateway detail onto its own
stack, and the Approvals->Notifications shortcut appends instead of replacing
the path (phone and iPad). Global flows (deep links, onboarding, problem
banner, notification dialog) still jump to the canonical Settings tab.

* chore(i18n): sync native app i18n inventory line references

* test(ios): prove settings back navigation

* test(ios): prove settings back navigation

---------

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 3, 2026
openclaw#98898)

* fix(ios): back from settings details returns to the originating screen

Detail views reachable from multiple places (gateway, voice, notifications
settings) previously opened by switching to the canonical Settings tab, so
Back landed on the Settings root instead of the screen the user came from.
Phone tabs now push SettingsRoute details on their own NavigationStack via
PhoneTabSettingsHost, the Control hub pushes the gateway detail onto its own
stack, and the Approvals->Notifications shortcut appends instead of replacing
the path (phone and iPad). Global flows (deep links, onboarding, problem
banner, notification dialog) still jump to the canonical Settings tab.

* chore(i18n): sync native app i18n inventory line references

* test(ios): prove settings back navigation

* test(ios): prove settings back navigation

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants