Context
Found while reviewing #20851 (the #20849 repair). A headless unit witness fails the same way on dev 70b443e524 and on #20851's head 2c143ebecd, so the defect is inherited, not introduced. A container SortZone with three sortable items (column layout) overdrags past its end edge, steps 0 → 1 and arms its 30 ms poll. The gesture is then released (a normal onDragEnd, not a cancel), and the armed poll fires while processDragEnd waits in its first await me.timeout(10):
release index 1 (owner index 1)
poll fires inside the end wait: moveTo [{"from":0,"to":4}] expected [{"from":0,"to":1}]
poll fires after the end: moveTo [{"from":0,"to":1}] (control)Observed at unit level only (owner scroll mocked, timeouts held); the native frequency is not measured. The window is the end pipeline's 10 ms wait against the 30 ms poll period. It opens on any release past an edge before the drag reaches the last slot.
The Problem
The poll replays the pre-release pointer data after the user has let go: it steps currentIndex once more and switches. processDragEnd reads currentIndex only after its wait, so the drop commits one slot past where the user released: here sortable slot 2 (owner index 4) instead of 1.
The Architectural Reality
src/draggable/container/SortZone.mjs#onDragCancel clears isOverDragging synchronously, so a cancel retires an armed poll. #onDragEnd only latches. No writer clears the flag on a normal release; the writers are the cancel, the move itself, setReorderParked and grid/header/toolbar/SortZone#moveToGroupEdge. The control arm above still reads isOverDragging === true after the drop.
#processDragEnd awaits me.timeout(10) before it computes the commit (toIndex from sortableItems[me.currentIndex]) and before the end reset nulls itemRects. Inside that wait both of the poll's checks still pass: me.isOverDragging, and #20851's me.itemRects === itemRects, because the snapshot stays current until the reset.
- Every
processDragEnd override (grid, table and tab header toolbars, dashboard, dock tab strip) runs behind onDragEnd; the tab header's onDragEnd override calls super.
- Design authority:
test/playwright/e2e/grid/ColumnOverdragScroll.spec.mjs:30, "nothing switches after end (the mid-await drag-end race)". That spec releases at index 0, where polling has already stopped, so it never holds a poll armed at release.
The Fix
Clear isOverDragging when the end begins: in onDragEnd, after the latch, beside dragEndActive = true, as onDragCancel already does. The poll's existing re-check after its wait then returns. Checked against the witness on #20851's head: both arms commit 0 → 1, and the container, grid, dashboard and tab SortZone unit specs pass (76).
Add the witness to test/playwright/unit/draggable/container/SortZone.spec.mjs as a pair (the poll fires inside the end wait; the control fires after the end), reusing the continuation harness #20851 adds there.
Acceptance Criteria
Out of Scope
- An owner-scroll step already in flight at release. Its index step was taken before the release; retiring it would need a rollback of that step, a separate decision.
- The end pipeline's waits, and drag generations or queues (as in #20849).
Avoided Traps
- Relying on snapshot identity alone (#20851): the snapshot stays current until the end reset, so it cannot see a release.
- Shortening or removing
processDragEnd's 10 ms wait narrows the window without closing it.
- A grid-only patch: the poll lives in the container SortZone, which tab and toolbar sorts share.
Related
#20849 / #20851 retire the same continuation once its snapshot is replaced; this edits the same class, so it lands after #20851. #12906 added the end-only guards; #14980 gesture cancellation; #12880 was a different overshoot (in-bound cadence, closed).
Live latest-open + closed sweep: the latest 20 open (32 open, the orange band) and closed searches (SortZone overdrag release drop, SortZone isOverDragging; Out of Scope / Avoided Traps read on #12880 and #12906) at 2026-11-13T03:50Z; no equivalent or prior exclusion. A2A claims: the latest 30 messages carry none on this window. Memory Core ("column drop lands one slot past where it was released while autoscrolling at the grid edge"): no prior decision. Own assignments: #20790, #20778, no overlap.
unowned-rationale: Ready for a contributor once #20849 closes (same class); the drag-reliability lane may claim it first.
Origin Session ID: 8f0a219b-7bec-44b0-bd81-dc2671fed114
Retrieval Hint: "SortZone release during overdrag poll; end wait; drop commits one slot further; isOverDragging onDragEnd"
Context
Found while reviewing #20851 (the #20849 repair). A headless unit witness fails the same way on
dev70b443e524and on #20851's head2c143ebecd, so the defect is inherited, not introduced. A container SortZone with three sortable items (column layout) overdrags past its end edge, steps 0 → 1 and arms its 30 ms poll. The gesture is then released (a normalonDragEnd, not a cancel), and the armed poll fires whileprocessDragEndwaits in its firstawait me.timeout(10):release index 1 (owner index 1) poll fires inside the end wait: moveTo [{"from":0,"to":4}] expected [{"from":0,"to":1}] poll fires after the end: moveTo [{"from":0,"to":1}] (control)Observed at unit level only (owner scroll mocked, timeouts held); the native frequency is not measured. The window is the end pipeline's 10 ms wait against the 30 ms poll period. It opens on any release past an edge before the drag reaches the last slot.
The Problem
The poll replays the pre-release pointer data after the user has let go: it steps
currentIndexonce more and switches.processDragEndreadscurrentIndexonly after its wait, so the drop commits one slot past where the user released: here sortable slot 2 (owner index 4) instead of 1.The Architectural Reality
src/draggable/container/SortZone.mjs#onDragCancelclearsisOverDraggingsynchronously, so a cancel retires an armed poll.#onDragEndonly latches. No writer clears the flag on a normal release; the writers are the cancel, the move itself,setReorderParkedandgrid/header/toolbar/SortZone#moveToGroupEdge. The control arm above still readsisOverDragging === trueafter the drop.#processDragEndawaitsme.timeout(10)before it computes the commit (toIndexfromsortableItems[me.currentIndex]) and before the end reset nullsitemRects. Inside that wait both of the poll's checks still pass:me.isOverDragging, and #20851'sme.itemRects === itemRects, because the snapshot stays current until the reset.processDragEndoverride (grid, table and tab header toolbars, dashboard, dock tab strip) runs behindonDragEnd; the tab header'sonDragEndoverride callssuper.test/playwright/e2e/grid/ColumnOverdragScroll.spec.mjs:30, "nothing switches afterend(the mid-await drag-end race)". That spec releases at index 0, where polling has already stopped, so it never holds a poll armed at release.The Fix
Clear
isOverDraggingwhen the end begins: inonDragEnd, after the latch, besidedragEndActive = true, asonDragCancelalready does. The poll's existing re-check after its wait then returns. Checked against the witness on #20851's head: both arms commit0 → 1, and the container, grid, dashboard and tab SortZone unit specs pass (76).Add the witness to
test/playwright/unit/draggable/container/SortZone.spec.mjsas a pair (the poll fires inside the end wait; the control fires after the end), reusing the continuation harness #20851 adds there.Acceptance Criteria
isOverDraggingisfalseonce a release begins, as after a cancel.ColumnOverdragScroll.spec.mjspasses headless.Out of Scope
Avoided Traps
processDragEnd's 10 ms wait narrows the window without closing it.Related
#20849 / #20851 retire the same continuation once its snapshot is replaced; this edits the same class, so it lands after #20851. #12906 added the end-only guards; #14980 gesture cancellation; #12880 was a different overshoot (in-bound cadence, closed).
Live latest-open + closed sweep: the latest 20 open (32 open, the orange band) and closed searches (
SortZone overdrag release drop,SortZone isOverDragging; Out of Scope / Avoided Traps read on #12880 and #12906) at 2026-11-13T03:50Z; no equivalent or prior exclusion. A2A claims: the latest 30 messages carry none on this window. Memory Core ("column drop lands one slot past where it was released while autoscrolling at the grid edge"): no prior decision. Own assignments: #20790, #20778, no overlap.unowned-rationale: Ready for a contributor once #20849 closes (same class); the drag-reliability lane may claim it first.
Origin Session ID: 8f0a219b-7bec-44b0-bd81-dc2671fed114
Retrieval Hint: "SortZone release during overdrag poll; end wait; drop commits one slot further; isOverDragging onDragEnd"