Repository navigation
Fix browser portal leaking to other tabs on Bonsplit tab switch - #2000
lawrencecchen merged 3 commits into
Conversation
XCUIApplication.launch() blocks ~60s then fails on headless WarpBuild runners because foreground activation requires a GUI login session. Apply the same pre-launch strategy used for the display resolution test: - CI shell launches the app with env vars before running xcodebuild - Test detects pre-launched app via manifest, uses activate() instead of launch() to avoid killing and relaunching the app - Falls back to clicking the window for focus via accessibility framework Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit a540e2f.
When switching between Bonsplit tabs within a workspace, portal-hosted WKWebViews from deselected browser panels could remain visible above the newly selected tab. This happened because Bonsplit's keepAllAlive mode hides non-selected tabs via SwiftUI .opacity(0), but the portal layer renders at the AppKit window level and is not affected by SwiftUI opacity changes. Explicitly hide browser portals for deselected tabs in the pane during tab selection, ensuring the portal visibility state is always in sync regardless of SwiftUI re-render timing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@anthhub is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
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 (1)
📝 WalkthroughWalkthroughAdded a private helper method Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 fixes a visual leak where portal-hosted The fix adds a small private helper Key design properties of the fix:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Workspace
participant BonsplitController
participant BrowserPanel
participant BrowserWindowPortalRegistry
User->>Workspace: Switch tab (e.g. browser → terminal)
Workspace->>BonsplitController: focusPane(pane) / selectTab(tabId)
BonsplitController-->>Workspace: focusedPane, selectedTabId resolved
Note over Workspace: Unfocus all other panels
Workspace->>Workspace: hideBrowserPortalsForDeselectedTabs(inPane: focusedPane, selectedTabId:)
loop for each non-selected tab in pane
Workspace->>BrowserPanel: hideBrowserPortalView(source: "tabDeselected")
BrowserPanel->>BrowserWindowPortalRegistry: hide(webView:, source:)
BrowserWindowPortalRegistry->>BrowserWindowPortalRegistry: entry.visibleInUI = false
BrowserWindowPortalRegistry->>BrowserWindowPortalRegistry: containerView.isHidden = true
end
Workspace->>Workspace: activatePanel(panel, …)
Note over User: Switch back to browser tab
User->>Workspace: Switch tab (terminal → browser)
Workspace->>BonsplitController: selectTab(browserTabId)
BonsplitController-->>Workspace: opacity(1) triggers SwiftUI re-render
Workspace->>BrowserWindowPortalRegistry: bind(webView:, visibleInUI: true, …)
BrowserWindowPortalRegistry->>BrowserWindowPortalRegistry: containerView.isHidden = false
Reviews (1): Last reviewed commit: "Fix browser portal leaking to other tabs..." | Re-trigger Greptile |
|
Thank you for the contribution! |
…flow-ai#2000) * Pre-launch app for browser UI test on headless CI runners XCUIApplication.launch() blocks ~60s then fails on headless WarpBuild runners because foreground activation requires a GUI login session. Apply the same pre-launch strategy used for the display resolution test: - CI shell launches the app with env vars before running xcodebuild - Test detects pre-launched app via manifest, uses activate() instead of launch() to avoid killing and relaunching the app - Falls back to clicking the window for focus via accessibility framework Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Revert "Pre-launch app for browser UI test on headless CI runners" This reverts commit a540e2f. * Fix browser portal leaking to other tabs on Bonsplit tab switch When switching between Bonsplit tabs within a workspace, portal-hosted WKWebViews from deselected browser panels could remain visible above the newly selected tab. This happened because Bonsplit's keepAllAlive mode hides non-selected tabs via SwiftUI .opacity(0), but the portal layer renders at the AppKit window level and is not affected by SwiftUI opacity changes. Explicitly hide browser portals for deselected tabs in the pane during tab selection, ensuring the portal visibility state is always in sync regardless of SwiftUI re-render timing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: austinpower1258 <austinwang115@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
keepAllAlivemode hides non-selected tabs via SwiftUI.opacity(0), but portal-hosted WKWebViews render at the AppKit window level and are not affected by SwiftUI opacity changesapplyTabSelectionNow, ensuring portal visibility is always in sync regardless of SwiftUI re-render timingTest plan
🤖 Generated with Claude Code
Summary by cubic
Stops browser portal layers from showing over other tabs when switching within a Bonsplit pane by explicitly hiding portals for deselected tabs. Keeps portal-hosted web views in sync with tab selection even when
keepAllAliveuses SwiftUI opacity..opacity(0)vs AppKit window-level rendering mismatch.Written for commit 91440f0. Summary will update on new commits.
Summary by CodeRabbit