Skip to content

Add option to hide sidebar workspace close button - #6985

Closed
austinywang wants to merge 17 commits into
mainfrom
issue-5635-feature-request-option-to-hide-the-sidebar-wo
Closed

austinywang wants to merge 17 commits into
mainfrom
issue-5635-feature-request-option-to-hide-the-sidebar-wo

Conversation

@austinywang

@austinywang austinywang commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #5635

Summary

  • Add sidebar.hideWorkspaceCloseButton to the settings catalog, cmux.json schema/parser/template, Settings > Sidebar, settings search, and command palette toggles.
  • Skip rendering the sidebar workspace close button when enabled so it does not reserve title width.
  • Add focused coverage for defaults, cmux.json parsing, snapshot reads, Settings search anchors, and command-palette toggling.

Testing

  • git diff --check
  • jq empty Resources/Localizable.xcstrings web/messages/*.json web/data/cmux.schema.json
  • python3 scripts/swift_file_length_budget.py --budget .github/swift-file-length-budget.tsv
  • python3 scripts/check-workspace-package-groups.py --check
  • python3 scripts/check-package-resolved-policy.py
  • ./scripts/lint-pbxproj-test-wiring.sh
  • scripts/check-pbxproj.sh
  • skills/cmux-settings/scripts/cmux-settings list-supported | rg '^sidebar\\.(hideWorkspaceCloseButton|wrapWorkspaceTitles|hideAllDetails)$'
  • swift test in Packages/macOS/CmuxSettings
  • swift test in Packages/macOS/CmuxSettingsUI

No dev app build or launch was run per this issue task's instruction.

Demo Video

Not recorded. This change is an opt-in settings/layout behavior, and this run is explicitly constrained not to launch a dev app.

Review Trigger

Please review the current PR head, including the full localization update for all app and web locales.

Checklist

  • Issue linked with Fixes #5635
  • Default behavior remains unchanged
  • New setting is exposed through Settings, cmux.json, search, and command palette
  • Localization audit completed for app and web message catalogs
  • Tests and repository validation run where allowed by task constraints

Summary by CodeRabbit

  • New Features
    • Added a new Sidebar option to hide the per-workspace close button.
    • Exposed the setting in the Command Palette, settings search, and searchable navigation.
  • Bug Fixes
    • When enabled, the workspace close button is no longer shown in the sidebar tab UI, reclaiming space for workspace titles.
  • Tests
    • Added/extended tests for default values, Command Palette toggle behavior, and settings import/JSON handling.
  • Documentation
    • Updated schema/help text and added localized strings for all supported languages.

@vercel

vercel Bot commented Jun 26, 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 Jul 5, 2026 4:30am
cmux-staging Building Building Preview, Comment Jul 5, 2026 4:30am

@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@austinywang, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: eafce466-2a01-455a-a05e-04eaed3e2874

📥 Commits

Reviewing files that changed from the base of the PR and between d712bb7 and 346321f.

⛔ Files ignored due to path filters (1)
  • .github/swift-file-length-budget.tsv is excluded by !**/*.tsv
📒 Files selected for processing (11)
  • Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry+Default.swift
  • Packages/macOS/CmuxSettingsUI/Tests/CmuxSettingsUITests/SettingsRowAnchorResolutionTests.swift
  • Resources/Localizable.xcstrings
  • Sources/CmuxSettingsJSONPathSupport.swift
  • Sources/CommandPalette/CommandPaletteSettingsToggle.swift
  • Sources/CommandPalette/CommandPaletteSidebarSettingsToggles.swift
  • Sources/ContentView.swift
  • Sources/KeyboardShortcutSettingsFileStore+Template.swift
  • Sources/SettingsNavigation.swift
  • Sources/SettingsSearchAliases.swift
  • cmux.xcodeproj/project.pbxproj
📝 Walkthrough

Walkthrough

Adds a new sidebar setting to hide the workspace close button, wiring it through defaults, settings UI, search/navigation, command palette toggles, localization, persistence, and rendering.

Changes

Sidebar close-button setting

Layer / File(s) Summary
Setting contract and discovery
Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/SidebarCatalogSection.swift, Sources/CmuxSettingsJSONPathSupport.swift, Sources/KeyboardShortcutSettingsFileStore+Template.swift, web/data/cmux.schema.json, web/messages/*.json, Resources/Localizable.xcstrings, Sources/SettingsNavigation.swift, Sources/SettingsSearchAliases.swift, Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Navigation/CuratedSettingEntry+Default.swift, skills/cmux-settings/*, Packages/macOS/CmuxSettings/Tests/CmuxSettingsTests/UserDefaultsSettingsClientTests.swift, Packages/macOS/CmuxSettingsUI/Tests/CmuxSettingsUITests/SettingsRowAnchorResolutionTests.swift
Adds the sidebar.hideWorkspaceCloseButton setting, its JSON/default/template/schema/localization/search entries, and validation for default values and anchor resolution.
Sidebar UI and rendering
Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/SidebarSection.swift, Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/SidebarWorkspaceCloseButtonSettingsRow.swift, Sources/ContentView.swift, cmuxTests/SidebarHideWorkspaceCloseButtonTests.swift, cmux.xcodeproj/project.pbxproj
Adds the sidebar settings row, stores and observes the new model, and skips mounting the workspace close button when the setting is enabled; includes snapshot and settings-file tests.
Command palette toggles
Sources/CommandPalette/CommandPaletteSidebarSettingsToggles.swift, Sources/CommandPalette/CommandPaletteSettingsToggle.swift, cmuxTests/CommandPaletteSettingsToggleTests.swift, cmux.xcodeproj/project.pbxproj
Extracts sidebar toggle descriptors into a helper and adds command-palette test coverage for the new toggle.

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

Possibly related PRs

  • manaflow-ai/cmux#7117: Both PRs touch sidebar workspace-row close-button behavior in Sources/ContentView.swift.

Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux No Ambient Global State ❌ Error CommandPaletteSettingsToggleCommands.sidebarDescriptors adds ambient static API on a caseless namespace enum in Sources/CommandPalette/CommandPaletteSidebarSettingsToggles.swift. Move the sidebar descriptor assembly onto a constructable factory/builder type and inject it from ContentView or another app seam; keep only private file-scope helpers.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (23 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely matches the feature: adding an option to hide the sidebar workspace close button.
Description check ✅ Passed The PR description covers summary, testing, demo video note, review trigger, and checklist, matching the repository template well.
Linked Issues check ✅ Passed The changes satisfy #5635 by adding the opt-in setting, sidebar toggle, cmux.json support, and layout gating so the button is not rendered or reserved.
Out of Scope Changes check ✅ Passed No clear unrelated code changes are present; the descriptor refactor, localization updates, and tests all support the new sidebar hide-button feature.
Cmux Swift Actor Isolation ✅ Passed New setting state stays in @MainActor SwiftUI views/stores; no new unsafe Sendable refs or background UI access were introduced.
Cmux Swift Blocking Runtime ✅ Passed Changed Swift files only add setting plumbing/UI; no new semaphores, sleeps, sync waits, polling, or locks appear in the feature or tests.
Cmux Browser Automation Off-Main ✅ Passed PR changes only settings/UI/localization files; no browser-automation router files or browser.* command routing were touched.
Cmux Expensive Synchronous Load ✅ Passed No new RestorableAgentSessionIndex.load() or large JSON/IO loads were added in the touched Swift paths; this PR only wires a new sidebar setting and toggle, with existing cold-cache fallbacks unc...
Cmux Cache Substitution Correctness ✅ Passed The new sidebar settings snapshot reads UserDefaults directly and refreshes on UserDefaults.didChangeNotification, so there’s no stale cache substitution in a persistence/snapshot path.
Cmux No Hacky Sleeps ✅ Passed No changed TS/JS/shell/build-runtime files; the PR touches Swift, JSON, and docs only, so the no-hacky-sleeps rule isn’t triggered.
Cmux Algorithmic Complexity ✅ Passed PASS: The PR only adds O(1) gates and fixed-size arrays (e.g. sidebarDescriptors/startObservingSettings); no nested scans or scalable rescans were introduced.
Cmux Swift Concurrency ✅ Passed The new setting/UI/search wiring is synchronous; no new Dispatch/Combine/completion-handler patterns or unmanaged Tasks were introduced in the changed code.
Cmux Swift @Concurrent ✅ Passed Touched Swift files add only synchronous settings/UI code; no new @concurrent or nonisolated async work appears in the diff.
Cmux Swift File And Package Boundaries ✅ Passed Touched files are small UI/settings glue: new 18-line row, 499-line SidebarSection, and a tiny gate in the existing 16k-line ContentView; no boundary violation.
Cmux Swiftpm Lockfiles ✅ Passed Diff only updates vendored submodule gitlinks (ghostty, vendor/bonsplit); no cmux-owned Package.resolved or .gitignore policy changes were present.
Cmux Swift Logging ✅ Passed The changed Swift files add no print/debugPrint/dump/NSLog, no new Logger constants, and no ad hoc stdout/file logging.
Cmux User-Facing Error Privacy ✅ Passed The diff adds only settings, localization, and help text; I found no new user-facing errors/alerts or exposed provider/internal details.
Cmux Full Internationalization ✅ Passed New Swift UI text uses localized APIs; Localizable.xcstrings covers all 20 locales, and web schema copy exists in every routing locale/message file.
Cmux Swiftui State Layout ✅ Passed The new sidebar setting uses @Observable DefaultsValueModel with @State, and the diff adds no new GeometryReader or render-time state writes.
Cmux Architecture Rethink ✅ Passed Small invariant-preserving fix: the new bool lives in the existing settings catalog and is read by SidebarTabItemSettingsSnapshot; no new timing or split-owner pattern.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR only adds sidebar settings/UI; no new WindowGroup/NSPanel/NSWindowController or cmuxAuxiliaryWindowIdentifiers changes appear in touched files, so the rule doesn't apply.
Cmux Source Artifacts ✅ Passed Changed paths are intentional submodule bumps (ghostty, vendor/bonsplit); no temp/build/log/artifact paths appear, and repo rules allow intentional source/config/docs/submodule content.
Cmux No Test Or Debug Seam In Production Source ✅ Passed Touched Sources files only add normal settings plumbing and a visibility gate; no new #if DEBUG/test-only members or ForTesting-style seams were added.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-5635-feature-request-option-to-hide-the-sidebar-wo

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a new sidebar.hideWorkspaceCloseButton setting that, when enabled, removes the per-workspace close button from the sidebar entirely so workspace titles can use the reclaimed width. The change is end-to-end: settings catalog, SwiftUI UI row, cmux.json schema/parser/template, Settings search and command-palette toggles, and full localization across all 20 app and web locales.

  • Core behavior: TabItemView now gates the close button on canCloseWorkspace && !settings.hidesWorkspaceCloseButton; in the default-off state the existing opacity-based hover animation is unchanged, and when enabled the button is removed from the view tree rather than toggled via opacity, correctly reclaiming its reserved layout width.
  • Refactoring: Sidebar command-palette toggles were extracted from the large CommandPaletteSettingsToggle.swift into a new dedicated CommandPaletteSidebarSettingsToggles.swift struct, keeping the main file focused.
  • Coverage: All three new localized string keys (title, subtitle, search alias) are translated for all 20 supported app locales and the JSON schema description is covered across all 20 web message files.

Confidence Score: 5/5

Safe to merge — the change is a fully opt-in boolean setting with a false default that leaves all existing behavior unchanged.

The implementation threads the new setting through every required layer (catalog, UI, JSON parser, template, search, command palette) with no gaps. Localization is complete across all 20 app and web locales. The layout change is intentional and correct: removing the button from the view tree when disabled reclaims width exactly as described. Tests cover the default value and the cmux.json round-trip. No actor isolation, blocking primitive, or architectural concerns were found.

No files require special attention.

Important Files Changed

Filename Overview
Sources/ContentView.swift Adds hidesWorkspaceCloseButton to the settings snapshot struct and changes the close button condition from canCloseWorkspace to canCloseWorkspace && !settings.hidesWorkspaceCloseButton, correctly removing it from the view hierarchy (reclaiming width) when the setting is enabled; opacity-based hover animation is unaffected in the default path.
Sources/CommandPalette/CommandPaletteSidebarSettingsToggles.swift New file extracting sidebar command-palette toggles from the monolithic CommandPaletteSettingsToggle.swift; properly Sendable, includes the new hideWorkspaceCloseButtonInSidebar toggle in the correct position.
Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/SidebarWorkspaceCloseButtonSettingsRow.swift New 18-line @mainactor SwiftUI view component using the same SettingsCardRow/DefaultsValueModel pattern as all other sidebar setting rows; localized strings reference matching xcstrings entries.
Packages/macOS/CmuxSettings/Sources/CmuxSettings/Keys/SidebarCatalogSection.swift Adds hideWorkspaceCloseButton key with correct id, defaultValue (false), and userDefaultsKey, consistent with all sibling keys in the section.
Sources/CmuxSettingsJSONPathSupport.swift Adds hideWorkspaceCloseButton to SidebarSettingsFileMapping and to the command-palette supported-keys list; consistent ordering and correct userDefaultsKey reference.
Resources/Localizable.xcstrings Adds translations for all three new string keys (hideWorkspaceCloseButton, hideWorkspaceCloseButton.subtitle, and the search alias) across all 20 supported app locales (ar, bs, da, de, en, es, fr, it, ja, km, ko, nb, pl, pt-BR, ru, th, tr, uk, zh-Hans, zh-Hant).
cmuxTests/SidebarHideWorkspaceCloseButtonTests.swift New test file with two suites: snapshot default assertion and cmux.json round-trip parse test using temporary UserDefaults suites and temp directories.
web/data/cmux.schema.json Adds hideWorkspaceCloseButton boolean field with correct default (false) and descriptionKey pointing to the web i18n path; placed in order between wrapWorkspaceTitles and showWorkspaceDescription.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User toggles sidebar.hideWorkspaceCloseButton] --> B{Setting source}
    B -->|Settings UI| C[SidebarWorkspaceCloseButtonSettingsRow\nDefaultsValueModel write]
    B -->|cmux.json| D[CmuxSettingsFileStore\nSidebarSettingsFileMapping]
    B -->|Command Palette| E[CommandPaletteSidebarSettingsToggles\nhideWorkspaceCloseButtonInSidebar]
    C --> F[UserDefaults: sidebarHideWorkspaceCloseButton]
    D --> F
    E --> F
    F --> G[SidebarTabItemSettingsSnapshot\nhidesWorkspaceCloseButton: Bool]
    G --> H{TabItemView render}
    H -->|false default| I[Close button rendered\nwidth reserved, opacity-toggled on hover]
    H -->|true| J[Close button omitted\nwidth reclaimed for title]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User toggles sidebar.hideWorkspaceCloseButton] --> B{Setting source}
    B -->|Settings UI| C[SidebarWorkspaceCloseButtonSettingsRow\nDefaultsValueModel write]
    B -->|cmux.json| D[CmuxSettingsFileStore\nSidebarSettingsFileMapping]
    B -->|Command Palette| E[CommandPaletteSidebarSettingsToggles\nhideWorkspaceCloseButtonInSidebar]
    C --> F[UserDefaults: sidebarHideWorkspaceCloseButton]
    D --> F
    E --> F
    F --> G[SidebarTabItemSettingsSnapshot\nhidesWorkspaceCloseButton: Bool]
    G --> H{TabItemView render}
    H -->|false default| I[Close button rendered\nwidth reserved, opacity-toggled on hover]
    H -->|true| J[Close button omitted\nwidth reclaimed for title]
Loading

Reviews (17): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

cmux added 2 commits June 28, 2026 20:21
…quest-option-to-hide-the-sidebar-wo

# Conflicts:
#	Resources/Localizable.xcstrings

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

12515-12615: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Remove the timer-based drag teardown path.

This new DispatchSourceTimer turns drag cleanup into timing-based synchronization. The repo rules explicitly ban timers/delayed dispatch as repair paths in production Swift, and this will keep the drag lifecycle race-prone instead of making ownership explicit.

🤖 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 12515 - 12615, The drag teardown
logic currently relies on a DispatchSourceTimer in the failsafe helper, which
violates the no-timers/no-delayed-dispatch rule for production synchronization.
Remove the timer-based path from the Sidebar drag cleanup flow by eliminating
the delayed scheduling in requestClearSoon(reason:) and the
pendingClearTimer/pendingClearGeneration mechanism, then make
start(onRequestClear:) and the event monitors trigger cleanup directly through
explicit ownership/state transitions instead of time-based cancellation.

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/ContentView.swift`:
- Around line 12094-12351: The workspace reorder/drop logic in ContentView is
too large and should be moved out of the view file. Extract the overlay wiring
and drag/drop flow from workspaceReorderDropOverlay,
activateSidebarWorkspaceDragIfNeeded, updateWorkspaceReorderDrop,
performWorkspaceReorderDrop, workspaceReorderPlan, performWorkspaceReorderPlan,
performCrossWindowWorkspaceDrop, clampedCrossWindowTopLevelSlot,
crossWindowTopLevelWorkspaceIds, crossWindowTopLevelPinnedWorkspaceIds,
crossWindowRawInsertIndex, and syncSidebarSelectionAfterWorkspaceReorder into a
dedicated helper/service so the view only delegates to it. Keep the behavior the
same, but give the extracted type a clear API that the view can call for
planning, applying, and clearing reorder drops.

---

Outside diff comments:
In `@Sources/ContentView.swift`:
- Around line 12515-12615: The drag teardown logic currently relies on a
DispatchSourceTimer in the failsafe helper, which violates the
no-timers/no-delayed-dispatch rule for production synchronization. Remove the
timer-based path from the Sidebar drag cleanup flow by eliminating the delayed
scheduling in requestClearSoon(reason:) and the
pendingClearTimer/pendingClearGeneration mechanism, then make
start(onRequestClear:) and the event monitors trigger cleanup directly through
explicit ownership/state transitions instead of time-based cancellation.
🪄 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: 0cc82e84-7518-425f-8157-62e08f1fa8f7

📥 Commits

Reviewing files that changed from the base of the PR and between e883409 and e5ace41.

⛔ Files ignored due to path filters (1)
  • .github/swift-file-length-budget.tsv is excluded by !**/*.tsv
📒 Files selected for processing (21)
  • Resources/Localizable.xcstrings
  • Sources/ContentView.swift
  • cmux.xcodeproj/project.pbxproj
  • web/messages/ar.json
  • web/messages/bs.json
  • web/messages/da.json
  • web/messages/de.json
  • web/messages/es.json
  • web/messages/fr.json
  • web/messages/it.json
  • web/messages/km.json
  • web/messages/ko.json
  • web/messages/no.json
  • web/messages/pl.json
  • web/messages/pt-BR.json
  • web/messages/ru.json
  • web/messages/th.json
  • web/messages/tr.json
  • web/messages/uk.json
  • web/messages/zh-CN.json
  • web/messages/zh-TW.json
💤 Files with no reviewable changes (20)
  • web/messages/pt-BR.json
  • web/messages/zh-CN.json
  • web/messages/pl.json
  • web/messages/it.json
  • web/messages/es.json
  • web/messages/da.json
  • web/messages/zh-TW.json
  • web/messages/fr.json
  • web/messages/ko.json
  • web/messages/ru.json
  • web/messages/bs.json
  • web/messages/km.json
  • web/messages/tr.json
  • web/messages/uk.json
  • web/messages/th.json
  • web/messages/no.json
  • Resources/Localizable.xcstrings
  • web/messages/ar.json
  • web/messages/de.json
  • cmux.xcodeproj/project.pbxproj

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

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)

12515-12615: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Remove the timer-based drag teardown path.

This new DispatchSourceTimer turns drag cleanup into timing-based synchronization. The repo rules explicitly ban timers/delayed dispatch as repair paths in production Swift, and this will keep the drag lifecycle race-prone instead of making ownership explicit.

🤖 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 12515 - 12615, The drag teardown
logic currently relies on a DispatchSourceTimer in the failsafe helper, which
violates the no-timers/no-delayed-dispatch rule for production synchronization.
Remove the timer-based path from the Sidebar drag cleanup flow by eliminating
the delayed scheduling in requestClearSoon(reason:) and the
pendingClearTimer/pendingClearGeneration mechanism, then make
start(onRequestClear:) and the event monitors trigger cleanup directly through
explicit ownership/state transitions instead of time-based cancellation.

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/ContentView.swift`:
- Around line 12094-12351: The workspace reorder/drop logic in ContentView is
too large and should be moved out of the view file. Extract the overlay wiring
and drag/drop flow from workspaceReorderDropOverlay,
activateSidebarWorkspaceDragIfNeeded, updateWorkspaceReorderDrop,
performWorkspaceReorderDrop, workspaceReorderPlan, performWorkspaceReorderPlan,
performCrossWindowWorkspaceDrop, clampedCrossWindowTopLevelSlot,
crossWindowTopLevelWorkspaceIds, crossWindowTopLevelPinnedWorkspaceIds,
crossWindowRawInsertIndex, and syncSidebarSelectionAfterWorkspaceReorder into a
dedicated helper/service so the view only delegates to it. Keep the behavior the
same, but give the extracted type a clear API that the view can call for
planning, applying, and clearing reorder drops.

---

Outside diff comments:
In `@Sources/ContentView.swift`:
- Around line 12515-12615: The drag teardown logic currently relies on a
DispatchSourceTimer in the failsafe helper, which violates the
no-timers/no-delayed-dispatch rule for production synchronization. Remove the
timer-based path from the Sidebar drag cleanup flow by eliminating the delayed
scheduling in requestClearSoon(reason:) and the
pendingClearTimer/pendingClearGeneration mechanism, then make
start(onRequestClear:) and the event monitors trigger cleanup directly through
explicit ownership/state transitions instead of time-based cancellation.
🪄 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: 0cc82e84-7518-425f-8157-62e08f1fa8f7

📥 Commits

Reviewing files that changed from the base of the PR and between e883409 and e5ace41.

⛔ Files ignored due to path filters (1)
  • .github/swift-file-length-budget.tsv is excluded by !**/*.tsv
📒 Files selected for processing (21)
  • Resources/Localizable.xcstrings
  • Sources/ContentView.swift
  • cmux.xcodeproj/project.pbxproj
  • web/messages/ar.json
  • web/messages/bs.json
  • web/messages/da.json
  • web/messages/de.json
  • web/messages/es.json
  • web/messages/fr.json
  • web/messages/it.json
  • web/messages/km.json
  • web/messages/ko.json
  • web/messages/no.json
  • web/messages/pl.json
  • web/messages/pt-BR.json
  • web/messages/ru.json
  • web/messages/th.json
  • web/messages/tr.json
  • web/messages/uk.json
  • web/messages/zh-CN.json
  • web/messages/zh-TW.json
💤 Files with no reviewable changes (20)
  • web/messages/pt-BR.json
  • web/messages/zh-CN.json
  • web/messages/pl.json
  • web/messages/it.json
  • web/messages/es.json
  • web/messages/da.json
  • web/messages/zh-TW.json
  • web/messages/fr.json
  • web/messages/ko.json
  • web/messages/ru.json
  • web/messages/bs.json
  • web/messages/km.json
  • web/messages/tr.json
  • web/messages/uk.json
  • web/messages/th.json
  • web/messages/no.json
  • Resources/Localizable.xcstrings
  • web/messages/ar.json
  • web/messages/de.json
  • cmux.xcodeproj/project.pbxproj
🛑 Comments failed to post (1)
Sources/ContentView.swift (1)

12094-12351: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Extract the workspace-reorder/drop flow out of ContentView.swift.

This adds another large behavior cluster to a file that is already far past the repo’s size budget. Keeping the reorder planner, overlay wiring, and cross-window move path here will make this sidebar path harder to test and maintain.

🤖 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 12094 - 12351, The workspace
reorder/drop logic in ContentView is too large and should be moved out of the
view file. Extract the overlay wiring and drag/drop flow from
workspaceReorderDropOverlay, activateSidebarWorkspaceDragIfNeeded,
updateWorkspaceReorderDrop, performWorkspaceReorderDrop, workspaceReorderPlan,
performWorkspaceReorderPlan, performCrossWindowWorkspaceDrop,
clampedCrossWindowTopLevelSlot, crossWindowTopLevelWorkspaceIds,
crossWindowTopLevelPinnedWorkspaceIds, crossWindowRawInsertIndex, and
syncSidebarSelectionAfterWorkspaceReorder into a dedicated helper/service so the
view only delegates to it. Keep the behavior the same, but give the extracted
type a clear API that the view can call for planning, applying, and clearing
reorder drops.

Sources: Coding guidelines, Learnings

@austinywang

Copy link
Copy Markdown
Contributor Author

CodeRabbit follow-up, corrected: I verified the two Sources/ContentView.swift findings against the current PR diff. Both target sidebar workspace reorder / drag failsafe code that came from the merged origin/main history and is outside this feature PR's effective diff; this PR only changes the sidebar settings snapshot and the workspace close-button gate in TabItemView. I am not taking the requested large drag/drop refactor in #5635 because it is unrelated to the hide-close-button setting and would materially expand the scope/risk of this PR.

austinywang and others added 2 commits June 29, 2026 16:41
…quest-option-to-hide-the-sidebar-wo

# Conflicts:
#	.github/swift-file-length-budget.tsv
Add DocC documentation to the new public sidebar.hideWorkspaceCloseButton
DefaultsKey to satisfy the Aziz public-symbol documentation policy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
austinywang and others added 3 commits July 1, 2026 21:27
…sidebar-wo

Regenerated .github/swift-file-length-budget.tsv via
scripts/swift_file_length_budget.py --write-budget (budget respected).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…quest-option-to-hide-the-sidebar-wo

# Conflicts:
#	cmux.xcodeproj/project.pbxproj
…quest-option-to-hide-the-sidebar-wo

# Conflicts:
#	.github/swift-file-length-budget.tsv
…quest-option-to-hide-the-sidebar-wo

# Conflicts:
#	.github/swift-file-length-budget.tsv
…quest-option-to-hide-the-sidebar-wo

# Conflicts:
#	.github/swift-file-length-budget.tsv
…quest-option-to-hide-the-sidebar-wo

# Conflicts:
#	.github/swift-file-length-budget.tsv
@austinywang

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit's Cmux No Ambient Global State finding in c04d900: the sidebar descriptor assembly now lives on the constructable CommandPaletteSidebarSettingsToggles value type, and the static sidebarDescriptors API was removed.

@lawrencecchen lawrencecchen added the stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening. label Sep 23, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in cmux backlog Sep 23, 2026

This branch was successfully deployed

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: option to hide the sidebar workspace close (×) button to reclaim title width

3 participants