Repository navigation
Stop unrelated defaults writes and pane geometry changes from re-evaluating chrome-heavy views - #14058
Conversation
testMinimalModeToggleDoesNotReevaluateChromeHeavyBodies (#13930) fails on main: switching the presentation mode re-evaluates ContentView, WorkspaceContentView, and VerticalTabsSidebar. The test's _printChanges output in main CI names two causes. Every @AppStorage property whose key contains "." reported a change after a write to a different key, while the flat-key properties in the same views did not. ContentView and VerticalTabsSidebar held five such keys (four titlebar insets and the sidebar view selection), so any UserDefaults write re-evaluated the window root and the sidebar. Rename them to flat keys and move values saved under the old keys at launch. A value already stored under the new key wins. Workspace.tmuxLayoutSnapshot was @published, but its only reader is the window pane overlay, which reads it from the .workspacePaneGeometryDidChange handler posted right after the assignment. Publishing it re-evaluated every view observing the workspace on each geometry change, which paneLayoutVersion is gated to avoid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughSidebar and titlebar settings now use flat ChangesView invalidation changes
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Saved sidebar and titlebar settings are migrated, geometry updates still refresh their consumers, and the regression test now gates app-host CI. No concrete merge-blocking risk remains beyond normal checks. 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
All contributors have signed the CLA ✍️ ✅ |
|
An independent rebuild of this fix reached the same two causes: the dotted This PR's red shards contain no failure of its own: the icon test (#14062), — Ibex g1 🌿 |
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. |
…asses The known-failures catalog listed it under #13930, which this PR fixes, so a regression would fail the test without failing CI. Also drop "published" from a helper comment now that tmuxLayoutSnapshot is a plain property. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cd7a4cf Prepare iOS 1.0.6 beta compatibility release (manaflow-ai#14112) 2d9b4e8 test: skip dead persistent-SSH restore tests and fix relay-less legacy fixtures after manaflow-ai#14216 (manaflow-ai#14222) df44058 ci: run focused cmuxTests against products CI already compiled (manaflow-ai#14229) 06ec6cb Stop unrelated defaults writes and pane geometry changes from re-evaluating chrome-heavy views (manaflow-ai#14058) 185d99e chore(cli): remove dead persistent SSH PTY startup path (manaflow-ai#14231) dddffea ci: take the build-fleet host lock for nightly mini builds (manaflow-ai#14233) f2106e5 test(cli): expect the client-side workspace ref resolution manaflow-ai#13964 added (manaflow-ai#14230) 59fa5b9 docs(ci): fix persistent-compile pilot runbook drift (manaflow-ai#14206) # Conflicts: # .github/workflows/app-host-test-rerun.yml # .github/workflows/nightly-mini-build.yml
Summary
Every
UserDefaultswrite re-evaluated the window root (ContentView) and the vertical tabs sidebar. Every pane geometry change re-evaluated every view observing the workspace.testMinimalModeToggleDoesNotReevaluateChromeHeavyBodiescatches both. Toggling minimal mode writes one defaults key, and on main that re-evaluatesContentView/WorkspaceContentView/VerticalTabsSidebar1 / 2 / 1 times; the test expects 0 / 0 / 0. With this change the test passes. Its_printChangesoutput on main (run 35903570794, ccdbf30):Dotted
@AppStoragekeys. A view that reads an@AppStorageproperty whose key contains a.re-evaluates its body on every write to the defaults suite. A view with a flat key re-evaluates only when its own key changes. The standalone experiment in #13930 shows this. Apart from_selection, a binding thatContentViewpasses down, every property in theContentViewandVerticalTabsSidebarlines above reads one of five dotted keys: fourtitlebarDebug.*insets andcmuxExtensionSidebar.providerId.This PR renames them to flat keys (
titlebarDebugLeftControlsLeadingInset, …,cmuxExtensionSidebarProviderId). At launch, values saved under the old keys move to the new ones. A value already stored under a new key wins, and the old keys are removed. Nothing else in the repository reads the old keys.Workspace.tmuxLayoutSnapshotwas@Published(since 656786f). No view body reads it. The window pane overlay reads it from event handlers, including the.workspacePaneGeometryDidChangenotification that the geometry callback posts right after assigning it. Publishing it firedobjectWillChangeon every geometry change, including divider drags, so every view observing the workspace re-evaluated.paneLayoutVersionis gated so that divider drags do not do this. The snapshot is now a plain stored property.The two causes are independent. Each change removes only its own
_printChangeslines, and the test passes only with both. These runs used macOS 26; counts areContentView/WorkspaceContentView/VerticalTabsSidebar._printChangeslines in the testWorkspaceContentView: _workspace changed.The test already failed in the PR that added it: run 28413864324 of #7076 logged 6 / 8 / 10. Until #12053, the app-host shard classifier checked only XCTest summaries, so Swift Testing failures did not fail the shard.
Downgrade: the migration removes the old keys. An older build run afterwards shows the default sidebar view and the default titlebar insets.
Not changed here: more than 30 other
@AppStoragekeys still contain dots, including user settings such asterminal.textBoxMaxLines,fileExplorer.styleandsessionIndex.compactView. Views that read them still re-evaluate on every defaults write. This PR does not include the repo-wide audit that #13930 suggests.Fixes #13930. Refs #13879. This covers one of the five tests that #14006 lists as not covered.
Testing
Nothing was built or run locally. Hosted runs:
legacyDottedSelectionKeyMigratesToFlatKeypassed.visibilityToggleKeepsAppKitTableContainerMountedfailed, as it does on main (#13931 is the open fix).WindowDragHandleHitTestspassed, including the titlebar migration test.The E2E workflow ends red on every run. Its cleanup step exits 1 after the tests with "refusing to inspect app hosts outside runner temp". The results above come from the test log.
New tests:
WindowDragHandleHitTests.testTitlebarChromeSettingsMigrateDottedKeysFromBeforeIssue13930andSidebarProviderMenuRegressionTests.legacyDottedSelectionKeyMigratesToFlatKey()cover the migration. They include the case where a newer value wins over a leftover legacy value.Localization audit: no user-facing strings changed. The renamed keys are UserDefaults storage keys.
Checklist
🤖 Generated with Claude Code
Summary by CodeRabbit