LearnNewsExamplesServices
Frontmatter
id9073
titlerefactor: Ensure Drag & Drop Stability via ''internalId''
stateClosed
labels
airefactoringcore
assigneestobiu
createdAtFeb 9, 2026, 11:50 AM
updatedAtFeb 9, 2026, 1:33 PM
githubUrlhttps://github.com/neomjs/neo/issues/9073
authortobiu
commentsCount1
parentIssue9074
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 9, 2026, 1:33 PM

refactor: Ensure Drag & Drop Stability via 'internalId'

Closed v12.0.0 airefactoringcore
tobiu
tobiu commented on Feb 9, 2026, 11:50 AM

Context: Cross-store Drag & Drop (e.g., dragging a User to a Project) can fail if both entities share the same ID (e.g., 1) but come from different stores. With internalId (#9070), every item has a globally unique neo-record-x identifier.

Task: Audit and update the Drag & Drop subsystems to leverage internalId for identifying dragged items.

Requirements:

  1. DragZone: Ensure that when a list/grid item is dragged, the dragData includes the internalId.
  2. DropZone: When dropping, use the internalId to resolve the original record from the source store, eliminating ambiguity.
  3. Proxy: Ensure the drag proxy element uses a stable ID.

Scope:

  • src/draggable/list/DragZone.mjs
  • src/draggable/grid/DragZone.mjs
  • src/draggable/DragZone.mjs
tobiu added the ai label on Feb 9, 2026, 11:50 AM
tobiu added the refactoring label on Feb 9, 2026, 11:50 AM
tobiu added the core label on Feb 9, 2026, 11:50 AM
tobiu cross-referenced by #9074 on Feb 9, 2026, 11:51 AM
tobiu added parent issue #9074 on Feb 9, 2026, 11:52 AM
tobiu referenced in commit 97855cc - "refactor: Ensure Drag & Drop Stability via 'internalId' (#9073)" on Feb 9, 2026, 1:32 PM
tobiu
tobiu Feb 9, 2026, 1:32 PM

Input from Gemini 3 Pro:

Task Completed: Ensure Drag & Drop Stability via 'internalId'

Objective: Ensure that Drag & Drop operations are robust against the new internalId logic (avoiding PK lookup failures) and fix critical regressions exposed by the refactor.

Key Fixes:

  1. Grid Header Sorting (SortZone.mjs):

    • Regression Fix: Fixed a critical issue where dragging columns containing heavy components (like OffscreenCanvas in Sparklines) destroyed the content.
    • Root Cause: onDragEnd called super.onDragEnd (which destroys the proxy) before moving the nodes back to the grid.
    • Solution: Reordered onDragEnd to restore DOM nodes from the proxy to the grid before initiating proxy destruction.
  2. List Drag & Drop (ListDragZone.mjs):

    • Robust Lookup: Updated setData to handle internalId correctly.
    • Logic: It first attempts store.get(recordId) (PK lookup). If that fails, it scans the store for a matching internalId. This ensures drag data is correctly populated even when List.Base eventually switches to using internalId for DOM keys.

Status: Grid Row Drag & Drop does not exist yet, so no changes were required there. The Drag & Drop subsystem is now stable.

tobiu assigned to @tobiu on Feb 9, 2026, 1:32 PM
tobiu closed this issue on Feb 9, 2026, 1:33 PM