Repository navigation
Fix sidebar reopen cutoff render - #8626
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
ChangesAppKit sidebar identity preservation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ContentView
participant CmuxFeatureFlags
participant VerticalTabsSidebar
participant NSWindow
participant SidebarState
ContentView->>CmuxFeatureFlags: Read injected AppKit sidebar flag
ContentView->>VerticalTabsSidebar: Pass feature flags and select implementation
ContentView->>NSWindow: Mount persistent sidebar layout
SidebarState->>ContentView: Toggle sidebar visibility
ContentView->>ContentView: Retain table container and restore focus
Suggested reviewers: 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ 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 |
Greptile SummaryThis PR keeps the built-in AppKit sidebar mounted while it is hidden. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (38): Last reviewed commit: "Fix AppKit row retirement view typing" | Re-trigger Greptile |
There was a problem hiding this comment.
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 `@cmuxTests/WorkspaceContentViewVisibilityTests.swift`:
- Around line 124-127: Replace the positional CmuxFeatureFlags.allFlags[6]
lookup in WorkspaceContentViewVisibilityTests with the stable named identifier
or enum case for the AppKit sidebar feature flag. Keep the existing override
setup and deferred restoration using the resolved flag unchanged.
🪄 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: e878c3d7-3f61-4dec-84f6-534d1efeb9d8
📒 Files selected for processing (3)
Sources/Debug/SidebarLazyContractProbe.swiftSources/Sidebar/AppKitList/SidebarWorkspaceTableView.swiftcmuxTests/WorkspaceContentViewVisibilityTests.swift
b4ab99d to
634be0d
Compare
|
@codex review |
@austinywang I can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 241,631 of the 240,000 allowed lines of code this month. Reviews resume on 1 August 2026 (in 10 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews. To help optimise your usage, you can tune cubic to get the most out of your usage limits:
|
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
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/WorkspaceContentViewVisibilityTests.swift`:
- Around line 159-200: Replace the single-result firstDescendant checks in the
sidebar toggle test with collection of all SidebarWorkspaceTableContainerView
descendants after each toggle. Assert each collection contains exactly one
container and that its identity is initialContainer; update or add a helper near
firstDescendant to gather all matching descendants while preserving the existing
traversal.
- Around line 111-156: In the AppKit sidebar test setup, capture the existing
WindowTerminalPortal.usesCoalescedAnchorFailsafe value before changing it, then
restore that value in the existing defer teardown alongside the defaults and
window cleanup. Ensure the restoration runs regardless of test outcome so later
tests do not inherit this test’s configuration.
In `@Sources/FeatureFlags.swift`:
- Around line 176-177: Update appKitSidebarListFlag and the corresponding
definition at the additional location to resolve the flag by its stable key
rather than the positional allFlags[6] index. Preserve the existing flag
identity and ensure the definition remains included in allFlags without
depending on ordering.
🪄 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: 1c543000-6d85-4a70-8000-b31db522b789
📒 Files selected for processing (3)
Sources/ContentView.swiftSources/FeatureFlags.swiftcmuxTests/WorkspaceContentViewVisibilityTests.swift
There was a problem hiding this comment.
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/ContentView.swift`:
- Around line 2596-2613: Add test coverage in
cmuxTests/WorkspaceContentViewVisibilityTests.swift:170-174 by adding a second
scenario that makes the sidebar’s in-place rename NSTextView/field editor the
window’s first responder before toggling sidebarState, then assert focus is
restored to the main panel. Sources/ContentView.swift:2596-2613 requires no
direct change; the existing appKitSidebarContainer(owning:) delegate-lookup path
should be exercised by the new test.
🪄 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: b7887140-c98a-4f77-8b3b-1ca4f894df5d
📒 Files selected for processing (2)
Sources/ContentView.swiftcmuxTests/WorkspaceContentViewVisibilityTests.swift
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
1 similar comment
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Closes #8624
Summary
appKitSidebarListenabled. Custom and ExtensionKit providers retain their existing unmount behavior. The legacy SwiftUI sidebar path is unchanged.Root cause and scope
Sidebar visibility was encoded as view lifetime for the AppKit implementation. Closing the sidebar destroyed
SidebarWorkspaceTableContainerView; reopening cold-started its estimated/deferred row layout, briefly exposing rows at an incomplete clipped geometry before the table settled.The architectural invariant is now: visibility may change presentation geometry, but it must not change the identity of the built-in native AppKit sidebar. Retaining the native hierarchy also requires quiescing hidden work so the fix does not trade the flash for off-screen observers, animations, payload retention, or mutation churn.
This is related to #8412 only at the native-row rendering-settle layer. Its settings-triggered repaint path differs from this visibility-triggered remount, so this fix does not reuse or assume the same trigger.
Regression coverage
The initial red/green history remains split:
cdf4531d15— failing real-window behavior test only.ab76282633— production identity-preservation fix.Follow-up tests and fixes cover lifecycle details discovered during review: provider scoping, focus ownership, hidden payload release, animation suspension, checklist/rename teardown, row-height preservation, scheduler deferral, and hidden reload reconciliation.
Final coverage is split across files that remain below 500 lines:
SidebarHiddenPresentationTests.swift— controller/payload/animation behavior plus real-window hide/reopen identity and provider scope.SidebarWorkspaceRowSuspensionTests.swift— row-action release and inline edit/checklist suspension.SidebarWorkspaceTableTests.swift— table controller, height-cache, scheduler, and reload behavior.WorkspaceContentViewVisibilityTests.swift— layout/focus helpers and deterministic resizer scheduling.The real-window regression mounts
ContentViewin anNSWindow, selects the AppKit flag through a test-owned feature-flag store, toggles the window-scopedSidebarState, verifies the same native table container remains mounted while hidden and after reopen, confirms hidden workspace updates are deferred then reconciled, and exercises focus ownership.Validation
Passed on final rebased HEAD:
python3 scripts/lint-feature-flags.py./scripts/check-pbxproj.shpython3 scripts/check-test-determinism.py --strictPYTHONUNBUFFERED=1 python3 tests/test_ci_sidebar_lazy_layout_guard.pygit diff --check origin/mainThe repository revision no longer contains
.github/swift-file-length-budget.tsvorscripts/swift_file_length_budget.py, so the requested script cannot be run. Neither Swift budget file was introduced or changed;.github/swift-warning-budget.tsvis untouched. New and newly split Swift files remain under 500 lines.Per task instructions, no local
xcodebuild, XCUITest, tagged app build, app launch, orreload.shwas run on this host.Final-head manual CI run: https://github.com/manaflow-ai/cmux/actions/runs/29968346069
daemon/remotetestTestTerminateProcessesRunsOnlyOncefailed three clean attempts before macOS routing.mainfailure: the once-only guard never landed. Existing PR remote-daemon: tear a PTY session down once #8643 is the scoped upstream fix and explicitly documents that this failure blocks all manually dispatched CI from reaching the macOS matrix: remote-daemon: tear a PTY session down once #8643daemon/remote, and the unrelated daemon fix was not copied into this branch.A previous exact-head Depot run auto-canceled at the workflow's fixed 20-minute job timeout while unit tests were still running; it did not report a code/test failure: https://github.com/manaflow-ai/cmux/actions/runs/29958396576.
Localization audit: the production diff adds no user-facing strings or message keys. Added-line inspection found no new labels, buttons, alerts, tooltips, titles, or descriptions, so no locale catalog changes are required.
Demo video
A clean cloud-Mac capture was attempted but infrastructure prevented a usable session:
cmux-aws-m4proand missing Screen Recording permission oncmux13s-mac-mini.Video URL or attachment: unavailable due to those infrastructure blockers.
Checklist