Context
Leaf of #21061, and the engine seam #21065 names: "If sort-on-drop needs an engine seam (for example a working list.SortZone), it is filed as its own engine ticket". The web desktop's launcher is a store-bound list.Base whose icons sit in a wrapped CSS grid, and its users must be able to reorder them.
The Problem
No engine primitive sorts a store-bound list by drag.
Neo.draggable.list.SortZone (src/draggable/list/SortZone.mjs) is an empty subclass of list.DragZone, which drags an item with a proxy and animates it back.
Neo.draggable.container.SortZone sorts a container's components along one axis. It swaps indices over a layout snapshot it measures itself, so it neither writes store records nor follows a wrapped grid.
There is also a latent defect in list.DragZone: it adds the neo-draggable delegate cls to the item vdom on store load only. list.Base#createItems() rebuilds vdom.cn from scratch on every filter and sort, so after the first re-render no item matches the drag:start delegate and the list can no longer be dragged.
The Architectural Reality
- The main thread already hit-tests.
Neo.main.draggable.sensor.Pointer#triggerStream resolves document.elementFromPoint(), and Neo.main.addon.DragDrop#getEventData ships that path as targetPath, with each node's rect, on every drag:move when the zone sets alwaysFireDragMove. The drag proxy is pointer-events: none (resources/scss/src/draggable/DragProxyComponent.scss), so the hit test sees the item under it. The App Worker needs no rect snapshot, and any layout works: rows, columns or a wrapped grid.
Store#updateRows() writes a batch as one change. A sorter with reapplyOnRecordChange: true re-sorts once, and Neo.data.TreeStore sorts each parent's children in its Structural Layer. TreeStore#getChildren() returns a parent's children across filters and expansion.
list.Base#afterSetDraggable() creates the zone from dragZoneConfig, so {module: list.SortZone} swaps it in.
- Design authority: n/a — new behavior. The
neo-draggable loss carries its defect excuse: a unit arm re-renders a draggable list through a filter and reads the cls, red on dev.
The Fix
list.Base#createItem() renders neo-draggable on every non-header item of a draggable list, so the affordance survives re-renders.
list.SortZone (alwaysFireDragMove: true):
- Slot. On
drag:move it reads targetPath for the first item of its own list that is a sibling of the dragged record (same parentId). The leading or trailing half of that item's rect along sortDirection puts the dragged record before or after it. A header, another parent's item, a gap or the dragged item itself keeps the current slot. Leaving the list restores the start order.
- Preview. It reorders the siblings' item nodes in the owner's vdom, and the dragged item stays in place as a placeholder (
neo-sort-source). Nothing is written to the store during the drag.
- Commit.
moveRecord(record, target, before) is the one commit path, for the pointer and for the keyboard. It renumbers sortField from 0 over every structural sibling, so filtered-out siblings keep their relative place. It writes once through store.updateRows() and fires sort. The list re-renders from the store's sort.
- Cancel. Escape (
drag:cancel) or a release outside the list re-renders from the store and animates the proxy back.
- SCSS for the placeholder (
resources/scss/src/draggable/list/SortZone.scss).
Acceptance Criteria
Out of Scope
- Moving a record to another parent, multi-record drags and auto-scrolling a long list.
- Keyboard bindings: each app binds its own keys to
moveRecord() (#21065 does).
- Touch tuning (#21075).
Related
Live latest-open + closed sweep: checked latest 20 open (60 open, red band; the owning epic #21061 takes this as a leaf) + open and closed search (list SortZone drag sort, neo-draggable list, list SortZone, list DragZone neo-draggable; closed hits #20849, #17353, #18781, #1473 read, none governs a list sort) + A2A last 15 + Memory Core (list reorder by drag, list SortZone) + own open assignments at 2026-11-16T01:36Z; no equivalent or prior exclusion found.
Origin Session ID: 7ceb0de7-6fcc-4777-879b-3a305deac77f
Retrieval Hint: "list SortZone drag sort records targetPath elementFromPoint updateRows sortField neo-draggable createItems"
Context
Leaf of #21061, and the engine seam #21065 names: "If sort-on-drop needs an engine seam (for example a working
list.SortZone), it is filed as its own engine ticket". The web desktop's launcher is a store-boundlist.Basewhose icons sit in a wrapped CSS grid, and its users must be able to reorder them.The Problem
No engine primitive sorts a store-bound list by drag.
Neo.draggable.list.SortZone(src/draggable/list/SortZone.mjs) is an empty subclass oflist.DragZone, which drags an item with a proxy and animates it back.Neo.draggable.container.SortZonesorts a container's components along one axis. It swaps indices over a layout snapshot it measures itself, so it neither writes store records nor follows a wrapped grid.There is also a latent defect in
list.DragZone: it adds theneo-draggabledelegate cls to the item vdom on storeloadonly.list.Base#createItems()rebuildsvdom.cnfrom scratch on everyfilterandsort, so after the first re-render no item matches thedrag:startdelegate and the list can no longer be dragged.The Architectural Reality
Neo.main.draggable.sensor.Pointer#triggerStreamresolvesdocument.elementFromPoint(), andNeo.main.addon.DragDrop#getEventDataships that path astargetPath, with each node's rect, on everydrag:movewhen the zone setsalwaysFireDragMove. The drag proxy ispointer-events: none(resources/scss/src/draggable/DragProxyComponent.scss), so the hit test sees the item under it. The App Worker needs no rect snapshot, and any layout works: rows, columns or a wrapped grid.Store#updateRows()writes a batch as one change. A sorter withreapplyOnRecordChange: truere-sorts once, andNeo.data.TreeStoresorts each parent's children in its Structural Layer.TreeStore#getChildren()returns a parent's children across filters and expansion.list.Base#afterSetDraggable()creates the zone fromdragZoneConfig, so{module: list.SortZone}swaps it in.neo-draggableloss carries its defect excuse: a unit arm re-renders a draggable list through a filter and reads the cls, red ondev.The Fix
list.Base#createItem()rendersneo-draggableon every non-header item of a draggable list, so the affordance survives re-renders.list.SortZone(alwaysFireDragMove: true):drag:moveit readstargetPathfor the first item of its own list that is a sibling of the dragged record (sameparentId). The leading or trailing half of that item's rect alongsortDirectionputs the dragged record before or after it. A header, another parent's item, a gap or the dragged item itself keeps the current slot. Leaving the list restores the start order.neo-sort-source). Nothing is written to the store during the drag.moveRecord(record, target, before)is the one commit path, for the pointer and for the keyboard. It renumberssortFieldfrom 0 over every structural sibling, so filtered-out siblings keep their relative place. It writes once throughstore.updateRows()and firessort. The list re-renders from the store's sort.drag:cancel) or a release outside the list re-renders from the store and animates the proxy back.resources/scss/src/draggable/list/SortZone.scss).Acceptance Criteria
sortFieldvalues change in oneupdateRows()batch, and the list renders the store's new order (unit).moveRecord()commits the same way without a pointer, and firessort(unit).neo-draggableon its items after a filter or sort re-render, red ondev(unit).Out of Scope
moveRecord()(#21065 does).Related
Live latest-open + closed sweep: checked latest 20 open (60 open, red band; the owning epic #21061 takes this as a leaf) + open and closed search (
list SortZone drag sort,neo-draggable list,list SortZone,list DragZone neo-draggable; closed hits #20849, #17353, #18781, #1473 read, none governs a list sort) + A2A last 15 + Memory Core (list reorder by drag, list SortZone) + own open assignments at 2026-11-16T01:36Z; no equivalent or prior exclusion found.Origin Session ID: 7ceb0de7-6fcc-4777-879b-3a305deac77f Retrieval Hint: "list SortZone drag sort records targetPath elementFromPoint updateRows sortField neo-draggable createItems"