LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 19, 2026, 12:45 PM
updatedAtNov 19, 2026, 6:42 PM
githubUrlhttps://github.com/neomjs/neo/issues/21475
authorneo-opus-grace
commentsCount0
parentIssue21140
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 19, 2026, 6:42 PM

A tree list moves an item into another folder by drag

Closed v14.0.0/archive-v14-0-0-chunk-4 enhancementaicoredrag-and-drop
neo-opus-grace
neo-opus-grace commented on Nov 19, 2026, 12:45 PM

Context

#21140's target gives the Trees group one card at the Engine 14 cut, a file explorer whose "items move by drag" (row Trees). Checked on 19 Nov (#21140 issuecomment-7006670970): the engine cannot do that today, so the card waits on this ticket and on its sibling for rename in place.

unowned-rationale: an engine feature the Trees card needs; a maintainer takes it when the band's examples are in review, and if it misses the lock (Sun 22 Nov 18:00 CET) the card rides the next cut.

The Problem

Neo.tree.List accepts dragResortable: true, which creates a Neo.draggable.tree.SortZone (src/tree/List.mjs, afterSetDragResortable). That class adds nothing to Neo.draggable.tree.DragZone: src/draggable/tree/SortZone.mjs is a 22-line subclass with only className and ntype, and DragZone.mjs (100 lines) marks draggable items and renders the proxy but has no drop logic. A visitor who drags a file onto a folder sees the proxy, and the item stays where it was.

The Architectural Reality

  • Neo.tree.List renders a flat store of records with parentId, isLeaf and collapsed (createItems, createItemLevel); onStoreRecordChange updates it when a record changes.
  • Neo.draggable.list.SortZone and Neo.draggable.container.SortZone are the sibling drop implementations: index computation from item rects, a move on drop, and the currentIndex/cancel paths that #20849 hardened.
  • Neo.draggable.tree.DragZone keeps leafNodesOnly and the drag-out-to-drop-zone path that examples/tree uses (draggable: true); dragResortable and draggable are mutually exclusive by design.

The Fix

Give Neo.draggable.tree.SortZone its drop logic. While a drag moves over the tree, the target is a gap before or after a sibling, or a folder, shown in place. On drop, update the record's parentId and its position among the new siblings, and let the list render from the store. A folder cannot move into itself or a descendant.

Acceptance Criteria

  • AC-1: A leaf dragged onto another folder ends up in it: its record's parentId is the folder's id, and the tree shows it there.
  • AC-2: A leaf dragged between two siblings lands between them, in the same folder or another.
  • AC-3: A folder dragged onto its own descendant is refused, and the tree is unchanged.
  • AC-4: A component spec covers AC-1 to AC-3 with real pointer drags; examples/tree's drag into its drop zone (draggable: true) keeps working.

Out of Scope

  • Dragging between two trees, or into another window.
  • Keyboard moves.
  • Rename in place: its own ticket.
  • Opening a closed folder while a drag hovers it. A drop onto a closed folder already moves the item into it; opening on hover needs a public way to open a folder on Neo.tree.List, which keyboard moves would share. (Moved here at intake, 19 Nov.)

Related

  • #21140 (the Trees row) · sibling pattern: Neo.draggable.list.SortZone (#21459 configures it for reorder by drag) · #20849

Live latest-open + closed sweep: checked latest 20 open (open count 77) + open and closed search ("tree drag move folder", "tree sortzone"; #20849 read) at 2026-11-19T11:44Z; no equivalent found. A2A in-flight sweep: no claim. Memory Core sweep: none. Own assignments: none on this surface.

Retrieval Hint: "tree list drag move item into folder SortZone drop logic"

Origin Session ID: d776ccf3-4f3f-4feb-a4ce-f480e6a65b0c