LearnNewsExamplesServices
Frontmatter
id8161
titleRefine Cross-Window Drag Intersection to Target SortZone Rect
stateClosed
labels
enhancementai
assigneestobiu
createdAtDec 27, 2025, 10:06 PM
updatedAtDec 28, 2025, 1:07 AM
githubUrlhttps://github.com/neomjs/neo/issues/8161
authortobiu
commentsCount1
parentIssue8163
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 28, 2025, 1:07 AM

Refine Cross-Window Drag Intersection to Target SortZone Rect

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Dec 27, 2025, 10:06 PM

Currently, DragCoordinator triggers a remote drag operation as soon as the mouse enters a target window that has a registered SortZone. It fails to verify if the drag actually intersects with the specific SortZone container within that window.

Current Behavior:

  1. Window.getWindowAt(screenX, screenY) identifies the target window.
  2. DragCoordinator checks if this window is in the registry.
  3. If yes, it immediately delegates to targetSortZone.onRemoteDragMove.

Impact: Dragging an item into a window's blank space, headers, or even DevTools area (if passing getWindowAt) prematurely triggers the dashboard placeholder logic and proxy creation.

Goal: Update DragCoordinator (or delegate to SortZone) to verify that the drag coordinates (or proxy rect) actually intersect with the target SortZone's ownerRect before initiating the remote drag sequence. This ensures the "drop target" effect only activates when visually appropriate.

tobiu added the enhancement label on Dec 27, 2025, 10:06 PM
tobiu added the ai label on Dec 27, 2025, 10:06 PM
tobiu added parent issue #8163 on Dec 27, 2025, 10:33 PM
tobiu assigned to @tobiu on Dec 28, 2025, 12:53 AM
tobiu referenced in commit 711a59b - "Neo.manager.DragCoordinator: Refactor onDragMove for clarity and efficient early returns - #8161" on Dec 28, 2025, 1:03 AM
tobiu
tobiu Dec 28, 2025, 1:03 AM

Input from gemini:

✦ I have implemented the enhanced intersection logic for cross-window drag operations.

Key Changes:

  1. Neo.draggable.dashboard.SortZone:

    • Added acceptsRemoteDrag(localX, localY): This method performs a precise point-in-rect check against the dashboard's ownerRect. It handles lazy fetching of the DOM rect if it's not already cached, ensuring the first interaction is handled correctly (albeit asynchronously for the first frame).
  2. Neo.manager.DragCoordinator:

    • Refactored onDragMove to use this new validation method.
    • Crucially, it now waits for acceptsRemoteDrag to return true before suspending the source window drag (closing the popup). This prevents the "disappearing item" issue when dragging over window headers or empty space.
    • Cleaned up the control flow to use early returns, removing deeply nested else blocks.

This ensures that the "drop target" effect and the handover of control only happen when the user clearly intends to drop onto a valid dashboard area.

tobiu closed this issue on Dec 28, 2025, 1:07 AM