Skip to content

Add sidebar account and mobile pairing controls - #8354

Merged
lawrencecchen merged 43 commits into
mainfrom
feat-sidebar-profile
Jul 31, 2026
Merged

lawrencecchen merged 43 commits into
mainfrom
feat-sidebar-profile

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

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 test in Packages/Shared/CMUXAuthCore
  • tagged macOS build prof17
  • warmed /, /handler/sign-in, and /handler/after-sign-in against the tagged web server
  • exercised workspace-action --action mobile_connect, which selected workspace:2 with a mobilePairing surface
  • git diff --check
  • localization JSON validation

Known pre-existing lint failure: sidebar-appkit-list-experiment is evaluated in both Sources/ContentView.swift and Sources/TerminalWindowPortal.swift.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with 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 with avatar and in‑pane sign‑in/out; gated by sidebar-account-button-enabled-release (default on).
    • Sidebar Mobile Connect opens/reuses a “Pair iPhone” pane via a shared workspace action; flag‑gated and defaults hidden.
    • Footer Icon Balance Lab available from Help and CLI (__sidebar_footer_icon_balance); managed by a debug windows coordinator and registered as an auxiliary window.
    • Minimal mode footer shows only Upgrade.
  • Refactors

    • Centralized auth in HostAccountFlow implementing AccountSignInFlow; command palette, URL callbacks, Settings, pairing, and the new account pane route through it.
    • Added SurfaceKind.mobilePairing/accountSignIn and PanelType.mobilePairing/accountSignIn; wired into sidebar, command palette, search, history, analytics, and theming; panes are transient and excluded from session restore.
    • StackAuthClient now accepts baseURL and noAutomaticPrefetch; CMUXAuthUser.profileImageURL added (UI‑testable).
    • UI tweaks: avatar fallback, matched account/help icon sizing/weight, per‑icon hover/blur tuning, tighter footer spacing; removed the titlebar iPhone button; sign‑in/pairing panes match the terminal theme.

Written for commit 1bf4db9. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added a dedicated iPhone pairing “mobile pairing” workspace/panel across the app, including sidebar access, command palette, workspace/tab actions, and CLI support.
  • Improvements
    • Mobile Connect now routes through the unified workspace flow with consistent tab/focus behavior and won’t persist mobile-pairing state.
    • Authentication flow updates improve sign-in/out handling, and profile images now populate identity avatars.
    • Sidebar footer now includes avatar-based account controls and a Mobile Connect shortcut.
  • Localization / Feature Flags
    • Updated Mobile Connect and sidebar copy, and added new sidebar account feature-flag strings.

@coderabbitai

coderabbitai Bot commented Jul 17, 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
📝 Walkthrough

Walkthrough

Changes

Mobile 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

Layer / File(s) Summary
Pairing panel contract and rendering
Sources/Panels/*, Sources/Mobile/Pairing/*, Packages/macOS/CmuxWorkspaces/...
Adds the mobilePairing panel and surface types, workspace surface creation, and SwiftUI rendering.
Workspace lifecycle and action routing
Sources/AppDelegate.swift, Sources/Workspace.swift, Sources/TerminalController.swift, Sources/Workspace+*
Routes Mobile Connect through reusable or newly created pairing workspaces, adds the CLI action, and excludes pairing panels from session restoration.
Pairing entrypoints and panel metadata
Sources/ContentView.swift, Sources/VerticalTabsSidebar+EmptyAreasAndFooter.swift, Sources/HostSettingsActions.swift, Sources/ClosedItemHistory.swift, Sources/Search/*, Sources/MobileConnectTitlebarAccessory.swift, Resources/Localizable.xcstrings
Updates command palette, sidebar, settings, history, search, icons, drop handling, lifecycle metadata, titlebar composition, and localized Mobile Connect copy.

Shared account flow and sidebar account controls

Layer / File(s) Summary
Account identity and shared auth APIs
Packages/Shared/CMUXAuthCore/*, Packages/Shared/CmuxAuthRuntime/*, Sources/Auth/*, Sources/AppDelegate.swift, Sources/TerminalController.swift, Sources/Mobile/Pairing/*, Sources/ContentView*, Sources/cmuxApp.swift
Adds profile image data, expands HostAccountFlow, wires it through authentication consumers, and updates pairing and terminal auth behavior.
Sidebar account feature and UI
Sources/FeatureFlags.swift, Sources/VerticalTabsSidebar+EmptyAreasAndFooter.swift, Sources/ContentView.swift, Resources/Localizable.xcstrings
Adds the sidebar account flag and renders signed-in or signed-out account controls with avatar loading and authentication actions.

Sidebar footer icon debugging

Layer / File(s) Summary
Footer icon balance lab
Sources/ContentView.swift, Sources/cmuxApp.swift, Resources/Localizable.xcstrings
Adds debug controls, persisted icon size and weight settings, localized labels, and a preview window for footer icon variants.

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
Loading

Possibly related PRs

Suggested reviewers: azooz2003-bit, austinywang


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 errors, 1 warning)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error New xcstrings keys like mobile.pairing.window.title and featureFlags.sidebarAccount.* only have en/ja, but the catalog supports 20 locales. Add translated entries for every existing locale in Resources/Localizable.xcstrings for each new or changed key, including ar/bs/da/de/es/fr/it/km/ko/nb/pl/pt-BR/ru/th/tr/uk/zh-Hans/zh-Hant.
Cmux No Ambient Global State ❌ Error Sources/cmuxApp.swift:2441-2442 adds SidebarFooterIconBalanceDebugWindowController.shared, a new singleton used for runtime window state. Construct the debug window controller in cmuxApp or a debug windows coordinator and inject/use that instance from menu actions instead of a shared static.
Docstring Coverage ⚠️ Warning Docstring coverage is 12.12% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (22 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 new shared auth/account flow and feature-flag accessors are MainActor-isolated; background socket paths hop to MainActor before touching them.
Cmux Swift Blocking Runtime ✅ Passed PR-range diff adds sidebar/debug UI and auth wiring, but no added lines contain semaphores, waits, sleeps, asyncAfter, main-sync, locks, or polling.
Cmux Browser Automation Off-Main ✅ Passed No diff hunk moved browser.* automation off-main; the touched TerminalController lines are auth-only, while browser.wait/screenshot/eval remain worker-routed and policy-tested.
Cmux Expensive Synchronous Load ✅ Passed PASS: The diff only rewires auth/mobile-connect UI; no new RestorableAgentSessionIndex.load() call was added, and the existing ones remain guarded cold-cache fallbacks.
Cmux Cache Substitution Correctness ✅ Passed No persistence/history/snapshot path substitutes a cache here; the diff only proxies live auth state and adds mobilePairing cases.
Cmux No Hacky Sleeps ✅ Passed PR changes are Swift-only; no TS/JS/shell/build runtime diffs with sleeps/delays were introduced.
Cmux Algorithmic Complexity ✅ Passed New code only adds one-off linear lookups for Mobile Connect; no batch rescans, repeated sorts, or hot-path collection churn were introduced.
Cmux Swift Concurrency ✅ Passed Added Tasks are UI/observer boundary hops and cancelable observation tasks; no new DispatchQueue/global, Combine state, or completion-handler APIs were introduced.
Cmux Swift @Concurrent ✅ Passed New async APIs are main-actor-bound or invoked via explicit Task { @mainactor ... }; no @concurrent misuse found.
Cmux Swift Package Boundaries ✅ Passed Core auth/model changes live in SwiftPM targets; app-target additions are UI and app-composition glue around AccountFlow and workspace actions.
Cmux Swiftpm Lockfiles ✅ Passed Only Swift source files changed; no Package.swift, .xcodeproj, .gitignore, or Package.resolved diffs to enforce.
Cmux Swift Logging ✅ Passed Inspected the touched Swift files and their patch hunks; no new or materially changed print/debugPrint/dump/NSLog/Logger logging was added.
Cmux User-Facing Error Privacy ✅ Passed Auth failures are display-safe/sanitized, and I found no user-visible raw upstream messages or secrets; remaining Iroh/Tailscale text is explanatory pairing copy.
Cmux Swiftui State Layout ✅ Passed New SwiftUI state is @Observable/value-based; the only new ObservableObject is an existing Panel/AppKit bridge pattern, and no lazy/list row store refs or GeometryReader layout writes were introduced.
Cmux Architecture Rethink ✅ Passed PR centralizes Mobile Connect and auth routing through shared flow/action paths, with no new timing hacks, duplicate owners, or split lifecycle ownership in the added code.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed New standalone windows keep stable cmux.* IDs and are registered in cmuxAuxiliaryWindowIdentifiers, so the close-shortcut rule is satisfied.
Cmux Source Artifacts ✅ Passed HEAD changes only source files under Sources/ and Packages/; no logs, temp dirs, build output, caches, or other artifact paths were added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed The touched production files only reroute auth/mobile-connect logic; no new #if DEBUG test hooks or *ForTesting seams were added, and existing ones in cmuxApp are untouched.
Title check ✅ Passed The title clearly summarizes the primary change: adding account and mobile pairing controls to the sidebar.
Description check ✅ Passed The description explains the main changes and lists testing performed, but it omits the template’s demo video and checklist sections.
✨ 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 feat-sidebar-profile

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread Sources/TerminalController.swift Outdated
@greptile-apps

greptile-apps Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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 HostAccountFlow composition root.

  • Adds SidebarAccountMenuButton (avatar + sign in/out popover) and SidebarMobileConnectButton to the sidebar footer, both gated by feature flags that default to enabled.
  • Introduces AccountSignInPanel/AccountSignInView/AccountSignInModel for an in-pane Stack sign-in flow, and MobilePairingPanel for a workspace-hosted pairing surface; both are opened or reused via AppDelegate.performAccountSignInWorkspaceAction / performMobileConnectWorkspaceAction.
  • Centralizes auth routing: MacAuthComposition now exposes a single HostAccountFlow shared by settings UI, sidebar, socket commands, and the MobilePairingView; TerminalController.browserSignInFlow becomes accountFlow throughout.

Confidence Score: 4/5

Safe 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

Filename Overview
Resources/Localizable.xcstrings Adds 66 new string keys; 44 production account.signIn.* strings and featureFlags.sidebarAccount.* strings are missing translations for 18 of 20 supported locales — all users outside English will see raw English in the new sign-in pane.
Sources/Auth/AccountSignInModel.swift New @observable model projects the shared HostAccountFlow sign-in state into stable pane presentation phases; logic is clean and well-tested.
Sources/Auth/AccountSignInView.swift Full sign-in UI with idle, loading, failure, and success states; all user-facing strings use String(localized:defaultValue:) correctly, but translations for non-English locales are absent from the catalog.
Sources/Auth/HostAccountFlow.swift Adds AccountSignInFlow conformance and new socket-compatible signIn/signOut/handleCallbackURL helpers; extends manualSignInURL and openSignInURLInDefaultBrowser through the AccountSignInFlow protocol cleanly.
Sources/Auth/MacAuthComposition.swift Replaces the separate browserSignIn property with the shared HostAccountFlow; removes the duplicate StackClientApp construction and consolidates auth into a single composition root.
Sources/AppDelegate.swift Adds performMobileConnectWorkspaceAction alongside the workspace-routing refactor; the mobile_connect keyboard shortcut path is correctly migrated from MobilePairingWindowController.shared to the workspace action.
Sources/AppDelegate+AccountSignInWorkspace.swift New extension opens or reuses the Sign-In workspace pane; correctly gates on the feature flag and falls back to closing the workspace on failure.
Sources/VerticalTabsSidebar+EmptyAreasAndFooter.swift Adds SidebarAccountMenuButton and SidebarMobileConnectButton to the sidebar footer; the accountFlow capture-at-init pattern was flagged in a prior review thread.
Sources/Mobile/Pairing/MobilePairingWindowController.swift Adds MobilePairingPanel and the Workspace extension for newMobilePairingSurface; MobilePairingPanel has a spurious ObservableObject conformance with no @published properties.
Sources/TerminalController.swift Migrates browserSignInFlow to accountFlow throughout; adds mobile_connect workspace action using performMobileConnectWorkspaceAction inside v2MainSync, consistent with other workspace actions.
Sources/FeatureFlags.swift Inserts sidebarAccountButton flag at index 2 and correctly shifts all higher accessor indices; isSidebarAccountButtonEnabled accessor ordering relative to allFlags array was noted in a prior thread.
Sources/cmuxApp.swift Adds SidebarFooterIconBalanceDebugWindowController without a #if DEBUG guard, causing a release-build compile error when referencing types defined inside #if DEBUG in ContentView.swift; noted in a prior review thread.
Packages/Shared/CmuxAuthRuntime/Sources/CmuxAuthRuntime/Client/StackAuthClient.swift Exposes baseURL and noAutomaticPrefetch parameters through the public initializer and populates profileImageURL from the Stack user object.

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (16): Last reviewed commit: "Refine sidebar debug footer controls" | Re-trigger Greptile

Comment thread Sources/VerticalTabsSidebar+EmptyAreasAndFooter.swift Outdated
Comment thread Sources/FeatureFlags.swift Outdated

@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 `@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

📥 Commits

Reviewing files that changed from the base of the PR and between b984c9d and a9461b3.

📒 Files selected for processing (26)
  • Packages/Shared/CMUXAuthCore/Sources/CMUXAuthCore/Models/CMUXAuthUser.swift
  • Packages/Shared/CMUXAuthCore/Tests/CMUXAuthCoreTests/CMUXAuthStateTests.swift
  • Packages/Shared/CmuxAuthRuntime/Sources/CmuxAuthRuntime/Client/StackAuthClient.swift
  • Packages/macOS/CmuxWorkspaces/Sources/CmuxWorkspaces/Core/Values/SurfaceKind.swift
  • Resources/Localizable.xcstrings
  • Sources/AppDelegate.swift
  • Sources/Auth/HostAccountFlow.swift
  • Sources/Auth/MacAuthComposition.swift
  • Sources/Canvas/WorkspaceCanvasHostView.swift
  • Sources/ClosedItemHistory.swift
  • Sources/CmuxLifecycleEventPublishing.swift
  • Sources/ContentView.swift
  • Sources/FeatureFlags.swift
  • Sources/HostSettingsActions.swift
  • Sources/Mobile/Pairing/MobilePairingWindowController.swift
  • Sources/MobileConnectTitlebarAccessory.swift
  • Sources/Panels/Panel.swift
  • Sources/Panels/PanelContentView.swift
  • Sources/Search/GlobalSearchDocuments.swift
  • Sources/TerminalController.swift
  • Sources/TerminalPaneDropTargetView.swift
  • Sources/VerticalTabsSidebar+EmptyAreasAndFooter.swift
  • Sources/Workspace+LayoutCapture.swift
  • Sources/Workspace+SurfaceNavigation.swift
  • Sources/Workspace.swift
  • Sources/cmuxApp.swift

Comment thread Sources/FeatureFlags.swift Outdated

@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/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

📥 Commits

Reviewing files that changed from the base of the PR and between 96dd425 and 6fae544.

📒 Files selected for processing (1)
  • Sources/MobileConnectTitlebarAccessory.swift

Comment thread Sources/MobileConnectTitlebarAccessory.swift Outdated
Comment thread Sources/cmuxApp.swift Outdated

@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

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 lift

Keep the icon lab from owning production footer state.

The debug lab uses persisted AppStorage as a side channel into SidebarHelpMenuButton. 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 and AppStorage properties 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6fae544 and 7da5928.

📒 Files selected for processing (3)
  • Resources/Localizable.xcstrings
  • Sources/ContentView.swift
  • Sources/cmuxApp.swift

Comment thread Sources/cmuxApp.swift
@cursor

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

Copy link
Copy Markdown
Contributor Author

DRY auth follow-up:

  • HostAccountFlow is now the sole macOS Stack sign-in facade. Sidebar, Settings, command palette, Mobile pairing, external callbacks, and socket auth all route through it.
  • macOS and iOS now construct Stack through the shared StackAuthClient initializer. iOS credential, magic-link, and OAuth flows continue through the shared AuthCoordinator.
  • Production-source audit leaves exactly one beginSignIn() caller: HostAccountFlow.

Verification: 166 CmuxAuthRuntime tests pass; 15 CMUXAuthCore tests pass; tagged macOS build auth17 passes; auth routes return 200; socket sign-in URL uses cmux-dev-auth17; sidebar Account popover and Mobile pairing workspace were exercised. iOS simulator reload is blocked because Xcode reports the required iOS 26.5 platform component is not installed; the connected physical iPhone is unavailable.

@cursor

cursor Bot commented Jul 18, 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 chatgpt-codex-connector 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.

💡 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".

Comment thread Sources/Workspace.swift

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread Sources/cmuxApp.swift
Comment thread Sources/AppDelegate.swift Outdated
Comment thread Sources/VerticalTabsSidebar+EmptyAreasAndFooter.swift Outdated
@cursor

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

@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.

@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.

@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.

@cursor

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

@cursor

cursor Bot commented Jul 31, 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 merged commit 184bd48 into main Jul 31, 2026
6 checks passed
@lawrencecchen
lawrencecchen deleted the feat-sidebar-profile branch July 31, 2026 14:40
georgegrayos added a commit to georgegrayos/cmux that referenced this pull request Aug 5, 2026
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.
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