Skip to content

Fix disabled iOS controls after forgetting a computer - #10010

Merged
azooz2003-bit merged 10 commits into
mainfrom
task-ios-delete-computer-buttons
Aug 12, 2026
Merged

azooz2003-bit merged 10 commits into
mainfrom
task-ios-delete-computer-buttons

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Aug 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary:

  • Keep the shell that owns an iOS child sheet mounted until its real dismissal callback.
  • Retain that ownership while the child is visible and while dismissal is in progress.
  • Cover workspace and disconnected child hosts, including the final-computer transition.

Why:

Forgetting the final saved computer refreshes the store to the disconnected shell while the Computers sheet is still presented. That unmounts the sheet presenter before onDismiss can release the shared modal slot, so Settings and Add Computer requests are rejected forever.

Verification:

The two fix runs are shown as failed because the workflow zero-test guard only recognizes XCTest summaries. The selected Swift Testing suites executed and passed in the job logs.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Prevents disabled iOS toolbar controls after forgetting the final computer by moving the Computers screen to a root-owned modal and keeping its presenter mounted through dismissal. Previously a workspace-owned presenter unmounted during the final-forget transition and orphaned the modal; now Done/Add/Forget route through the root so Settings and Add Computer remain responsive.

  • Root-owned Computers modal: adds .computers to MobileRootPresentationState with presentComputers/dismissComputers; CMUXMobileRootView presents/dismisses, selects workspaces, and dismisses after a final forget. WorkspaceShellView/WorkspaceShellHost/WorkspaceListView replace local deviceTreePresentation with showComputers (previews fall back to the local sheet).
  • DeviceTreeView adds dismissAction and didForgetComputer; Done/Add/Forget dismiss via the root owner. Tests cover Computers ownership, transition to pairing, and regressions for Settings/Add Computer after deleting the last computer. DEBUG-only SuccessfulComputerForgetUITestStub enables UI tests without external revoke; mock runs suppress push authorization prompts.

Written for commit 79f4020. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Improved iOS shell transitions when child views are dismissed, preserving the correct workspace or disconnected shell.
    • Prevented shell content from disappearing during reconnection, pairing transitions, and migration retries.
    • Preserved restoring-state information when no child view is active.
    • Improved the experience when removing the final saved computer after disconnection, keeping Add Computer and Settings usable.
  • Tests

    • Added coverage for child presentation transitions and final-computer removal scenarios.

@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9e39fe0a-a915-4e48-84ed-a533fe5b5fd1

📥 Commits

Reviewing files that changed from the base of the PR and between 110480e and ec46371.

📒 Files selected for processing (1)
  • ios/cmuxUITests/cmuxUITests.swift

📝 Walkthrough

Walkthrough

Authenticated iOS shell routing retains the shell required by active or dismissing child presentations. The change adds child-host derivation, shell-surface retention, root-view integration, and tests for reconnection, restoration, pairing, and final computer removal.

Changes

Child Host Shell Retention

Layer / File(s) Summary
Required child host state
Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/MobileRootPresentationState.swift, Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/MobileRootPresentationStateTests.swift
ChildHost identifies disconnected and workspace hosts. requiredChildHost retains the host while a child presentation is active or dismissing, then clears it after dismissal.
Authenticated shell retention and routing
Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/MobileAuthenticatedShellPresentation.swift, Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/CMUXMobileRootView.swift, Packages/iOS/CmuxMobileShellUI/Tests/CmuxMobileShellUITests/MobileAuthenticatedShellPresentationTests.swift
authenticatedShellSurface uses retainingChildHost to preserve disconnected and workspace surfaces. Existing workspace restoration state remains available, and a non-restoring workspace surface is created when required.
Final computer removal regression flow
Packages/iOS/CmuxMobileSupport/Sources/CmuxMobileSupport/UITestConfig.swift, ios/cmuxPackage/Sources/cmuxFeature/Debug/SuccessfulComputerForgetUITestStub.swift, ios/cmuxPackage/Sources/cmuxFeature/CMUXMobileRootScene.swift, ios/cmuxUITests/cmuxUITests.swift
Debug UI tests can enable a successful forget stub. The end-to-end test removes the final saved computer while disconnected, then verifies Add Computer and Settings remain usable. The pairing helper accepts environment overrides and waits for the host field to disappear.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant cmuxUITests
  participant UITestConfig
  participant CMUXMobileRootScene
  participant CMUXMobileShellStore
  participant CMUXMobileRootView
  cmuxUITests->>UITestConfig: enable successful computer forget
  UITestConfig-->>CMUXMobileRootScene: resolve successful forget stub
  CMUXMobileRootScene->>CMUXMobileShellStore: inject forget implementation
  cmuxUITests->>CMUXMobileShellStore: forget final saved computer
  CMUXMobileShellStore-->>CMUXMobileRootView: show disconnected shell
  CMUXMobileRootView->>CMUXMobileRootView: retain required child host
Loading

Possibly related PRs

  • manaflow-ai/cmux#9891: Updates shared MobileRootPresentationState and authenticated shell-presentation behavior.

Suggested reviewers: lawrencecchen

🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed The diff adds pure value-policy logic and UI-root routing; its async stub is explicitly @MainActor against the pre-existing @MainActor protocol, with no new mutable Sendable type or background stor...
Cmux Swift Blocking Runtime ✅ Passed Production additions only route shell state and inject a DEBUG stub; scans found no semaphores, sleeps, delayed dispatch, sync, polling, or locks. XCTest waits are test-only.
Cmux Browser Automation Off-Main ✅ Passed The pull request changes iOS shell presentation and UI-test support, not browser socket automation or WebKit wait routing covered by this check.
Cmux Expensive Synchronous Load ✅ Passed The production diff adds shell-routing state, environment gating, and a DEBUG no-op stub; it adds no agent-history loader, disk scan, JSON/JSONL parse, or synchronous load on an interactive path.
Cmux Cache Substitution Correctness ✅ Passed The diff changes transient iOS shell and modal presentation state plus DEBUG test wiring; it does not replace an authoritative persistence, history, undo, or snapshot read with a cache.
Cmux No Hacky Sleeps ✅ Passed The pull-request diff contains only Swift files; no TypeScript, JavaScript, shell, or non-Swift runtime delay was introduced.
Cmux Algorithmic Complexity ✅ Passed The production diff adds only constant-time enum switches and conditional dependency selection; no scalable collection scans or slower hot-path algorithm was introduced. Test changes are excluded b...
Cmux Swift Concurrency ✅ Passed The Swift diff adds no DispatchQueue, Combine, completion-handler, or fire-and-forget Task patterns; additions are an async-throws stub and an async XCTest.
Cmux Swift @Concurrent ✅ Passed Changed async code is a @MainActor no-op stub and a UI test; no new nonisolated async or invalid @concurrent use. The existing mock server start dispatches listener work to its queue.
Cmux Swift Package Boundaries ✅ Passed New shell-retention logic is in the CmuxMobileShellUI package with package tests; cmuxFeature adds only composition-root DEBUG test-stub wiring, and AppKit edits are allowed glue.
Cmux Swiftpm Lockfiles ✅ Passed The PR diff changes only Swift source and test files; it changes no Package.swift, Package.resolved, .gitignore, Xcode project, or workflow files, so the lockfile policy is not triggered.
Cmux Swift Logging ✅ Passed The full diff adds no print, debugPrint, dump, NSLog, file/stdout logging, or secret-bearing logs; the existing Logger declaration is unchanged, and test/debug additions are allowed.
Cmux User-Facing Error Privacy ✅ Passed No verdict yet.
Cmux Full Internationalization ✅ Passed The diff adds shell-routing logic, test-only/config code, and comments, but no production user-facing text or localization catalog/message changes.
Cmux Swiftui State Layout ✅ Passed The diff adds shell-routing computation, value enums, and test-only configuration. It adds no ObservableObject/state wrapper, GeometryReader, lazy-row store reference, or render-time mutation.
Cmux Architecture Rethink ✅ Passed Production diff adds no timing repair, lock, observer, side channel, or duplicate wiring. RootPresentationState owns host retention, and onDismiss clears it; waits and the forget stub are test-only.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR diff adds iOS shell presentation/state logic, test fixtures, and UI tests; it introduces no NSWindow, NSPanel, WindowGroup, close shortcut, or auxiliary-window identifier changes.
Cmux Source Artifacts ✅ Passed The exact PR diff contains nine intentional Swift source, configuration, and test files; no scratch/artifact paths, binary files, or generated-output markers were added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed The diff adds product shell-routing state and a mock-gated dependency override; it adds no internal-state accessor or matching test-hook member, and the DEBUG stub is isolated under Sources/.../Deb...
Cmux No Ambient Global State ✅ Passed The diff adds no file-scope functions, mutable globals, or singletons. The DEBUG-only config is a computed property on an existing type, and the stub is constructable and injected at CMUXMobileRoot...
Title check ✅ Passed The title clearly summarizes the primary fix for disabled iOS controls after forgetting a computer.
Description check ✅ Passed The description explains the change, motivation, affected behavior, and test verification with relevant links.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-ios-delete-computer-buttons

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ios/cmuxPackage/Sources/cmuxFeature/CMUXMobileRootScene.swift`:
- Around line 23-35: Move SuccessfulComputerForgetUITestStub out of
CMUXMobileRootScene.swift into a dedicated debug-only source file or folder,
preserving its MobileIrohMacForgetting conformance and behavior. Remove the
test-only `#if` DEBUG seam from the production root-scene file so
CMUXMobileRootScene.swift contains only runtime composition.

In `@ios/cmuxUITests/cmuxUITests.swift`:
- Around line 2474-2478: Update the status wait in the test around
MobileTerminalMacConnectionStatus to verify a post-disconnect state rather than
only element existence. Wait for the element, then poll its label or hint until
it indicates “Reconnecting” or “Disconnected,” and assert that state before
proceeding with the Forget operation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5031905f-fdb5-40b0-8e70-498cde51a8f4

📥 Commits

Reviewing files that changed from the base of the PR and between c289ce0 and 39a8645.

📒 Files selected for processing (3)
  • Packages/iOS/CmuxMobileSupport/Sources/CmuxMobileSupport/UITestConfig.swift
  • ios/cmuxPackage/Sources/cmuxFeature/CMUXMobileRootScene.swift
  • ios/cmuxUITests/cmuxUITests.swift

Comment thread ios/cmuxPackage/Sources/cmuxFeature/CMUXMobileRootScene.swift Outdated
Comment thread ios/cmuxUITests/cmuxUITests.swift
@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@azooz2003-bit
azooz2003-bit force-pushed the task-ios-delete-computer-buttons branch from c7b125a to 79f4020 Compare August 12, 2026 22:17
@azooz2003-bit
azooz2003-bit merged commit 3473b9b into main Aug 12, 2026
6 checks passed
@azooz2003-bit
azooz2003-bit deleted the task-ios-delete-computer-buttons branch August 12, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant