Skip to content

Polish sidebar extensions and titlebar chrome#5017

Merged
azooz2003-bit merged 19 commits into
mainfrom
feat-extension-integration-polish
May 30, 2026
Merged

Polish sidebar extensions and titlebar chrome#5017
azooz2003-bit merged 19 commits into
mainfrom
feat-extension-integration-polish

Conversation

@azooz2003-bit
Copy link
Copy Markdown
Contributor

@azooz2003-bit azooz2003-bit commented May 30, 2026

Summary

  • add the sidebar extension SDK and client host path for ExtensionKit sidebar UI extensions
  • tighten sidebar extension permissions so browser actions with URLs require both surface and URL grants
  • improve extension access UI with clearer permission copy, compact limited-access controls, and cleaner empty-state chrome
  • keep the early terminal helper source-compatible with the deprecated overload while blocking input injection
  • update the sample sidebar extension to request current signal scopes and build against the latest SDK
  • restore sidebar/titlebar chrome after the extension merge: native titlebar accessory controls stay beside the traffic lights, the workspace title remains visible above panes, and the title starts to the right of the sidebar divider
  • scope the workspace titlebar overlay to a fixed titlebar band instead of layering it over the whole root view
  • restore sidebar minimum width and shortcut hint sizing to the pre-extension baseline

Verification

  • git diff --check
  • jq empty Resources/Localizable.xcstrings
  • swift test --package-path Packages/CmuxExtensionKit
  • swift test --package-path Packages/CMUXExtensionClient
  • xcodebuild -project Examples/SampleSidebarExtensionApp/SampleSidebarExtensionApp.xcodeproj -scheme CMUXExtKitSampleSidebarApp -configuration Debug -derivedDataPath /tmp/cmux-pr5017-sample CODE_SIGNING_ALLOWED=NO build
  • ./scripts/reload.sh --tag reload-build-guard --swift-frontend-workaround
  • launched reload-build-guard and screenshot-verified the titlebar/title/sidebar placement

Dogfood

Open the tagged build and keep the left sidebar visible. The accessory controls should stay next to the traffic lights, the workspace title should sit in the titlebar band immediately to the right of the sidebar divider, and enabled sidebar extensions should still render through ExtensionKit with their permission review flow.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

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

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment May 30, 2026 10:17pm
cmux-staging Building Building Preview, Comment May 30, 2026 10:17pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

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

SessionPersistencePolicy sidebar minimums lowered to 159. Titlebar accessory layout refactored to use a new visibleContentWidth helper and traffic-light metrics adjusted. Minimal-mode hit-region outer leading padding reduced to 0. CMUX createTerminalSurface signature removed initialInput; host helpers, tests, ContentView extension action URL validation and workspace/surface guards, and responsive sidebar host views updated.

Changes

Sidebar & Titlebar sizing and hit-region changes

Layer / File(s) Summary
Session minimum width constant and related tests
Sources/SessionPersistence.swift, cmuxTests/SidebarWidthPolicyTests.swift
SessionPersistencePolicy.defaultMinimumSidebarWidth and minimumSidebarWidth changed from 190159; tests updated to expect the new persisted/default and clamped values.
Titlebar layout metrics: visibleContentWidth and layout updates
Sources/Update/UpdateTitlebarAccessory.swift, cmuxTests/UpdatePillReleaseVisibilityTests.swift
Added TitlebarControlsLayoutMetrics.visibleContentWidth(config:); contentSize(...) refactored to derive width from it; minimumSidebarWidth(config:), updateSize(), and leadingOffset(...) now use visibleContentWidth; traffic-light gap/cluster constants adjusted; tests updated for new deterministic sizes and minimums.
Minimal-mode hit-region padding adjustment
Sources/Update/MinimalModeSidebarControls.swift
TitlebarControlsHitRegions.outerLeadingPadding changed from 40, altering X-coordinate hit-test ranges for titlebar control slots.

CMUX extension actions and ContentView handlers

Layer / File(s) Summary
CMUX action enum, host helper, and tests
Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CMUXSidebarAction.swift, Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CmuxSidebarHost.swift, Packages/CmuxExtensionKit/Tests/CmuxExtensionKitTests/CmuxExtensionKitTests.swift
CMUXSidebarAction.createTerminalSurface removed the initialInput associated value; CmuxSidebarHost gains createTerminalSurface(in:); tests extended to assert .createTerminalSurface(...) and .createBrowserSurface(...) actions are dispatched.
ContentView: extension action handling and titlebar style change reaction
Sources/ContentView.swift
Added onChange for titlebarControlsStyleRawValue to re-clamp sidebarWidth, refresh resizer state, and resync titlebar controls; handleCMUXSidebarExtensionAction now validates optional/required HTTP(S) URLs (rejecting invalid non-empty inputs), creates terminals with initialInput: nil, uses explicit workspace/surface guards for clearer error results, and opens validated URLs via NSWorkspace.
Installed extension sidebar host: responsive action buttons
Sources/CMUXInstalledExtensionSidebarHostView.swift
Replaced fixed horizontal button layouts with ViewThatFits(in: .horizontal) and extracted button groups into private @ViewBuilder helpers for empty, blocked, and limited-access states.
Surface insight model icon
Examples/SampleSidebarExtensionApp/SampleSidebarExtension/Model/SidebarInsightModel.swift
Added .project surface kind mapping to the "folder" icon name.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ContentView
  participant CmuxSidebarHost
  participant SessionPersistencePolicy
  Client->>ContentView: send extension action (createTerminal/createBrowser/openURL)
  ContentView->>ContentView: validate URL / lookup workspace
  ContentView->>CmuxSidebarHost: dispatch CMUXSidebarAction (createTerminalSurface/createBrowserSurface)
  CmuxSidebarHost->>SessionPersistencePolicy: read minimumSidebarWidth for layout decisions
Loading

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • manaflow-ai/cmux#5013: Both PRs adjust SessionPersistencePolicy sidebar minimum width handling and related titlebar width calculations.
  • manaflow-ai/cmux#4471: Related modifications to titlebar control layout geometry and spacing metrics.
  • manaflow-ai/cmux#4160: Prior changes to session sidebar width constants and SidebarWidthPolicyTests that overlap with this PR's edits.

"🐰 I nudged the sidebar, trimmed it neat,
Counted the pixels where titlebar buttons meet,
Removed a tiny input, checked each URL's trail,
Resized, reflowed, and hopped along the rails —
A tidy hop, a tidy tweak, a happy little seat."


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (4 errors, 2 warnings)

Check name Status Explanation Resolution
Cmux Swift Blocking Runtime ❌ Error PR introduces NSLock protecting Swift concurrency primitives without actor justification, and Task.sleep for timing coordination, violating swift-blocking-runtime.md rules. Replace NSLocks in CmuxSidebarActionReplyGate and MonitorContinuationBox with actors; replace Task.sleep timeouts with Timer or cancellation patterns.
Cmux User-Facing Error Privacy ❌ Error Localized error messages expose internal details: "XPC connection", "manifest", "ExtensionKit host" violate privacy rules against provider implementation details. Use generic terms instead: replace "ExtensionKit host, XPC connection" with service name; remove "XPC", "manifest" from user-facing errors; use "connection" or "configuration" generically.
Cmux Full Internationalization ❌ Error ContentView.swift uses localization keys sidebar.extensions.action.surfaceCreateRejected and sidebar.extensions.action.surfaceNotFound that are missing from Resources/Localizable.xcstrings. Add sidebar.extensions.action.surfaceCreateRejected and sidebar.extensions.action.surfaceNotFound entries to Resources/Localizable.xcstrings with translated values for all supported locales (en, ja).
Cmux Swiftui State Layout ❌ Error New onChange handler mutates @State properties (sidebarWidth, isResizerBandActive) during render, violating swiftui-state-layout.md rule on render-time state writes. Move state mutations from onChange to explicit lifecycle callbacks or event handlers per swiftui-state-layout.md.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.90% 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 lacks required sections. The Summary is present but incomplete; Testing and Demo Video sections are missing. The Checklist is incomplete with all items unchecked. Add Testing section with manual verification steps, include Demo Video URL/attachment for UI changes, and complete the Checklist by checking items that apply to this change.
✅ Passed checks (12 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 PR introduces no actor isolation issues. Changes are UI-bound refactoring, pure enum functions, constants, and enum case simplifications - all permissible per rules.
Cmux No Hacky Sleeps ✅ Passed All PR changes are Swift files. The rule explicitly excludes Swift (scoped to TypeScript/JavaScript/shell/non-Swift build scripts); Swift is covered by separate swift-blocking-runtime rule.
Cmux Algorithmic Complexity ✅ Passed PR has no algorithmic complexity violations. Handler performs single lookups per-action (not in loops), avoiding nested scans on scalable collections per the rules.
Cmux Swift Concurrency ✅ Passed No legacy async patterns. All async code uses modern Swift concurrency patterns (async/await, withTaskCancellationHandler, withCheckedContinuation) and tasks are properly managed.
Cmux Swift @Concurrent ✅ Passed No @concurrent violations. Async functions are @MainActor-constrained or UI-bound. New helper functions are lightweight synchronous validators without @concurrent.
Cmux Swift File And Package Boundaries ✅ Passed PR respects boundaries: no new oversized files, no >250-line additions, coherent responsibilities, package API changes properly isolated, UI refactoring allowed per rules.
Cmux Swift Logging ✅ Passed PR modifications have no logging rule violations. Only debug-guarded NSLog found, which is allowed per swift-logging.md. No unguarded print/NSLog in production code.
Cmux Architecture Rethink ✅ Passed PR contains small correctness fixes with clear state ownership; no new timing/dispatch patterns; API hardening (removing initialInput) improves representability.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR modifies sidebar sizing/layout and action handlers but does not add, remove, or materially change any NSWindow, NSPanel, NSWindowController, SwiftUI Window, or WindowGroup.
Title check ✅ Passed The title accurately summarizes the main changes: polishing sidebar extensions and titlebar chrome components through sizing adjustments and permission hardening.
✨ 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-extension-integration-polish

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
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 30, 2026

Greptile Summary

This PR tightens the ExtensionKit sidebar integration: it enforces per-action permission scopes for URL-bearing browser actions, removes the terminal initialInput injection vector, restores the pre-extension titlebar accessory layout (decoupling titlebar-control positioning from sidebar width), raises the minimum sidebar width to 216 pt, and cleans up the extension permission review UI.

  • Security/scope enforcement: CMUXSidebarAction gains a requiredScopes: Set replacing the single requiredScope, and both the client session and XPC host dispatch now use isSuperset(of:) to require both .createSurface and .openURL for URL-bearing browser and split actions.
  • Titlebar restoration: removes sidebarTrailingEdge tracking and the minimumSidebarWidth(config:) coupling; workspaceTitlebarBand is now a declarative SwiftUI overlay at zIndex(100) whose title leading-padding follows sidebarWidth directly.
  • Shell script hardening: reload.sh gains pre-build artifact cleanup, post-interrupted-build detection via BUILD INTERRUPTED log scanning, atomic staging-path rename for tagged app copies, validate_app_bundle, and a --swift-frontend-workaround flag for arm64 batch-mode spins.

Confidence Score: 5/5

All changes are well-scoped and safe to merge; the security improvements are correctly implemented and thoroughly tested.

The multi-scope enforcement for URL-bearing browser actions is implemented consistently at both the client session layer and the XPC host dispatch layer, with dedicated unit tests for each. The titlebar decoupling removes fragile imperative sync calls in favor of a declarative SwiftUI overlay — simpler than what it replaces with updated tests pinning the new constants. The reload.sh artifact cleanup correctly leverages set -euo pipefail and the INTERRUPTED log scan closes the gap noted in the PR description.

No files require special attention.

Important Files Changed

Filename Overview
Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CMUXSidebarAction.swift Adds requiredScopes: Set computed property; URL-bearing createBrowserSurface and splitBrowser now require both .createSurface and .openURL. Old requiredScope retained for source compatibility.
Packages/CMUXExtensionClient/Sources/CMUXExtensionClient/Session/CMUXSidebarExtensionSession.swift Guard updated from grantedActionScopes.contains(action.requiredScope) to grantedActionScopes.isSuperset(of: action.requiredScopes), correctly enforcing multi-scope requirements.
Sources/ContentView.swift Removes sidebar-trailing-edge sync machinery; replaces inline titlebar overlay with workspaceTitlebarBand at zIndex 100; sidebar minimum width is now purely policy-driven. Adds onChange for titlebarControlsStyleRawValue to clamp sidebar width on style changes.
Sources/Update/UpdateTitlebarAccessory.swift Removes sidebarTrailingEdgesByWindow, updateSidebarTrailingEdge, and setSidebarTrailingEdge; simplifies leadingOffset to depend only on traffic-light frame; hint insets and button-row width updated to match new layout baseline.
Sources/CMUXInstalledExtensionSidebarHostView.swift Permission rows now include plain-language detail text; blocked/empty-state action buttons wrapped in ViewThatFits for responsive layout; Limited affordance promoted from icon to tappable bordered button; error copy de-technified.
scripts/reload.sh Adds validate_app_bundle, BUILD INTERRUPTED detection, atomic staging-path rename, pre-build artifact cleanup, and --swift-frontend-workaround flag. No new sleeps or polling introduced.
Resources/Localizable.xcstrings Adds surfaceCreateRejected, surfaceNotFound, and statusLimited keys (en+ja, consistent with all existing sidebar extension strings). Seven manifest-to-configuration string updates across en and ja.

Reviews (14): Last reviewed commit: "Scope workspace titlebar overlay to chro..." | Re-trigger Greptile

Comment on lines +2016 to +2017
let contentSize = TitlebarControlsLayoutMetrics.contentSize(config: style.config)
let visibleContentWidth = TitlebarControlsLayoutMetrics.visibleContentWidth(config: style.config)
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 visibleContentWidth is computed twice per updateSize() call — once inside contentSize(config:) (which calls visibleContentWidth internally) and once again as a separate local. Since this is not a hot path the impact is negligible, but the redundancy is easy to eliminate by computing visibleContentWidth first and threading it into contentSize.

Suggested change
let contentSize = TitlebarControlsLayoutMetrics.contentSize(config: style.config)
let visibleContentWidth = TitlebarControlsLayoutMetrics.visibleContentWidth(config: style.config)
let visibleContentWidth = TitlebarControlsLayoutMetrics.visibleContentWidth(config: style.config)
let contentSize = TitlebarControlsLayoutMetrics.contentSize(config: style.config)

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

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmuxTests/SidebarWidthPolicyTests.swift (1)

11-114: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoff

Consider converting to Swift Testing when touching XCTest tests.

Per coding guidelines, when touching an existing XCTest test, convert in place: XCTestCase subclass becomes @Suite struct; test methods become @Test functions; XCTAssertEqual(a, b) becomes #expect(a == b).

While the changes here are minimal (updating 3 numeric literals), the guideline is clear about converting when touching XCTest tests. However, given that this PR only updates literal values to match constant changes, a full framework conversion would significantly expand scope.

Consider either:

  1. Converting just the two touched test methods to Swift Testing (if feasible with partial migration), or
  2. Deferring the conversion to a separate refactoring effort focused on test framework migration.

As per coding guidelines: "When touching an existing XCTest test, convert in place: XCTestCase subclass becomes @Suite struct; func testFoo() becomes @Test func foo(); XCTAssertEqual(a, b) becomes #expect(a == b)".

🤖 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 `@cmuxTests/SidebarWidthPolicyTests.swift` around lines 11 - 114, The test file
still uses XCTest; convert the XCTest-based SidebarWidthPolicyTests to Swift
Testing by changing the XCTestCase subclass (SidebarWidthPolicyTests) into an
`@Suite` struct, convert each test method (e.g.,
testDefaultMinimumSidebarWidthIsPersistedProductDefault,
testContentViewClampKeepsMinimumSidebarWidth,
testContentViewClampCanUseSmallerConfiguredMinimumSidebarWidth, etc.) into `@Test`
functions, and replace XCTest assertions: XCTAssertEqual(...) -> `#expect`(... ==
...), XCTAssertTrue(...) -> `#expect`(...), and XCTAssertFalse(...) -> `#expect`(!(
... )). Update any setup/teardown or UserDefaults usage to work inside the `@Test`
functions as needed so the semantics remain identical.
🤖 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.

Outside diff comments:
In `@cmuxTests/SidebarWidthPolicyTests.swift`:
- Around line 11-114: The test file still uses XCTest; convert the XCTest-based
SidebarWidthPolicyTests to Swift Testing by changing the XCTestCase subclass
(SidebarWidthPolicyTests) into an `@Suite` struct, convert each test method (e.g.,
testDefaultMinimumSidebarWidthIsPersistedProductDefault,
testContentViewClampKeepsMinimumSidebarWidth,
testContentViewClampCanUseSmallerConfiguredMinimumSidebarWidth, etc.) into `@Test`
functions, and replace XCTest assertions: XCTAssertEqual(...) -> `#expect`(... ==
...), XCTAssertTrue(...) -> `#expect`(...), and XCTAssertFalse(...) -> `#expect`(!(
... )). Update any setup/teardown or UserDefaults usage to work inside the `@Test`
functions as needed so the semantics remain identical.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f1fba00f-e966-4f4c-ac89-1cacc84df2bd

📥 Commits

Reviewing files that changed from the base of the PR and between 5dac49f and d25e768.

📒 Files selected for processing (3)
  • Sources/SessionPersistence.swift
  • Sources/Update/UpdateTitlebarAccessory.swift
  • cmuxTests/SidebarWidthPolicyTests.swift

coderabbitai[bot]
coderabbitai Bot previously requested changes May 30, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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/SidebarWidthPolicyTests.swift`:
- Around line 19-24: The tests in SidebarWidthPolicyTests.swift still use
XCTestCase and XCTAssert-style APIs; convert the XCTestCase subclass
(SidebarWidthPolicyTests) into an in-place `@Suite` struct, change each func
test...() into `@Test` func <name>() and replace XCTAssertEqual / other XCTest
assertions with Swift Testing expectations (e.g. XCTAssertEqual(...) ->
`#expect`(actual).toEqual(expected) or try `#require`(...) where appropriate);
update imports if needed (remove XCTest, add import SwiftTesting) and ensure any
setup/teardown methods are converted to `@Before/`@After or equivalent Swift
Testing hooks.

In `@Sources/ContentView.swift`:
- Around line 11133-11140: The function cmuxSidebarExtensionRequiredHTTPURL
currently accepts opaque HTTP(S) strings because it only checks the scheme;
change it to parse the URL into URLComponents (e.g., URLComponents(url: url,
resolvingAgainstBaseURL: false)) and require a non-empty host
(components.host?.isEmpty == false) before returning the URL; otherwise return
nil—this ensures opaque URLs like "https:example.com" are rejected.

In `@Sources/SessionPersistence.swift`:
- Around line 18-19: The constants defaultMinimumSidebarWidth and
minimumSidebarWidth in SessionPersistence.swift are currently set to 171 but
should reflect the PR objective of a 180px minimum; update both static let
defaultMinimumSidebarWidth and static let minimumSidebarWidth to 180 so the
default and enforced minimum match the intended 180 value.
🪄 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: a60b4c4c-b9b7-4719-88b9-5fbbcc675adc

📥 Commits

Reviewing files that changed from the base of the PR and between be98620 and 71f72e3.

📒 Files selected for processing (6)
  • Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CMUXSidebarAction.swift
  • Packages/CmuxExtensionKit/Sources/CmuxExtensionKit/Sidebar/CmuxSidebarHost.swift
  • Packages/CmuxExtensionKit/Tests/CmuxExtensionKitTests/CmuxExtensionKitTests.swift
  • Sources/ContentView.swift
  • Sources/SessionPersistence.swift
  • cmuxTests/SidebarWidthPolicyTests.swift

Comment thread cmuxTests/SidebarWidthPolicyTests.swift Outdated
Comment on lines +19 to +24
171,
accuracy: 0.001
)
XCTAssertEqual(
SessionPersistencePolicy.resolvedMinimumSidebarWidth(defaults: defaults),
190,
171,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift

Convert touched XCTest tests to Swift Testing per repo policy.

This file is modified but still uses XCTestCase. The repo rule requires in-place migration when touching existing XCTest tests (unless UI tests).

As per coding guidelines: “When touching an existing XCTest test, convert in place: XCTestCase subclass becomes @Suite struct; func testFoo() becomes @Test func foo(); XCTAssert... becomes #expect(...) / try #require(...).”

Also applies to: 31-31

🤖 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 `@cmuxTests/SidebarWidthPolicyTests.swift` around lines 19 - 24, The tests in
SidebarWidthPolicyTests.swift still use XCTestCase and XCTAssert-style APIs;
convert the XCTestCase subclass (SidebarWidthPolicyTests) into an in-place
`@Suite` struct, change each func test...() into `@Test` func <name>() and replace
XCTAssertEqual / other XCTest assertions with Swift Testing expectations (e.g.
XCTAssertEqual(...) -> `#expect`(actual).toEqual(expected) or try `#require`(...)
where appropriate); update imports if needed (remove XCTest, add import
SwiftTesting) and ensure any setup/teardown methods are converted to
`@Before/`@After or equivalent Swift Testing hooks.

Comment thread Sources/ContentView.swift
Comment thread Sources/SessionPersistence.swift Outdated
Comment on lines +18 to +19
static let defaultMinimumSidebarWidth: Double = 171
static let minimumSidebarWidth: Double = 171
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Minimum width constant does not match the stated product target.

Lines 18–19 set the minimum to 171, but this PR’s objective says the default minimum should be reduced to 180 (from 190). This changes behavior more than intended and will clamp narrower than specified.

Proposed fix
-    static let defaultMinimumSidebarWidth: Double = 171
-    static let minimumSidebarWidth: Double = 171
+    static let defaultMinimumSidebarWidth: Double = 180
+    static let minimumSidebarWidth: Double = 180
🤖 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/SessionPersistence.swift` around lines 18 - 19, The constants
defaultMinimumSidebarWidth and minimumSidebarWidth in SessionPersistence.swift
are currently set to 171 but should reflect the PR objective of a 180px minimum;
update both static let defaultMinimumSidebarWidth and static let
minimumSidebarWidth to 180 so the default and enforced minimum match the
intended 180 value.

coderabbitai[bot]
coderabbitai Bot previously requested changes May 30, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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/CMUXInstalledExtensionSidebarHostView.swift`:
- Around line 705-709: The limitedAccessActionButtons function currently accepts
identity: AppExtensionIdentity? but then calls
keepLimitedAccess(identity:effectiveGrant:) which requires a non-optional
AppExtensionIdentity; fix by either changing limitedAccessActionButtons
signature to accept a non-optional AppExtensionIdentity (AppExtensionIdentity)
and update all call sites, or safely unwrap the optional inside
limitedAccessActionButtons (e.g., guard let identity = identity else {
disable/hide the “Keep Limited” button or return } ) and then call
keepLimitedAccess(identity: identity, effectiveGrant: effectiveGrant); ensure
only the non-optional identity is passed to
keepLimitedAccess(identity:effectiveGrant:).
🪄 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: 23bbdaca-68a5-4b22-b87f-4744d71fc3ce

📥 Commits

Reviewing files that changed from the base of the PR and between 71f72e3 and 14c5900.

📒 Files selected for processing (3)
  • Examples/SampleSidebarExtensionApp/SampleSidebarExtension/Model/SidebarInsightModel.swift
  • Sources/CMUXInstalledExtensionSidebarHostView.swift
  • Sources/ContentView.swift

Comment thread Sources/CMUXInstalledExtensionSidebarHostView.swift
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
Sources/SessionPersistence.swift (1)

18-19: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Sidebar minimum constants are below the PR’s stated product target.

Line 18 and Line 19 set the persisted/default floor to 159, but this PR’s objective says the product minimum should be 171 pt. That will clamp sidebars narrower than intended and makes the updated tests codify the wrong floor.

Proposed fix
-    static let defaultMinimumSidebarWidth: Double = 159
-    static let minimumSidebarWidth: Double = 159
+    static let defaultMinimumSidebarWidth: Double = 171
+    static let minimumSidebarWidth: Double = 171
🤖 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/SessionPersistence.swift` around lines 18 - 19, The persisted/default
minimum sidebar width constants in SessionPersistence.swift are still set to
159; update both static let defaultMinimumSidebarWidth and static let
minimumSidebarWidth to 171 (the PR’s specified product minimum) so the app and
tests use the correct 171 pt floor when clamping sidebar widths.
🤖 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.

Duplicate comments:
In `@Sources/SessionPersistence.swift`:
- Around line 18-19: The persisted/default minimum sidebar width constants in
SessionPersistence.swift are still set to 159; update both static let
defaultMinimumSidebarWidth and static let minimumSidebarWidth to 171 (the PR’s
specified product minimum) so the app and tests use the correct 171 pt floor
when clamping sidebar widths.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6b343bbe-56e6-454e-a94d-8d86cc583256

📥 Commits

Reviewing files that changed from the base of the PR and between 14c5900 and 94d8e66.

📒 Files selected for processing (5)
  • Sources/CMUXInstalledExtensionSidebarHostView.swift
  • Sources/SessionPersistence.swift
  • Sources/Update/UpdateTitlebarAccessory.swift
  • cmuxTests/SidebarWidthPolicyTests.swift
  • cmuxTests/UpdatePillReleaseVisibilityTests.swift

@azooz2003-bit azooz2003-bit changed the title Tighten sidebar titlebar control width Polish sidebar extensions and titlebar chrome May 30, 2026
@azooz2003-bit azooz2003-bit dismissed stale reviews from coderabbitai[bot] and coderabbitai[bot] May 30, 2026 23:11

Dismissed per maintainer instruction: CodeRabbit feedback is non-blocking for this PR after CI and dogfood approval.

@azooz2003-bit azooz2003-bit merged commit ca73d65 into main May 30, 2026
18 checks passed
@azooz2003-bit azooz2003-bit deleted the feat-extension-integration-polish branch May 30, 2026 23:11
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