Skip to content

Restore right-click sidebar-button view switcher and built-in views (#5173) - #5182

Merged
austinywang merged 6 commits into
mainfrom
issue-5173-restore-sidebar-views
Jun 2, 2026
Merged

austinywang merged 6 commits into
mainfrom
issue-5173-restore-sidebar-views

Conversation

@austinywang

@austinywang austinywang commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the v0.64.11 regression where right-clicking the sidebar button (top-left, by the traffic lights) no longer opened the context menu for switching between built-in sidebar views — and the views themselves (Default Workspaces, Project Worktrees, Attention Queue, Dev Servers, Last Prompt, Super Compact, Browser Stack) were gone.

Closes #5173

What #4994 changed

a086dd1fd ("Replace sidebar extension kit contract") swapped the old in-process sidebar-provider contract for an XPC-based ExtensionKit host. It kept the in-process compatibility render layer (CmuxExtensionCompatibility.swift) and ContentView's render pipeline, but it:

  • stubbed CmuxExtensionSidebarSelection.providers to [] (was SidebarExamples.providers, the six built-in preset views) and unlinked the CmuxExtensionSidebarExamples package from the app target;
  • gated the sidebar-button right-click menu behind the experimental Extensions beta flag (guard isEnabled in showMenu, and effectiveExtensionSidebarProviderId forcing Default Workspaces whenever the flag was off — see BetaFeaturesCatalogSection.extensions, which is off by default);
  • dropped the BrowserStackSidebar.stateDidLoadNotification live-refresh.

Net effect on a default install (beta off): the menu and all of its built-in views disappeared.

How this restores them (on top of the new contract, not a revert)

The new XPC contract is intentional, so this re-implements the built-in views on top of it and lets both coexist. The experimental flag now gates only the new XPC surface (the hosted "Extension Sidebar" entry, the puzzle button, the extensions browser); the built-in views are always available again, exactly as in v0.64.10.

  • Re-link CmuxExtensionSidebarExamples into the cmux target and restore providers + the import. The example providers compile unchanged against the kept compatibility layer (verified with a standalone swift build).
  • Split the descriptor lists: builtInDescriptors (always: Default + 6 presets, in v0.64.10 menu order) vs descriptors (adds the hosted entry only when the beta is on) vs allDescriptors (handler superset for command registration).
  • Add the pure effectiveProviderId(_:extensionsEnabled:) so the menu checkmark and the rendered provider track the persisted selection, downgrading only a hosted selection to Default while the beta is off (so the experimental feature can't strand the user). The view's effectiveExtensionSidebarProviderId now delegates to it.
  • Un-gate the menu: drop guard isEnabled in showMenu; the checkmark reflects the effective selection. Also un-gate the command-palette "Sidebar: " contributions.
  • Restore the BrowserStackSidebar live-refresh subscription.

Tests

Two-commit red/green structure:

  • Commit 1 adds a failing Swift Testing regression suite (cmuxTests/SidebarProviderMenuRegressionTests.swift, wired into the project) that asserts all seven built-in views are present in CmuxExtensionSidebarSelection.descriptors with the Extensions beta off, and that a selected built-in view resolves to itself (drives the checkmark). CI should be red on this commit.
  • Commit 2 applies the fix (CI green) and adds a check that effectiveProviderId gates the hosted entry but never the built-in views.

xcodebuild -scheme cmux-unit could not be run locally (submodules/GhosttyKit not provisioned in this worktree and disk is constrained); relying on the tests CI job to gate the build per the repo's testing policy. The Examples↔compatibility-layer contract was verified locally with swift build.

🤖 Generated with Claude Code


Note

Medium Risk
Touches primary sidebar selection/rendering paths and Swift protocol dispatch; risk is mitigated by focused regression tests but behavior spans AppKit menus, command palette, and SwiftUI effective provider routing.

Overview
Fixes the v0.64.11 regression where built-in sidebar views and the sidebar-button view switcher disappeared when the Extensions beta was off (#5173).

CmuxExtensionKit: render(snapshot:) is declared as a protocol requirement on CmuxExtensionSidebarProvider so calls through any CmuxExtensionSidebarProvider dynamic-dispatch to concrete implementations instead of the empty extension default.

App wiring: Re-links CmuxExtensionSidebarExamples, restores providers from SidebarExamples.providers, and splits descriptor lists (builtInDescriptors, descriptors with hosted entry only when beta is on, allDescriptors for palette handler registration). Adds effectiveProviderId so built-in selections always render; only a persisted hosted extension selection falls back to Default Workspaces when the beta is off. The right-click switcher and command-palette “Sidebar: …” entries are no longer gated entirely on the beta; menu checkmarks use the effective id. BrowserStackSidebar.stateDidLoadNotification again triggers sidebar snapshot refresh.

Tests: Regression suites assert built-in menu availability, checkmark resolution, existential rendering, and host-path rendering.

Reviewed by Cursor Bugbot for commit d27b449. Bugbot is set up for automated code reviews on this repo. Configure here.


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


Summary by cubic

Restores the right-click sidebar-button view switcher and the seven built-in views lost in v0.64.11, and fixes an empty-render regression by restoring dynamic dispatch for render(snapshot:) (fixes #5173). Keeps the new XPC sidebar host; the Extensions beta now gates only the hosted “Extension Sidebar” entry.

  • Bug Fixes
    • Built-in views (Default + six presets) always appear in the menu and command palette; the hosted entry shows only when the Extensions beta is on.
    • Re-linked CmuxExtensionSidebarExamples and restored its providers.
    • Added effectiveProviderId(...) to honor built-ins; a hosted selection downgrades to Default when the beta is off.
    • Ungated the right-click menu and “Sidebar: ” commands; registered palette handlers for all descriptors via allDescriptors.
    • Restored BrowserStack sidebar live refresh.
    • Fixed empty sidebar renders by making CmuxExtensionSidebarProvider.render(snapshot:) a protocol requirement in CmuxExtensionKit; added existential-dispatch tests in app tests and CmuxExtensionSidebarExamples to lock this in.

Written for commit d27b449. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Sidebar provider switching now handles runtime toggling of the experimental extensions feature and correctly falls back to the default provider when disabled.
    • Command palette and context-menu sidebar selections continue to resolve correctly if the extensions flag changes.
    • Sidebar browser view refreshes snapshots when sidebar state loads.
  • Tests

    • Added regression tests covering sidebar provider menu behavior and rendering through the provider existential.
  • Documentation

    • Clarified documentation for extension sidebar provider rendering.

austinywang and others added 2 commits June 1, 2026 23:13
The right-click sidebar-button menu lost its built-in views in v0.64.11.
This test asserts the seven built-in views (Default Workspaces + the six
presets) are available via CmuxExtensionSidebarSelection regardless of the
experimental Extensions beta flag, and that a selected view resolves to
itself (which drives the menu checkmark).

Failing test only — no fix yet, so CI goes red and proves the test catches
the regression. The fix follows in the next commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
#4994 ("Replace sidebar extension kit contract") replaced the old in-process
sidebar-provider contract with an XPC-based ExtensionKit host. It kept the
in-process compatibility render layer (CmuxExtensionCompatibility.swift) and
ContentView's render pipeline, but it:

  - stubbed CmuxExtensionSidebarSelection.providers to `[]` (was
    SidebarExamples.providers — the six built-in preset views) and unlinked
    the CmuxExtensionSidebarExamples package from the app target;
  - gated the sidebar-button right-click menu behind the experimental
    Extensions beta flag (`guard isEnabled` in showMenu, and
    effectiveExtensionSidebarProviderId forcing Default Workspaces whenever
    the flag was off);
  - dropped the BrowserStackSidebar.stateDidLoadNotification refresh.

Net effect on a default install (beta off): the right-click menu and all of
its built-in views (Default Workspaces, Project Worktrees, Attention Queue,
Dev Servers, Last Prompt, Super Compact, Browser Stack) disappeared.

This restores them on top of #4994's new contract rather than reverting it.
The experimental flag now gates only the new XPC surface (the hosted
"Extension Sidebar" entry, the puzzle button, the extensions browser); the
built-in views are always available again:

  - re-link CmuxExtensionSidebarExamples into the cmux target and restore
    `providers`/import (the examples compile unchanged against the kept
    compatibility layer);
  - split builtInDescriptors (always) from descriptors (adds the hosted
    entry only when the beta is on) and allDescriptors (handler superset);
  - add the pure effectiveProviderId(_:extensionsEnabled:) so the menu
    checkmark and the rendered provider track the selection, downgrading
    only a hosted selection to default while the beta is off;
  - drop the `guard isEnabled` in showMenu and un-gate the command-palette
    "Sidebar: <view>" contributions;
  - restore the BrowserStackSidebar live-refresh subscription.

Closes #5173

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 2, 2026 8:59am
cmux-staging Building Building Preview, Comment Jun 2, 2026 8:59am

@coderabbitai

coderabbitai Bot commented Jun 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Refactors the sidebar provider descriptor model for runtime Extensions-beta toggling, updates command-palette and right-click menu wiring to remain resolvable after flag flips, imports example providers, refreshes the browser-stack sidebar snapshot on load, and adds regression tests and an example test suite.

Changes

Sidebar provider menu restoration and feature-flag resilience

Layer / File(s) Summary
Dependency setup and descriptor model import
Sources/ContentView.swift, cmux.xcodeproj/project.pbxproj, Examples/CmuxExtensionSidebarExamples/..., Packages/CmuxExtensionKit/...
Adds CmuxExtensionSidebarExamples import, wires the local package into the app project, and includes example/test artifacts so built-in sidebar providers are available to the host.
Descriptor model refactoring for feature-gated availability
Sources/ContentView.swift
Introduces builtInDescriptors and allDescriptors, makes descriptors feature-gated, and adds effectiveProviderId(_:extensionsEnabled:) to remap persisted hosted-provider selections to the default when Extensions beta is off.
Command palette and right-click menu integration
Sources/ContentView.swift
Command-palette "Sidebar: " entries iterate over feature-gated descriptors. Command handlers register for allDescriptors so commands resolve after runtime flag flips. Right-click sidebar provider menu always shows and uses effectiveProviderId to select a safe fallback.
Sidebar UI provider selection and rendering
Sources/ContentView.swift
VerticalTabsSidebar computes effectiveExtensionSidebarProviderId via the new fallback logic so the rendered provider falls back when extensions are disabled. Adds snapshot refresh on BrowserStackSidebar.stateDidLoadNotification.
Regression test coverage for sidebar provider menu
cmuxTests/SidebarProviderMenuRegressionTests.swift, Examples/CmuxExtensionSidebarExamples/Tests/*
Adds tests that verify built-in descriptors are present when the beta is disabled, persisted selections resolve to expected descriptors via effectiveProviderId, and rendering through the any CmuxExtensionSidebarProvider existential produces concrete non-empty output.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • manaflow-ai/cmux#5092: Modifies Sources/ContentView.swift around extensions beta gating and provider/menu plumbing; overlaps in command-palette and feature-gate behavior.
  • manaflow-ai/cmux#4662: Also touches inclusion/wiring of CmuxExtensionSidebarExamples; may conflict in package/product wiring decisions.
  • manaflow-ai/cmux#5127: Similar changes to effectiveProviderId/fallback logic in VerticalTabsSidebar and provider selection.

"I'm a rabbit in the code-laden glen,
toggling flags and hopping again,
menus return, providers sing,
fallbacks bounce on runtime spring,
pocket carrots for tests — joy to mend!"


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error ContentView.swift line 10124 introduces user-facing string "sidebar.provider.extensions.selectedSubtitle" without corresponding catalog entry for all 20 supported locales. Add "sidebar.provider.extensions.selectedSubtitle" to Resources/Localizable.xcstrings with translations for all 20 app locales.
Docstring Coverage ⚠️ Warning Docstring coverage is 38.89% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (16 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main fix: restoring the right-click sidebar-button view switcher and built-in views. It is specific, concise, and directly related to the primary objective of fixing the v0.64.11 regression.
Linked Issues check ✅ Passed The PR fully addresses all requirements from #5173: confirms the v0.64.11 regression, identifies the root cause in #4994, restores the menu and seven built-in views adapted to the new contract (not a revert), adds effective selection tracking, implements regression tests asserting built-in availability and effective selection behavior when Extensions beta is off.
Out of Scope Changes check ✅ Passed All changes are scoped to restoring the sidebar switcher and built-in views as specified in #5173. Re-linking CmuxExtensionSidebarExamples, refactoring descriptors (builtInDescriptors/descriptors/allDescriptors), adding effectiveProviderId, ungating the menu, restoring BrowserStack refresh, updating documentation, and adding regression tests are all directly tied to the regression fix objective.
Cmux Swift Actor Isolation ✅ Passed All CmuxExtensionSidebarSelection members are called only from @MainActor contexts (Views, showMenu). No nonisolated shared mutable types or implicit MainActor value models introduced.
Cmux Swift Blocking Runtime ✅ Passed Sidebar extension provider refactoring contains no blocking patterns. Task.sleep and NSLock are pre-existing code unrelated to PR's extension selection changes.
Cmux No Hacky Sleeps ✅ Passed PR contains only Swift code and Xcode project configuration; the check covers TypeScript, JavaScript, shell, and non-Swift runtime scripts (Swift is explicitly out of scope per the rule).
Cmux Algorithmic Complexity ✅ Passed All operations use tiny fixed-size collections (max 9 descriptors, 6 built-in providers) bounded at compile time, explicitly permitted by complexity rules.
Cmux Swift Concurrency ✅ Passed All new code is synchronous: effectiveProviderId, builtInDescriptors, allDescriptors use only synchronous logic. No legacy async patterns or Combine usage introduced.
Cmux Swift @Concurrent ✅ Passed All new Swift code is synchronous and lightweight (three new pure functions doing string comparison and array ops); no async work, no @concurrent violations, no isolation issues detected.
Cmux Swift File And Package Boundaries ✅ Passed Focused bug fix adding 46 net lines to oversized file (below 250-line threshold), with test files properly categorized. Meets allowed "focused bug fix" exception criteria.
Cmux Swift Logging ✅ Passed No logging violations found. PR adds no print, debugPrint, dump, or NSLog. Pre-existing DEBUG-gated feedback code unchanged. Tests and documentation have no logging.
Cmux User-Facing Error Privacy ✅ Passed All user-facing error strings use generic terminology and don't expose vendor names, provider IDs, XPC details, or sensitive information. Debug logs are #if DEBUG guarded.
Cmux Swiftui State Layout ✅ Passed PR adds only static computed properties and one view computed property. No new SwiftUI state declarations, GeometryReader measurement, lazy store refs, or render-time mutations.
Cmux Architecture Rethink ✅ Passed Fixes regression using proper architecture: re-links providers, pure effectiveProviderId() mapping, cleaner descriptors, ungates UI, restores BrowserStackSidebar refresh—no timing repairs.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR does not add standalone windows/panels/WindowGroup. Changes are sidebar selection logic, project config, documentation, and test files (exempt from rule).
Description check ✅ Passed The PR description comprehensively covers the regression, root cause, fix approach, and testing strategy, exceeding the template requirements.
✨ 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 issue-5173-restore-sidebar-views

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 and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes the v0.64.11 regression (#5173) where right-clicking the sidebar button no longer showed the view-switcher menu and all seven built-in sidebar views were gone on a default install (Extensions beta off). The fix re-links CmuxExtensionSidebarExamples, splits the descriptor list into builtInDescriptors/descriptors/allDescriptors, un-gates the right-click menu, and promotes render(snapshot:) to a protocol requirement to fix existential dispatch.

  • CmuxExtensionSidebarProvider adds render(snapshot:) as a protocol requirement with a default no-op, preventing the silent empty-sidebar bug caused by static dispatch through the any CmuxExtensionSidebarProvider existential.
  • CmuxExtensionSidebarSelection gains a pure effectiveProviderId(_:extensionsEnabled:) function; the Extensions beta now gates only the hosted entry, and the restored allDescriptors set ensures command-palette handlers survive runtime flag flips.
  • Regression tests cover descriptor availability when the beta is off, the full UserDefaults → effectiveProviderId → checkmark roundtrip, and correct existential dispatch for the Super Compact provider.

Confidence Score: 5/5

Safe to merge — the changes are scoped to UserDefaults-driven sidebar selection and menu gating, with no auth or data surface affected.

The fix correctly un-gates the menu and restores built-in providers, effectiveProviderId is a pure function with no side-effects, the existential dispatch bug is resolved by promoting render(snapshot:) to a protocol requirement, and regression tests lock in descriptor availability and the full checkmark-selection roundtrip. No logic errors or dangerous state transitions were found in the changed paths.

No files require special attention.

Important Files Changed

Filename Overview
Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/HostCompatibility/CmuxExtensionSidebarProvider.swift Promotes render(snapshot:) from a protocol-extension default to a protocol requirement with a default implementation, fixing existential dispatch so built-in providers no longer silently render empty sidebars.
Sources/ContentView.swift Restores providers to SidebarExamples.providers, splits descriptor lists into builtInDescriptors/descriptors/allDescriptors, un-gates showMenu and command contributions, adds pure effectiveProviderId, and restores the BrowserStack live-refresh subscription.
cmuxTests/SidebarProviderMenuRegressionTests.swift New regression suite covering built-in view availability when Extensions beta is off, the UserDefaults→effectiveProviderId→checkmark roundtrip, hosted-vs-built-in gating, and existential dispatch correctness.
Examples/CmuxExtensionSidebarExamples/Tests/CmuxExtensionSidebarExamplesTests/SidebarProviderExistentialDispatchTests.swift New package-level tests verifying that Super Compact and other workspace-listing providers render identical rows through the any CmuxExtensionSidebarProvider existential as through a direct call.
cmux.xcodeproj/project.pbxproj Re-links CmuxExtensionSidebarExamples as a framework dependency of the cmux app target and wires SidebarProviderMenuRegressionTests.swift into the test target.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Right-click sidebar button] --> B[showMenu]
    B --> C[Read persisted ID from UserDefaults]
    C --> D[effectiveProviderId\npersisted, extensionsEnabled: isEnabled]
    D -->|hosted + beta OFF| E[defaultProviderId]
    D -->|built-in OR hosted + beta ON| F[persistedProviderId]
    E --> G[descriptor for: effectiveID]
    F --> G
    G --> H[Build NSMenu from descriptors]
    H -->|beta OFF| I[builtInDescriptors\n7 built-in views]
    H -->|beta ON| J[builtInDescriptors\n+ hostedExtensionsDescriptor]
    I --> K[Show menu with checkmark]
    J --> K

    L[VerticalTabsSidebar render] --> M[effectiveExtensionSidebarProviderId\ncomputed property]
    M --> N[effectiveProviderId\nselectedID, extensionsEnabled]
    N -->|hosted + beta OFF| O[Render Default Workspaces]
    N -->|any built-in| P[Render built-in provider via existential]
    N -->|hosted + beta ON| Q[Render CMUXInstalledExtensionSidebarHostView]
Loading

Reviews (3): Last reviewed commit: "Restore render(snapshot:) as a protocol ..." | Re-trigger Greptile

Comment on lines +83 to +96
@Test
func selectedBuiltInViewResolvesToItselfForCheckmark() {
withExtensionsBeta(false) {
for builtInID in Self.builtInViewIDs {
withSelectedProvider(builtInID) {
let active = CmuxExtensionSidebarSelection.descriptor(for: builtInID)
#expect(
active.id == builtInID,
"Selecting \(builtInID) did not resolve to itself (menu checkmark would be wrong)"
)
}
}
}
}

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.

P2 withSelectedProvider wrapper is dead code in this test

CmuxExtensionSidebarSelection.descriptor(for: builtInID) takes the provider ID as a direct parameter and never reads UserDefaults, so the withSelectedProvider(builtInID) setup is never consumed by the assertion. The test therefore doesn't verify the full UserDefaults → effectiveProviderId → descriptor(for:) → .id roundtrip that actually drives the menu checkmark. The assertion is correct for what it does check (that the descriptor lookup returns the right ID), but the withSelectedProvider framing gives a misleading impression of broader coverage.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 4f5d45b. The test now reads the persisted id back from CmuxExtensionSidebarSelection.defaultsKey, resolves it through effectiveProviderId(_:extensionsEnabled:), and asserts the resulting descriptor(for:).id equals the selected view — mirroring showMenu's checkmark logic. The withSelectedProvider scaffolding is now actually consumed, so the full UserDefaults → effectiveProviderId → descriptor(for:) roundtrip is exercised.

— Claude Code

@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 `@cmuxTests/SidebarProviderMenuRegressionTests.swift`:
- Around line 38-46: The test selectedBuiltInViewResolvesToItselfForCheckmark
currently writes a persisted value via withSelectedProvider but then ignores it
by directly calling CmuxExtensionSidebarSelection.descriptor(for: builtInID);
update the test to actually exercise persisted-selection logic by reading the
persisted provider id from CmuxExtensionSidebarSelection.defaultsKey into a
variable (persistedProviderId), computing the resolved id with
effectiveProviderId(persistedProviderId, extensionsEnabled: isEnabled), and
asserting against CmuxExtensionSidebarSelection.descriptor(for: resolvedId);
alternatively remove the dead withSelectedProvider scaffolding if you prefer to
keep the original direct-descriptor assertion.
- Around line 84-96: The test selectedBuiltInViewResolvesToItselfForCheckmark is
writing a persisted selection via withSelectedProvider but then validates using
CmuxExtensionSidebarSelection.descriptor(for:) which does not read UserDefaults;
update the test to mirror the real showMenu path by reading the persisted
provider id (CmuxExtensionSidebarSelection.defaultsKey) then computing the
effective id via effectiveProviderId(..., extensionsEnabled: isEnabled) and
compare that effective selectedProviderId against each descriptor.id (or
alternatively invoke CmuxExtensionSidebarSelection.showMenu and assert each
NSMenuItem.state directly); change references to withSelectedProvider,
CmuxExtensionSidebarSelection.descriptor(for:),
CmuxExtensionSidebarSelection.showMenu, and effectiveProviderId accordingly so
the test verifies the persisted-selection → menu checkmark behavior.
🪄 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: 2c5e7b1c-7e98-4aa6-8b88-760b09fc4b21

📥 Commits

Reviewing files that changed from the base of the PR and between 7fdcf24 and b28a717.

📒 Files selected for processing (3)
  • Sources/ContentView.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/SidebarProviderMenuRegressionTests.swift

Comment thread cmuxTests/SidebarProviderMenuRegressionTests.swift
Comment thread cmuxTests/SidebarProviderMenuRegressionTests.swift Outdated

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread cmuxTests/SidebarProviderMenuRegressionTests.swift Outdated
CodeRabbit, Greptile, and cubic all flagged that the checkmark regression test
wrote a persisted selection via withSelectedProvider but then asserted on
descriptor(for: builtInID) with the id passed directly — never reading
UserDefaults — so it didn't validate the persisted → effectiveProviderId →
descriptor(for:) roundtrip that showMenu actually uses to place the checkmark.

Rewrite it to read the persisted id back from defaultsKey, resolve it through
effectiveProviderId(_:extensionsEnabled:), and assert the resolved descriptor id
is the selected view — mirroring showMenu exactly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
austinywang and others added 2 commits June 2, 2026 01:56
The built-in views rendered empty even with workspaces present: the host
renders each view through an `any CmuxExtensionSidebarProvider` existential
(`provider(for:)?.render(snapshot:)`), and #4994 left `render(snapshot:)` only
as a protocol-extension default — so the call static-dispatched to the empty
default instead of the concrete view.

These tests exercise that exact path and fail without the fix:
- cmuxTests: the host's `provider(for:)?.render(snapshot:)` returns 0 rows.
- CmuxExtensionSidebarExamples: rendering a provider through the existential
  diverges from the concrete call (empty vs populated).

Failing test only — fix follows.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
#4994 demoted CmuxExtensionSidebarProvider.render(snapshot:) from a protocol
requirement to a protocol-extension default returning no sections. Because the
host renders views through an `any CmuxExtensionSidebarProvider` existential, a
method defined only in the extension static-dispatches to that empty default —
so every built-in view (Project Worktrees, Attention Queue, Dev Servers, Last
Prompt, Super Compact, Browser Stack) rendered an empty sidebar.

Restore it as a protocol requirement (keeping the extension default) so the
call dynamic-dispatches to the concrete view via the witness table — matching
v0.64.10. Verified live: Super Compact now renders all 51 workspaces
(sections=1 rows=[51]); the contextual/mutable default render(snapshot:context:)
also routes correctly since it forwards to render(snapshot:).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview – cmux — d27b449a Deployed Jun 2, 2026 by vercel[bot]
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.

Regression (0.64.11): right-click sidebar-button menu with built-in views (Default Workspaces, Project Worktrees, …) is gone

1 participant