Skip to content

Add opt-in split sidebar workspace snapshots - #6547

Closed
Eridanus117 wants to merge 2 commits into
manaflow-ai:mainfrom
Eridanus117:issue-6546-sidebar-split-view
Closed

Eridanus117 wants to merge 2 commits into
manaflow-ai:mainfrom
Eridanus117:issue-6546-sidebar-split-view

Conversation

@Eridanus117

@Eridanus117 Eridanus117 commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds a default-off sidebar performance mode that splits workspace row snapshots into two invalidation domains:

  • summary snapshot: title-adjacent visible state, metadata, logs, progress, remote state, ports
  • structured details snapshot: branch/directory and pull-request rows

The legacy sidebar observation path is left intact and remains the default. The new path only activates when sidebar.performance.optimizedWorkspaceSnapshots.enabled is true and mode is splitView.

Mini-RFC

Problem

After #6460 removed the transcript scan from normal sidebar rendering, expensive residual work can still happen when frequent summary/title/log/progress updates cause each row to rebuild branch/directory/PR snapshots. Those snapshots call through ordering and panel-detail helpers such as sidebarOrderedPanelIds, sidebarBranchDirectoryEntriesInDisplayOrder, and PR display building. In LazyVStackLayout, that can still amplify into visible sidebar CPU even when the current change does not affect branch/directory/PR rows.

Approach

Keep the current default behavior unchanged, but add an opt-in split mode:

{
  "sidebar": {
    "performance": {
      "optimizedWorkspaceSnapshots": {
        "enabled": false,
        "mode": "splitView",
        "summaryDebounceMilliseconds": 40,
        "detailDebounceMilliseconds": 40,
        "diagnostics": false,
        "logInvalidationSource": false
      }
    }
  }
}

In split mode:

  • TabItemView subscribes to a lighter summary publisher for the parent row snapshot.
  • Branch/directory and PR rows render through a nested structured-details section with its own detail publisher and debounce.
  • The old combined sidebarObservationPublisher and legacy makeWorkspaceSnapshot path remain unchanged for users who do not enable the new setting.
  • Finder context-menu directory resolution is lazy in split mode, so normal summary updates do not force that detail lookup.

Rollout

  1. Ship default-off.
  2. Enable in nightly / affected profiles for validation.
  3. Use the diagnostics flags only when investigating invalidation source behavior.
  4. Consider changing the default in a later PR only after profiling confirms the split path is stable.

Tests / Verification

Passed:

  • git diff --check
  • xcrun swiftc -parse Sources/ContentView.swift Sources/WorkspaceSidebarObservation.swift Sources/Workspace.swift Sources/KeyboardShortcutSettingsFileStore.swift Sources/CmuxSettingsJSONPathSupport.swift Sources/KeyboardShortcutSettingsFileStore+Template.swift cmuxTests/WorkspaceSidebarObservationTests.swift cmuxTests/KeyboardShortcutSettingsFileStoreStartupTests.swift

Blocked before exercising this PR's tests:

  • swift test --package-path Packages/macOS/CmuxSettings --filter UserDefaultsSettingsClientTests -Xswiftc -strict-concurrency=minimal
    • blocked by existing Swift 6 Sendable errors in Packages/macOS/CmuxFoundation/Sources/CmuxFoundation/Process/CommandRunner.swift and Packages/macOS/CmuxFoundation/Sources/CmuxFoundation/FileWatch/FileWatcher.swift
  • xcodebuild -project cmux.xcodeproj -scheme cmux -destination 'platform=macOS' -skipPackageUpdates -only-testing:cmuxTests/WorkspaceSidebarObservationTests test
    • blocked before compile while SwiftPM attempted to clone https://github.com/PostHog/posthog-ios.git into the package repository cache

Related

Refs #6546
Related to #6460 and #2527


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


Summary by cubic

Adds an opt-in split sidebar snapshot mode that isolates summary updates from branch/directory/PR details to cut row rebuilds and CPU during frequent updates. Legacy stays default; enable via sidebar.performance.optimizedWorkspaceSnapshots (supports #6546).

  • New Features

    • New settings under sidebar.performance.optimizedWorkspaceSnapshots: enabled, mode ("splitView"), summaryDebounceMilliseconds, detailDebounceMilliseconds, diagnostics, logInvalidationSource.
    • Summary uses a lightweight publisher; branch/directory/PR rows render in a nested details section with its own publisher and debounce.
    • Finder directory resolution is lazy in split mode, so summary updates don’t trigger it.
    • Added sidebarSummaryObservationPublisher and sidebarStructuredDetailObservationPublisher; updated settings template and JSON parsing (mode normalization, debounce clamping); tests cover publisher separation and settings import.
  • Bug Fixes

    • Fixed Swift 6 concurrency imports by adding @preconcurrency import Dispatch in FileWatcher and CommandRunner.

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

Review in cubic

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Manaflow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9c5b5b4f-a892-4d53-8133-3ce6398c5b55

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@Eridanus117

Copy link
Copy Markdown
Contributor Author

This draft is being superseded by #6564 for the direct title-driven workspace-list fanout path. The useful idea to keep around is splitting sidebar summary/detail observation if row-level rendering churn remains after the core title/mobile fanout fixes land.

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