Skip to content

Open Settings and iPhone pairing as panes - #8046

Closed
lawrencecchen wants to merge 25 commits into
mainfrom
task-ios-settings-panes
Closed

lawrencecchen wants to merge 25 commits into
mainfrom
task-ios-settings-panes

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • host Settings and iPhone pairing in reusable workspace panes
  • route menu, shortcut, command palette, titlebar, settings, and configured actions through the shared pane opener
  • scope Settings navigation requests to the pane that owns them

Testing

  • swift test --package-path Packages/macOS/CmuxWorkspaces --filter SurfaceKindTests
  • swift test --package-path Packages/macOS/CmuxSettingsUI --filter SettingsSearchIndexTests
  • ./scripts/lint-pbxproj-test-wiring.sh
  • scripts/swift_file_length_budget.py
  • tagged macOS reload: iospan

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Open Settings and iPhone pairing as right-side panes that reuse an existing pane of the same kind. Non-activating opens restore and order-front without changing selection, focus, or zoom; panes are registered in the canvas, and Settings search is faster and scoped per pane with correct clearing and text scaling.

  • New Features

    • Added AppUtilityPanel with kinds .settings and .mobilePairing; introduced PanelType.appUtility, SurfaceKind.appUtility, command palette labels/keywords (“App”), and “App” localization in Recently Closed.
    • Settings can render as panes via SettingsPresentationStyle.pane; added a pane-native sidebar, scoped navigation via SettingsNavigationNotificationRouter, and a per-pane SettingsSidebarModel for faster filtering.
    • Unified open flows through openAppUtilityPane (menu, titlebar, command palette, configured actions, Terminal control, surface tab bar). Opens to the right, reuses same-kind panes, focuses on activating; remote-tmux mirrors are bypassed.
  • Bug Fixes

    • Isolated Settings selection per pane by replacing @AppStorage with per-root state and explicit persistence via SettingsInitialSelectionResolver; initial navigation overrides persisted values without writing defaults.
    • Unified portal visibility reconciliation across terminals and browsers; tab selection and App panes only affect portals in their pane.
    • App Utility panes own/yield focus via a scoped focus anchor; no cross-pane focus theft. Clarified mobile pairing copy to reference panes.
    • Sidebar toggle events can target a single Settings pane; Settings search clearing resets results, selected entries use accent color, and text scaling is handled.

Written for commit 88d83f4. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added App Utility panels for Settings and iPhone pairing, including workspace open/focus behavior.
    • Improved command palette labeling and keyword search for App Utility.
    • Enhanced Settings navigation targeting with optional scope matching.
    • Added support for window vs pane presentation sizing for the Settings UI.
  • Bug Fixes
    • Updated App Utility panel iconography and improved routing for App Utility surface navigation and drop handling.
    • Clarified mobile pairing copy to reference panes instead of windows.
  • Tests
    • Added/expanded coverage for App Utility reuse/creation, settings navigation scope, persisted selection initialization, and wire-value freezing.

@cursor

cursor Bot commented Jul 14, 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@vercel

vercel Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Canceled Canceled Jul 15, 2026 7:40am
cmux-staging Building Building Preview, Comment Jul 15, 2026 7:40am

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an .appUtility panel type for settings and mobile pairing, with workspace creation/reuse, centralized routing, scoped settings navigation, updated metadata/localization, Xcode wiring, and behavioral tests.

Changes

App Utility Surfaces

Layer / File(s) Summary
Panel contracts and rendering
Sources/Panels/*, Sources/SettingsNavigation.swift, Packages/macOS/CmuxSettingsUI/...
Defines .appUtility, renders settings or mobile pairing content, and scopes settings navigation notifications while persisting selection state explicitly.
Workspace surface lifecycle
Sources/Workspace+AppUtilitySurface.swift, Sources/Workspace.swift, Sources/Workspace+SurfaceNavigation.swift, Sources/Workspace+LayoutCapture.swift
Creates or reuses utility surfaces, manages focus and tabs, maps surface kinds, and excludes utility panels from session restoration.
Application routing and mobile pairing
Sources/App/*, Sources/AppDelegate.swift, Sources/HostSettingsActions.swift, Sources/MobileConnectTitlebarAccessory.swift, Sources/ContentView.swift
Routes preferences, mobile pairing, configured actions, and sidebar commands through shared app utility pane handling.
Surface metadata and presentation integration
Sources/ContentView+CommandPaletteSurfaceMetadata.swift, Sources/Canvas/*, Sources/ClosedItemHistory.swift, Sources/CmuxLifecycleEventPublishing.swift, Sources/Search/*, Resources/Localizable.xcstrings
Adds labels, keywords, icons, history titles, event mappings, search handling, drop-target behavior, and updated translations.
Build wiring and validation
cmux.xcodeproj/project.pbxproj, cmuxTests/*, Packages/macOS/CmuxWorkspaces/Tests/...
Registers new sources and tests utility surface reuse, creation, focus, navigation state, and frozen identifiers.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EntryPoint
  participant AppDelegate
  participant Workspace
  participant AppUtilityPanel
  participant SettingsWindowRoot
  EntryPoint->>AppDelegate: request settings or mobile pairing
  AppDelegate->>Workspace: open or focus app utility surface
  Workspace->>AppUtilityPanel: reuse or create panel
  AppUtilityPanel->>SettingsWindowRoot: render scoped settings content
  SettingsWindowRoot->>SettingsWindowRoot: accept matching navigation notifications
Loading

Possibly related PRs

Suggested reviewers: austinywang

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers summary and testing, but omits required Demo Video, Review Trigger, and Checklist sections from the template. Add the missing Demo Video, Review Trigger, and Checklist sections, and include a short UI demo link since this PR changes behavior.
✅ Passed checks (3 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.
Title check ✅ Passed The title clearly matches the main change: hosting Settings and iPhone pairing as reusable panes.
✨ Finishing Touches
📝 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-settings-panes

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.

@greptile-apps

greptile-apps Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR hosts Settings and iPhone pairing in reusable workspace panes. The main changes are:

  • Adds Settings and mobile-pairing utility pane types.
  • Routes menu, shortcut, command, titlebar, and configured actions through one pane opener.
  • Adds pane-scoped Settings navigation, search, selection, and sidebar state.
  • Integrates utility panes with workspace layout, history, lifecycle, and surface metadata.
  • Adds localized labels and focused tests for navigation and pane reuse.

Confidence Score: 5/5

This looks safe to merge.

  • No new blocking issue met the follow-up review requirements.
  • The updated navigation flow preserves explicit Settings targets across creation and reuse.
  • No separate production failure remained after accounting for the existing restoration feedback.

Important Files Changed

Filename Overview
Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Scene/SettingsWindowScene.swift Adds pane-aware Settings layout, scoped navigation, local search state, and explicit selection persistence.
Sources/App/AppDelegateSettingsPresentation.swift Centralizes utility-pane routing, workspace selection, focus, and window presentation.
Sources/Panels/AppUtilityPanel.swift Defines pane state for Settings and mobile-pairing utilities.
Sources/Workspace+AppUtilitySurface.swift Creates and reuses same-kind utility panes within workspace splits.
Sources/Workspace+LayoutCapture.swift Updates workspace layout capture for the new utility surface type.

Reviews (21): Last reviewed commit: "Resolve portal reconciliation merge" | Re-trigger Greptile

Comment thread Sources/Panels/PanelContentView.swift Outdated
Comment on lines +197 to +203
.task(id: panel.settingsNavigationRevision) {
guard let target = panel.settingsNavigationTarget else { return }
SettingsNavigationRequest.post(
target,
scope: panel.settingsNavigationScope
)
}

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.

P1 Initial Navigation Races Restoration

When a new Settings pane is opened with a target, this task posts that target while SettingsWindowRoot independently posts its persisted selection from onAppear. If restoration runs second, it overwrites the requested section, so menu and search actions can open Settings on the previously selected page instead of the requested destination.

Rule Used: Flag Swift fixes that patch symptoms while leaving... (source)

Comment thread Sources/Workspace.swift
Comment on lines 669 to +672
agentSessionSnapshot = nil
case .extensionBrowser:
return nil
case .cloudVMLoading:
case .cloudVMLoading, .appUtility:

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.

P1 Utility Panes Lose Restore State

Returning nil excludes Settings and Pair iPhone panes from the snapshot used by closed-item history and restoration. Closing one therefore creates no restorable entry despite the new .appUtility history label, and layout capture replaces the unsupported surface with a terminal rather than restoring the utility pane.

@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: 1

🤖 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 `@Sources/Panels/AppUtilityPanel.swift`:
- Line 32: Thread the panel-local settingsNavigationScope from AppUtilityPanel
through SettingsNavigationRequest.post(_:scope:) in
SettingsWindowNavigationDelivery, and make the receiver observe/filter
notifications using that same scope object. Ensure requests from other panels
are ignored; alternatively remove settingsNavigationScope if scoped routing is
not required.
🪄 Autofix (Beta)

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

Run ID: 3d116c8d-c718-4210-b64d-7c986a704dd6

📥 Commits

Reviewing files that changed from the base of the PR and between 66fe8fb and f191907.

📒 Files selected for processing (27)
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Scene/SettingsWindowScene.swift
  • Packages/macOS/CmuxWorkspaces/Sources/CmuxWorkspaces/Core/Values/SurfaceKind.swift
  • Packages/macOS/CmuxWorkspaces/Tests/CmuxWorkspacesTests/Core/WorkspaceCoreValueTests.swift
  • Resources/Localizable.xcstrings
  • Sources/App/AppDelegateSettingsPresentation.swift
  • Sources/App/ConfiguredMobileConnectAction.swift
  • Sources/AppDelegate.swift
  • Sources/Canvas/WorkspaceCanvasHostView.swift
  • Sources/ClosedItemHistory.swift
  • Sources/CmuxLifecycleEventPublishing.swift
  • Sources/ContentView+CommandPaletteSurfaceMetadata.swift
  • Sources/ContentView.swift
  • Sources/HostSettingsActions.swift
  • Sources/Mobile/Pairing/MobilePairingView.swift
  • Sources/MobileConnectTitlebarAccessory.swift
  • Sources/Panels/AppUtilityPanel.swift
  • Sources/Panels/Panel.swift
  • Sources/Panels/PanelContentView.swift
  • Sources/Search/GlobalSearchDocuments.swift
  • Sources/SettingsNavigation.swift
  • Sources/TerminalPaneDropTargetView.swift
  • Sources/Workspace+AppUtilitySurface.swift
  • Sources/Workspace+LayoutCapture.swift
  • Sources/Workspace+SurfaceNavigation.swift
  • Sources/Workspace.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/AppUtilityPanelTests.swift

let stableSurfaceIdentity = PanelStableSurfaceIdentity()
let panelType: PanelType = .appUtility
let kind: Kind
let settingsNavigationScope = UUID().uuidString

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n 'settingsNavigationScope' -C4 --glob '*.swift'

Repository: manaflow-ai/cmux

Length of output: 154


🏁 Script executed:

#!/bin/bash
set -euo pipefail

git ls-files 'Sources/**/*.swift' | sed -n '1,200p'

printf '\n-- matches --\n'
rg -n 'settingsNavigationScope|SettingsNavigation|SettingsWindowScene|NotificationCenter.*settings|notification.*settings|scope' Sources --glob '*.swift' -C 3

Repository: manaflow-ai/cmux

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,220p' Sources/Panels/AppUtilityPanel.swift

printf '\n-- related files --\n'
fd -a 'SettingsWindowScene.swift|SettingsNavigation.swift' Sources

Repository: manaflow-ai/cmux

Length of output: 2027


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- AppUtilityPanel.swift ---'
sed -n '1,140p' Sources/Panels/AppUtilityPanel.swift

printf '\n%s\n' '--- settings-related matches ---'
rg -n 'SettingsWindowScene|SettingsNavigation|settingsNavigationScope|NavigationScope|NotificationCenter' Sources --glob '*.swift' -C 2

Repository: manaflow-ai/cmux

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- settings navigation symbols ---'
rg -n 'SettingsNavigationRequest|settingsNavigationScope|SettingsNavigationTarget|NavigationScope|NotificationCenter\.default\.(post|publisher|addObserver)' Sources/App/SettingsWindowNavigationDelivery.swift Sources/App/SettingsWindowPresenter.swift Sources/App/SettingsWindowFactory.swift Sources/SettingsNavigation.swift Sources/App/SettingsWindowRoot.swift Sources/App/AppUtilityPanel.swift --glob '*.swift' -C 3

printf '\n%s\n' '--- SettingsNavigation.swift ---'
sed -n '1,220p' Sources/SettingsNavigation.swift

printf '\n%s\n' '--- SettingsWindowNavigationDelivery.swift ---'
sed -n '1,220p' Sources/App/SettingsWindowNavigationDelivery.swift

Repository: manaflow-ai/cmux

Length of output: 12406


Thread settingsNavigationScope through the request. Sources/App/SettingsWindowNavigationDelivery.swift:19,36 posts SettingsNavigationRequest without the panel-local UUID from Sources/Panels/AppUtilityPanel.swift:32, so the receiver has nothing to filter on. Pass the same scope via SettingsNavigationRequest.post(_:scope:) and observe by notification object, or drop the unused property.

🤖 Prompt for 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.

In `@Sources/Panels/AppUtilityPanel.swift` at line 32, Thread the panel-local
settingsNavigationScope from AppUtilityPanel through
SettingsNavigationRequest.post(_:scope:) in SettingsWindowNavigationDelivery,
and make the receiver observe/filter notifications using that same scope object.
Ensure requests from other panels are ignored; alternatively remove
settingsNavigationScope if scoped routing is not required.

Source: Path instructions

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

# Conflicts:
#	Sources/App/SettingsWindowFactory.swift
#	Sources/ContentView.swift
#	Sources/Mobile/Pairing/MobilePairingView.swift
#	Sources/Panels/PanelContentView.swift
#	Sources/Search/GlobalSearchDocuments.swift
#	Sources/Workspace+LayoutCapture.swift
# Conflicts:
#	.github/swift-file-length-budget.tsv
@cursor

cursor Bot commented Jul 15, 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.

@lawrencecchen lawrencecchen added the stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening. label Sep 23, 2026

This branch was successfully deployed

1 active deployment
Preview – cmux — 88d83f49 Deployed Jul 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants