Repository navigation
Add opt-in split sidebar workspace snapshots - #6547
Eridanus117 wants to merge 2 commits into
Conversation
|
Someone is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
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. |
Summary
This PR adds a default-off sidebar performance mode that splits workspace row snapshots into two invalidation domains:
The legacy sidebar observation path is left intact and remains the default. The new path only activates when
sidebar.performance.optimizedWorkspaceSnapshots.enabledis true andmodeissplitView.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. InLazyVStackLayout, 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:
TabItemViewsubscribes to a lighter summary publisher for the parent row snapshot.sidebarObservationPublisherand legacymakeWorkspaceSnapshotpath remain unchanged for users who do not enable the new setting.Rollout
Tests / Verification
Passed:
git diff --checkxcrun 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.swiftBlocked before exercising this PR's tests:
swift test --package-path Packages/macOS/CmuxSettings --filter UserDefaultsSettingsClientTests -Xswiftc -strict-concurrency=minimalPackages/macOS/CmuxFoundation/Sources/CmuxFoundation/Process/CommandRunner.swiftandPackages/macOS/CmuxFoundation/Sources/CmuxFoundation/FileWatch/FileWatcher.swiftxcodebuild -project cmux.xcodeproj -scheme cmux -destination 'platform=macOS' -skipPackageUpdates -only-testing:cmuxTests/WorkspaceSidebarObservationTests testhttps://github.com/PostHog/posthog-ios.gitinto the package repository cacheRelated
Refs #6546
Related to #6460 and #2527
Need help on this PR? Tag
/codesmithwith 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
sidebarSummaryObservationPublisherandsidebarStructuredDetailObservationPublisher; updated settings template and JSON parsing (mode normalization, debounce clamping); tests cover publisher separation and settings import.Bug Fixes
@preconcurrency import Dispatchin FileWatcher and CommandRunner.Written for commit f1aafd7. Summary will update on new commits.