Repository navigation
Fix main CI by deferring file-drop overlay retries - #2979
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe pull request refactors the file-drop-overlay installation mechanism during app startup. It replaces the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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 |
Greptile SummaryThis PR removes Confidence Score: 5/5Safe to merge — the fix correctly defers window-tree mutation to post-layout and is bounded. No P0/P1 issues found. The async-retry approach is idempotent (installFileDropOverlay checks for an existing overlay via objc_getAssociatedObject before adding a new one), deduplication in WindowAccessor prevents multiple concurrent chains, and the 16-attempt ceiling is generous for typical startup timing. All remaining considerations are P2. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant SwiftUI as SwiftUI Layout
participant WA as WindowAccessor(dedupeByWindow:true)
participant IFDOWR as installFileDropOverlayWhenReady
participant IFDOW as installFileDropOverlay
participant MQ as DispatchQueue.main.async
SwiftUI->>WA: viewWillMove(toWindow:) / viewDidMoveToWindow()
WA->>IFDOWR: call (remainingAttempts=16)
IFDOWR->>IFDOW: synchronous attempt
alt themeFrame not yet ready
IFDOW-->>IFDOWR: return false
IFDOWR->>MQ: schedule retry (remainingAttempts=15)
MQ->>IFDOWR: call (remainingAttempts=15)
IFDOWR->>IFDOW: attempt #2
IFDOW-->>IFDOWR: return true (themeFrame ready)
note over IFDOWR: guard fails, return, no more retries
else themeFrame already available
IFDOW-->>IFDOWR: return true
note over IFDOWR: guard fails, return immediately
end
Reviews (1): Last reviewed commit: "Fix deferred file-drop overlay installat..." | Re-trigger Greptile |
…ow-overlay Fix main CI by deferring file-drop overlay retries
Summary
WindowSetupAccessorpath added for file-drop overlay retriesWindowAccessorRoot cause
mainCI started failing in thetestsjob on the two latest merge commits:24597524739(26892bd0)24597559538(060eafd6)The shared regression started with
70618b0f(Fix file drop overlay startup installation).The new
WindowSetupAccessorcalledinstallFileDropOverlaywhileWindowObservingView.viewWillMove(toWindow:)/ SwiftUI update was still attaching the window hierarchy. In the failing CI logs that produced:NSWindow warning: adding an unknown subview: <cmux_DEV.FileDropOverlayView ...>NSHostingView is being laid out reentrantly while rendering its SwiftUI contentOnce that attachment path became re-entrant, unrelated unit suites started failing broadly because window/layout state and Ghostty surface setup were no longer stable.
Validation
./scripts/setup.sh./scripts/reload.sh --tag fix-main-ci-window-overlayNote
Medium Risk
Changes window-setup timing and introduces bounded async retry logic during startup; risk is moderate due to potential for missed/late overlay installation or subtle lifecycle timing issues in SwiftUI/AppKit.
Overview
Defers file-drop overlay installation until the
NSWindowview hierarchy is stable by addinginstallFileDropOverlayWhenReady, which retries installation on the next main-loop turn with a bounded attempt count.Removes the synchronous retry path (
WindowSetupAccessor) and installs the overlay from the existing window accessor callback, avoiding re-entrant mutations of theNSThemeFrame/hosting view tree during attachment.Reviewed by Cursor Bugbot for commit 5c866bd. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Defers file-drop overlay installation to the next run-loop and retries until the window is ready, preventing reentrant layout during SwiftUI attach. This fixes the CI failures caused by mutating the window hierarchy at startup.
installFileDropOverlayWhenReady(async with 16 bounded retries).WindowAccessor; removedWindowSetupAccessor.Written for commit 5c866bd. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Refactor