Repository navigation
Add sidebar account and mobile pairing controls - #8354
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughChangesMobile Connect now opens a reusable workspace-backed pairing panel through application, settings, command palette, sidebar, tab-bar, and CLI entrypoints. Authentication users carry profile image URLs, shared account-flow APIs drive auth state, and feature-gated sidebar account controls are added. Debug tooling supports footer icon tuning. Mobile pairing workspace
Shared account flow and sidebar account controls
Sidebar footer icon debugging
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant EntryPoint
participant AppDelegate
participant Workspace
participant MobilePairingPanel
EntryPoint->>AppDelegate: invoke Mobile Connect action
AppDelegate->>Workspace: reuse or create pairing workspace
Workspace->>MobilePairingPanel: create and register pairing surface
MobilePairingPanel-->>EntryPoint: expose pairing workspace
Possibly related PRs
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (2 errors, 1 warning)
✅ Passed checks (22 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9461b375b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR moves the account menu and Mobile Connect button into the sidebar footer and routes both through dedicated workspace panes instead of a floating window. Auth is consolidated so all callers — sidebar, command palette, keyboard shortcuts, CLI, and settings — share one
Confidence Score: 4/5Safe to merge behind the feature flags, but the sign-in pane UI will display raw English to all non-English users until translations are added. The auth consolidation and workspace-routing changes are well-structured and covered by tests. The main gap is the string catalog: all 44 new account sign-in strings — titles, button labels, loading stages, and all error/recovery messages — ship without translations for 18 of the 20 supported locales. Both feature flags default to true, so this UI is live for every user on launch. Files Needing Attention: Resources/Localizable.xcstrings — needs translations for account.signIn.* across ar, bs, da, de, es, fr, it, km, ko, nb, pl, pt-BR, ru, th, tr, uk, zh-Hans, zh-Hant before the sign-in pane ships to non-English users. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Sidebar as SidebarFooter
participant AppDelegate
participant TabManager
participant Workspace
participant Panel
User->>Sidebar: click account button (signed out)
Sidebar->>AppDelegate: performAccountSignInWorkspaceAction()
AppDelegate->>AppDelegate: check isSidebarAccountButtonEnabled
AppDelegate->>TabManager: find existing AccountSignInPanel?
alt Panel exists
TabManager-->>AppDelegate: workspace + panel
AppDelegate->>Workspace: focusPanel(panel.id)
AppDelegate->>Panel: model.presentSignIn()
else No panel
AppDelegate->>TabManager: addWorkspace("Sign In")
TabManager-->>Workspace: new workspace
AppDelegate->>Workspace: newAccountSignInSurface(inPane:)
Workspace-->>Panel: AccountSignInPanel
AppDelegate->>Panel: model.presentSignIn()
end
Panel->>Panel: startSignInForPane() → URL
Panel-->>User: shows sign-in pane
User->>Sidebar: click mobile connect button
Sidebar->>AppDelegate: performMobileConnectWorkspaceAction()
AppDelegate->>AppDelegate: check isMobileConnectButtonEnabled
AppDelegate->>TabManager: find existing MobilePairingPanel?
alt Panel exists
TabManager-->>AppDelegate: workspace + panel
AppDelegate->>Workspace: focusPanel(panel.id)
else No panel
AppDelegate->>TabManager: addWorkspace("Pair iPhone")
TabManager-->>Workspace: new workspace
AppDelegate->>Workspace: newMobilePairingSurface(inPane:)
Workspace-->>Panel: MobilePairingPanel
end
Panel-->>User: shows pairing pane
Reviews (16): Last reviewed commit: "Refine sidebar debug footer controls" | Re-trigger Greptile |
There was a problem hiding this comment.
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 `@Packages/Shared/CMUXAuthCore/Sources/CMUXAuthCore/Models/CMUXAuthUser.swift`:
- Around line 18-32: Add the missing `profileImageURL` parameter entry to the
documentation for `CMUXAuthUser.init`, describing it as the user's profile image
URL, if any, while leaving the initializer implementation unchanged.
In `@Sources/FeatureFlags.swift`:
- Around line 200-220: The feature-flag properties currently depend on fragile
hardcoded indices into Self.allFlags. Update the allFlags lookup used by
isAgentChatUIEnabled, isSidebarWorkspaceAgentSpinnerEnabled,
isWorkspaceTodoControlsEnabled, isAppKitSidebarListEnabled, and
isSidebarAccountButtonEnabled to use stable keys or named index constants,
preserving each property’s existing flag mapping when flags are inserted or
reordered.
🪄 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: 3b5a7e29-e5a5-4366-b816-b8ba146caf38
📒 Files selected for processing (26)
Packages/Shared/CMUXAuthCore/Sources/CMUXAuthCore/Models/CMUXAuthUser.swiftPackages/Shared/CMUXAuthCore/Tests/CMUXAuthCoreTests/CMUXAuthStateTests.swiftPackages/Shared/CmuxAuthRuntime/Sources/CmuxAuthRuntime/Client/StackAuthClient.swiftPackages/macOS/CmuxWorkspaces/Sources/CmuxWorkspaces/Core/Values/SurfaceKind.swiftResources/Localizable.xcstringsSources/AppDelegate.swiftSources/Auth/HostAccountFlow.swiftSources/Auth/MacAuthComposition.swiftSources/Canvas/WorkspaceCanvasHostView.swiftSources/ClosedItemHistory.swiftSources/CmuxLifecycleEventPublishing.swiftSources/ContentView.swiftSources/FeatureFlags.swiftSources/HostSettingsActions.swiftSources/Mobile/Pairing/MobilePairingWindowController.swiftSources/MobileConnectTitlebarAccessory.swiftSources/Panels/Panel.swiftSources/Panels/PanelContentView.swiftSources/Search/GlobalSearchDocuments.swiftSources/TerminalController.swiftSources/TerminalPaneDropTargetView.swiftSources/VerticalTabsSidebar+EmptyAreasAndFooter.swiftSources/Workspace+LayoutCapture.swiftSources/Workspace+SurfaceNavigation.swiftSources/Workspace.swiftSources/cmuxApp.swift
There was a problem hiding this comment.
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/MobileConnectTitlebarAccessory.swift`:
- Around line 29-37: Rename the titlebar accessory and its related file,
controller references, and private mobileConnectIdentifier in
UpdateTitlebarAccessory.swift to reflect that it now renders only ProBadgeView.
Update all usages consistently while preserving the existing accessory behavior
and layout.
🪄 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: e6fda346-bf2a-43a3-b9a4-159154b49211
📒 Files selected for processing (1)
Sources/MobileConnectTitlebarAccessory.swift
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Sources/ContentView.swift (1)
14288-14366: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy liftKeep the icon lab from owning production footer state.
The debug lab uses persisted
AppStorageas a side channel intoSidebarHelpMenuButton. Make the icon view accept size/weight values, keep production defaults fixed, and let the lab render that component using local state.
Sources/ContentView.swift#L14288-L14366: remove the DEBUG-only settings andAppStorageproperties from the production help button; extract a parameterized icon component.Sources/cmuxApp.swift#L2441-L2671: move the lab into a dedicated debug file and keep its selection state local rather than mutating the live footer.As per path instructions, production
Sources/must not add test/debug-only seams and unavoidable debug facilities belong in a dedicated debug file or folder. As per coding guidelines, do not introduce side channels that create another owner for existing UI state.🤖 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/ContentView.swift` around lines 14288 - 14366, The production SidebarHelpMenuButton must not own debug state. In Sources/ContentView.swift lines 14288-14366, remove its DEBUG AppStorage settings and extract a parameterized help-icon component accepting size and weight, while preserving fixed production defaults. In Sources/cmuxApp.swift lines 2441-2671, move the icon lab to a dedicated debug file and render the shared component with local selection state, without mutating the live footer or introducing another state owner.Sources: Coding guidelines, Path instructions
🤖 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/cmuxApp.swift`:
- Line 2458: Add the identifier assigned in the sidebar footer debug window
setup to the shared cmuxAuxiliaryWindowIdentifiers collection. Keep the existing
window.identifier value unchanged and ensure every cmux.* identifier assignment,
including cmux.sidebarFooterIconBalanceDebug, is registered there so Cmd+W
targets this panel.
---
Outside diff comments:
In `@Sources/ContentView.swift`:
- Around line 14288-14366: The production SidebarHelpMenuButton must not own
debug state. In Sources/ContentView.swift lines 14288-14366, remove its DEBUG
AppStorage settings and extract a parameterized help-icon component accepting
size and weight, while preserving fixed production defaults. In
Sources/cmuxApp.swift lines 2441-2671, move the icon lab to a dedicated debug
file and render the shared component with local selection state, without
mutating the live footer or introducing another state owner.
🪄 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: a426d9c9-3a6c-4211-8744-5c90b6bbd269
📒 Files selected for processing (3)
Resources/Localizable.xcstringsSources/ContentView.swiftSources/cmuxApp.swift
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
|
DRY auth follow-up:
Verification: 166 |
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4c8b28c30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c3adfd17d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # cmux.xcodeproj/project.pbxproj
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
Re-homes the session-search titlebar control after upstream manaflow-ai#8354 deleted MobileConnectTitlebarAccessory.swift (the Pro badge and Mobile Connect button now live in the sidebar). The trailing NSTitlebarAccessoryViewController mechanism is unchanged, so the control moves to a search-only accessory (SessionSearchTitlebarAccessory.swift) reinstalled from UpdateTitlebarAccessoryController with its own identifier, keeping the fittingSize width machinery, the minimal-mode exemption and the mode-bar width reservation contract.
Moves account and Mobile Connect controls into the sidebar footer.
The account menu signs in and out through the shared Stack Auth flow and renders the Stack profile image when available. Mobile Connect now opens a dedicated pairing pane in a new workspace and reuses an existing pairing workspace. Both controls are feature flagged, and every Mobile Connect entrypoint routes through the shared workspace action.
Verification:
swift testinPackages/Shared/CMUXAuthCoreprof17/,/handler/sign-in, and/handler/after-sign-inagainst the tagged web serverworkspace-action --action mobile_connect, which selectedworkspace:2with amobilePairingsurfacegit diff --checkKnown pre-existing lint failure:
sidebar-appkit-list-experimentis evaluated in bothSources/ContentView.swiftandSources/TerminalWindowPortal.swift.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Moves account and Mobile Connect controls to the sidebar footer, and opens Stack sign‑in and iPhone pairing in transient panes. Centralizes Stack Auth, adds avatars, removes the titlebar iPhone control, and ships the Footer Icon Balance Lab.
New Features
sidebar-account-button-enabled-release(default on).__sidebar_footer_icon_balance); managed by a debug windows coordinator and registered as an auxiliary window.Refactors
HostAccountFlowimplementingAccountSignInFlow; command palette, URL callbacks, Settings, pairing, and the new account pane route through it.SurfaceKind.mobilePairing/accountSignInandPanelType.mobilePairing/accountSignIn; wired into sidebar, command palette, search, history, analytics, and theming; panes are transient and excluded from session restore.StackAuthClientnow acceptsbaseURLandnoAutomaticPrefetch;CMUXAuthUser.profileImageURLadded (UI‑testable).Written for commit 1bf4db9. Summary will update on new commits.
Summary by CodeRabbit