LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-sophie
createdAtNov 13, 2026, 7:41 AM
updatedAtNov 13, 2026, 1:54 PM
githubUrlhttps://github.com/neomjs/neo/issues/20861
authorneo-gpt-sophie
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 13, 2026, 1:54 PM

A live sort proxy restores into a filtered sibling slot

Closed v14.0.0/archive-v14-0-0-chunk-1 bugaitestingdrag-and-drop
neo-gpt-sophie
neo-gpt-sophie commented on Nov 13, 2026, 7:41 AM

Context

The live in-page proxy can restore a dragged component into the wrong native sibling slot when a visible sibling is excluded from sorting. A Node-only witness on admitted 1b12232214a5b36bec6ca0255c2b93b5ef51e3ed uses real Container, SortZone and DragProxyContainer start/end paths, with only native geometry/mount delivery stubbed and actual Neo.applyDeltas calls captured.

The Problem

For owner items [A, B, C], let A remain rendered but not sortable, then drag C without changing its slot:

  • Live-proxy creation inserts the placeholder at owner index2 and moves the original C into the proxy.
  • Sortable items are [B, placeholder].
  • Both Escape and same-slot release emit restoration of C at index1.
  • The owner model stays [A, B, C] and makes no reorder commit. The emitted physical order is therefore wrong.

The four-case witness has two intended failures (excluded prefix, both terminals) and two passing all-sortable controls. The failed invariant is:

restore index: received 1, expected 2
model commits: 0
owner items: [A, B, C]

Original component identities, start/end counts and proxy/placeholder cleanup pass. A native consumer also reproduced the resulting DOM order mismatch; the public unit witness is sufficient to reproduce the coordinate error without that consumer.

The Architectural Reality

  • src/draggable/DragZone.mjs#createDragProxy captures owner.items.indexOf(component) for inserting the live proxy's placeholder.
  • src/draggable/container/SortZone.mjs#processDragEnd currently obtains its restoration index from sortableItems.indexOf(dragPlaceholder).
  • The two arrays deliberately differ when a subclass excludes rendered siblings. getPinnedItems can keep those siblings fixed while only eligible items sort.
  • Dashboard remote entry has a distinct shape: it adds the placeholder to the target owner and uses that placeholder as the active sort component. Preserve this path and placeholder cleanup; a blanket lookup that skips cleanup on an absent component is not sufficient.

Design authority: #7203's live-proxy contract moves the actual component and returns it to the layout; current processDragEnd documents layout restoration. Cancellation and same-slot release must not silently reorder native siblings.

Prescription checked: the shared container SortZone owns the restoration delta and its coordinate domain. A consumer override would copy the lifecycle #20605/#20611 deliberately expose through hooks.

The Fix

Use the owner's coordinate domain for the local live-component restoration, consistent with proxy creation, rather than a filtered sortable index. Keep placeholder membership/cleanup separate from deciding whether a live component still has an owner slot. Verify the existing remote-placeholder path rather than introducing a new state field or lifecycle fork.

Extend the existing container SortZone unit spec with the four-case witness and the relevant cleanup/remote controls.

Contract Ledger

Surface Authority Required behavior Boundary Evidence
Live proxy terminal restoration DragZone creation + SortZone end restore into the owner's native item order excluded rendered siblings keep their positions real start/live-proxy/end unit deltas
Placeholder cleanup existing terminal lifecycle cleanup occurs once on both terminals preserve remote-owned placeholder handling terminal and remote controls
Model commit existing move/cancel contract cancellation and same-slot release write nothing ordinary reorder still commits once actual owner operation counts

Decision Record impact: none; repairs an existing coordinate mismatch.

Acceptance Criteria

  • With a visible excluded predecessor, Escape and same-slot release restore C to owner index2, not sortable index1; red before the fix and green after.
  • All-sortable controls retain their original behavior; model order and original component identities remain stable on no-op terminals.
  • Actual placeholder/proxy/snapshot cleanup completes once; remote-owned placeholder and removed-owner cancellation boundaries do not regress.
  • Ordinary committed reorder, existing container/dashboard/grid/tab SortZone unit coverage and applicable hosted native coverage remain passing.
  • No copied consumer lifecycle, new public config or sorting/ownership authority is introduced. Browser evidence, if run locally, is explicitly headless and non-disruptive.

Out of Scope

Scroll geometry, layout-heal policies, window-drag transfer decisions, presentation styling, and new hidden-item/native-child mapping semantics.

Avoided Traps

Using filtered indices for physical insertion; fixing only a consumer; losing placeholder cleanup when the original component is absent; changing remote adoption by assuming every active component is a locally retained one.

Related and ownership

#7203 · #20605 / #20611 · #20849 / #20851 · #20856 / #20859. Sophie owns the repair as part of active drag reliability; not a contributor handoff.

Live latest-open + closed sweep: latest20 open and closed SortZone-placeholder search, with #7203/#17353/#18025 scopes read; no equivalent found. Backlog29 open (orange); own assignment20185 is unrelated. Latest30 all-status A2A carries no competing restore claim. Three problem-framed Memory Core searches and KB found earlier live-proxy/scroll history, not this filtered-coordinate repair. Existing bug/ai/drag-and-drop/testing labels were verified during this session.

Origin Session ID: 9bf9ac41-3a89-436f-9bdb-2e38327937eb

Retrieval Hint: "live SortZone proxy restores filtered sortable index instead of owner index after excluded sibling"

tobiu referenced in commit 08dfefc - "fix(drag): restore live proxies in owner order (#20861) (#20862)" on Nov 13, 2026, 1:54 PM
tobiu closed this issue on Nov 13, 2026, 1:54 PM