Skip to content

Route portal drop overlays through content - #117

Merged
lawrencecchen merged 1 commit into
mainfrom
task-portal-drop-overlay-owner
May 9, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
task-portal-drop-overlay-owner

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented May 9, 2026 •

Copy link
Copy Markdown

Summary

  • Add portalDropOverlayTabKinds to identify tab content that renders pane drop overlays above AppKit portals.
  • Suppress Bonsplit's inline drop placeholder for those selected tab kinds while still publishing paneDropZone to content.
  • Default portal overlay kinds to terminal and browser.

Testing

  • swift test, 114 tests passed.

Summary by cubic

Routes pane drop overlays through tab content for portal-backed tabs to avoid conflicts with AppKit portals. Defaults to terminal and browser, and can be configured.

  • New Features
    • Added BonsplitConfiguration.portalDropOverlayTabKinds (default: ["terminal", "browser"]).
    • Suppress inline pane drop overlay for those kinds, while still publishing paneDropZone so content can render the overlay above the portal.
    • Introduced PaneDropOverlayRouting.inlineDropZone to compute the effective inline drop zone.

Written for commit 5b38ac9. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added portalDropOverlayTabKinds configuration option to control which tab types display drop overlays from portal sources. Defaults to "terminal" and "browser" tabs.
  • Tests

    • Added unit tests verifying drop-overlay configuration and routing behavior.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented May 9, 2026 •

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 10db048c-4835-46db-b6ea-98837789691d

📥 Commits

Reviewing files that changed from the base of the PR and between 586bafc and 5b38ac9.

📒 Files selected for processing (3)
  • Sources/Bonsplit/Internal/Views/PaneContainerView.swift
  • Sources/Bonsplit/Public/BonsplitConfiguration.swift
  • Tests/BonsplitTests/BonsplitTests.swift

📝 Walkthrough

Walkthrough

This PR conditionally suppresses inline drop overlays for portal-rendered tab kinds by adding portalDropOverlayTabKinds configuration to BonsplitConfiguration, implementing routing logic in PaneDropOverlayRouting, and integrating the routing into PaneContainerView's drop-zone handling.

Changes

Portal Drop Overlay Routing

Layer / File(s) Summary
Configuration Contract
Sources/Bonsplit/Public/BonsplitConfiguration.swift
Added portalDropOverlayTabKinds: Set<String> property with default value ["terminal", "browser"] and corresponding initializer parameter.
Drop Overlay Routing Logic
Sources/Bonsplit/Internal/Views/PaneContainerView.swift
Introduced PaneDropOverlayRouting helper that conditionally returns nil when the selected tab kind is in portalDropOverlayTabKinds, otherwise forwards the active drop zone.
Drop Zone Integration
Sources/Bonsplit/Internal/Views/PaneContainerView.swift
Updated PaneContainerView to compute inlineDropZone via routing logic and pass it to PaneDropInteractionContainer, suppressing inline overlays for configured portal tab kinds.
Tests and Verification
Tests/BonsplitTests/BonsplitTests.swift
Added three tests: verifying default portalDropOverlayTabKinds configuration, asserting routing suppression for portal kinds, and confirming custom configuration behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • manaflow-ai/bonsplit#18: Introduces the foundational PaneDropInteractionContainer and drop-overlay infrastructure that this PR builds upon with conditional routing based on tab kind.
  • manaflow-ai/bonsplit#113: Related drop-handling refactor in PaneContainerView affecting pane drop routing and overlay behavior.
  • manaflow-ai/bonsplit#106: Modifies drop-related UI behavior in PaneContainerView for pane drop zones and overlays.

Poem

🐰 A portal drop, so smooth and bright,
We route the zones with care and might,
Some tabs get overlays, some don't show—
Configuration makes them ebb and flow! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Route portal drop overlays through content' directly and clearly summarizes the main change: introducing portal drop overlay routing to suppress inline overlays for specific tab kinds while preserving the underlying drop-zone layer.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-portal-drop-overlay-owner

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented May 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR introduces a mechanism to suppress Bonsplit's inline SwiftUI drop placeholder for tab kinds whose content renders its own overlay above an AppKit portal (e.g. terminal, browser), while still forwarding the active drop zone to those views via the paneDropZone environment key.

  • Adds portalDropOverlayTabKinds: Set<String> to BonsplitConfiguration (default [\"terminal\", \"browser\"]), allowing hosts to configure which tab kinds own their drop overlay.
  • Extracts the suppression decision into the PaneDropOverlayRouting internal namespace and wires it into PaneContainerView via a new inlineDropZone computed property, keeping activeDropZone flowing to content through the environment unchanged.
  • Adds three new test methods covering defaults, suppression, and custom configuration.

Confidence Score: 4/5

Safe to merge; the change is well-scoped and the drop interaction path is not regressed.

The routing logic is correct and the environment forwarding of activeDropZone to portal content is preserved. One test case uses nil as both input and expected value, so it cannot detect a regression where the suppression guard is removed.

Tests/BonsplitTests/BonsplitTests.swift — the nil-input assertion in the suppression test.

Important Files Changed

Filename Overview
Sources/Bonsplit/Internal/Views/PaneContainerView.swift Adds PaneDropOverlayRouting namespace with inlineDropZone logic; passes inlineDropZone (nil for portal kinds) to the placeholder overlay while still forwarding the full activeDropZone to content via environment. Logic is correct and well-scoped.
Sources/Bonsplit/Public/BonsplitConfiguration.swift Adds public portalDropOverlayTabKinds: Set with default ["terminal", "browser"]. Clean, backward-compatible public API addition.
Tests/BonsplitTests/BonsplitTests.swift Good coverage for routing and config; one test case (activeDropZone: nil with a portal kind) uses inputs that can't distinguish the suppression path from a passthrough.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Drag enters pane] --> B[UnifiedPaneDropDelegate sets activeDropZone]
    B --> C[PaneContainerView recomputes inlineDropZone]
    C --> D{selectedTabKind in portalDropOverlayTabKinds?}
    D -- Yes --> E[inlineDropZone = nil - Suppress SwiftUI placeholder]
    D -- No / nil --> F[inlineDropZone = activeDropZone - Show SwiftUI placeholder]
    E --> G[PaneDropInteractionContainer renders invisible placeholder]
    F --> G2[PaneDropInteractionContainer renders visible placeholder]
    B --> H[contentArea receives .environment paneDropZone activeDropZone]
    H --> I[Portal-hosted AppKit content renders its own overlay]
Loading

Reviews (1): Last reviewed commit: "Route portal drop overlays through conte..." | Re-trigger Greptile

Comment on lines +257 to +263

XCTAssertEqual(PaneDropOverlayRouting.inlineDropZone(
activeDropZone: .left,
selectedTabKind: "browser",
portalDropOverlayTabKinds: config.portalDropOverlayTabKinds
), .left)
XCTAssertNil(PaneDropOverlayRouting.inlineDropZone(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Test case does not verify suppression

This assertion passes regardless of whether the suppression logic exists: when activeDropZone is nil, both the suppression path (return nil) and the passthrough path (return activeDropZone) produce nil. A failing test would not be generated if the guard were removed and the function simply returned activeDropZone in all cases. Replacing the input with a non-nil drop zone (e.g., .left) would make this case actually verify that the overlay is suppressed for a portal kind.

@lawrencecchen
lawrencecchen merged commit 55ce898 into main May 9, 2026
6 checks passed
@lawrencecchen
lawrencecchen deleted the task-portal-drop-overlay-owner branch May 9, 2026 05:18
kanafm pushed a commit to kanafm/bonsplit that referenced this pull request May 11, 2026
…al-drop-overlay-owner"

This reverts commit 55ce898, reversing
changes made to 586bafc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant