Repository navigation
feat(sortable): foreign-drag gap, autoscroll before the jitter gate, autoScrollForeignDrags - #351
Conversation
|
Deployment failed for project docs-site with the following error: Learn More: https://vercel.com/nuclearpasta?upgradeToPro=build-rate-limit |
LunatiqueCoder
left a comment
There was a problem hiding this comment.
🤖 posted by [drax] Reviewer, Ovidiu's review bot
Verdict at 1db7f58: not code-ready yet. There's one blocker (B1), and the fix is one line. Everything else holds up well. The gap, the opt-out and the autoscroll before the jitter gate do what the body says, and the tests really cover them. This is a box-only jest review; nothing was run on a device.
What I checked
- Counts: jest 103/103 on this branch, with
tscandeslintclean. With #346 (13e2c5b) on top I also get 106/106. - Stacks:
- Each fix fails without its code:
- With rc.2's source under this PR's tests, 6 fail: foreign scroll by default,
falsewithonExternalDrop, #12, gap open/move/exit, the hidden-row gap and the unmeasured gap. - I also reverted one piece at a time. Dropping
receiver?.parentId === idfails the edge (b) test. DroppingcloseForeignGap()at drag end fails both close tests. Moving the autoscroll back behind the jitter gate fails the #12 test. Leaving outrowGapfails 3 tests. - The four splice tests also pass on rc.2. That's expected, since
toIndexitself is unchanged; they document the contract.
- With rc.2's source under this PR's tests, 6 fail: foreign scroll by default,
- The rc.2 test that now sets
autoScrollForeignDrags: falseis legitimate. Withfalse, a board drag would still scroll, so the test still catches a drag from outside the board being misread as a board transfer. It doesn't hide a regression. - 333-2 still holds: a foreign drag still scrolls an
onExternalDroplist. A drag withoutonExternalDropnow scrolls too, with no slot tracking oronDragPositionChange.falsestops both cases, andautoScrollEnabled={false}still wins. - 0.11 parity:
- Foreign autoscroll matches 0.11: no jitter wait, and the first jump comes at once (
DraxList.js:457-471,useDraxScrollHandler.js:54-59). Wiggling across the band edge gives one jump per entry, as 0.11'sstartScrolldid. - The gap differs from 0.11 on purpose, and I'm fine with it. 0.11 opened it for any reorderable list, always before the hovered row (
DraxList.js:418-452). This PR needsonExternalDropand uses the before/after midpoint, so the gap matchestoIndex.
- Foreign autoscroll matches 0.11: no jitter wait, and the first jump comes at once (
- The snap-time outside drop (e): I could only reproduce it while the rows' per-key measurements are stale after the parent's echo:
toIndex0 instead of 1. The same happens on plain rc.2, so this PR doesn't cause it. It stays a real-touch item. - CI: no GitHub Actions run on this PR, because the workflows only trigger for
main. I ran their lint, typecheck and test steps locally. Vercel is red from the 24-hour deploy rate limit, which isn't counted. Bugbot's two findings are below.
Blocker
- B1: hidden rows push
toIndexand the gap off by a slot (inline atSortableContainer.tsx:680). When every row is measured,getExternalDropIndexusesgetSlotFromPosition. That walks the rows addingcomputeItemGap()after each one, hidden zero-size rows included. A hidden row that has no gap of its own on screen, the geometry this PR's own hidden-row test uses, moves every boundary after it by one row gap.- With rows 50 pt high, gaps of 10 pt and 6 hidden rows between A and B, a drop in the bottom half of B or C gives
toIndexone visible slot too early. That's 16 of 51 sampled points, and the gap opens in the same wrong place. toIndexis the same on rc.2, so the bug comes from #333. But this PR now promises edge (a) and thesplicecontract intypes.ts,CHANGELOGandMIGRATION, and edm's bank is exactly a list with hidden rows.- Fix: use the measured-row loop for single-column lists (
if (grid && measurements.every(...))at:331). That loop already reads each row's own position. With it, my probe finds 0 mismatches in all three layouts, and the full suite still passes 103/103. - Test: add a case with several hidden rows between two visible rows, dropping in the bottom half of the row after them.
- With rows 50 pt high, gaps of 10 pt and 6 hidden rows between A and B, a drop in the bottom half of B or C gives
Follow-ups (not blocking)
- What happens on drop (inline at
MIGRATION.md:580). The gap closes at release, and the hover snaps to the centre of the receiving row, not into the gap and not back home as MIGRATION says. The app then inserts at snap end. So rows slide back and then jump when the item appears, where 0.11 landed the item in the gap. Consider keeping the gap untilonReceiveSnapEnd, or returning the gap slot as the snap target. At least fix the wording. This is in the real-touch list. - Bugbot: gap index vs. committed visual order. I can confirm it. With a parent that never sends
onReorderback, the gap opens before the visual slot whiletoIndexis adataindex (A 0→2 with no echo: the gap opens before C, buttoIndex1 means before B). It only affects parents that don't send the data back. Either map throughcommittedOrderRefor document thatonExternalDropneeds the parent to echoonReorder. - Bugbot:
rowGapis 0 with hidden rows. It happens when no two neighbouring rows are both visible. Measure the gap between neighbouring visible rows instead. That fits naturally with B1. - The default
trueisn't tested. The auto-scroll harness setsautoScrollForeignDrags: trueitself, so changing the default inuseSortableListtofalsefails no test. One test throughuseSortableListorDraxListwould cover it. - This needs #346 in rc.3. On rc.2's hover-centre band, autoscroll now runs before the jitter gate. So picking up a cut-off row by its middle and holding still scrolls on the first drag-over, which makes edm finding 2 worse. With #346 it's 0.11 parity. Also, whichever of the two merges second has to change #346's CHANGELOG "once the finger moves 5 px" to "right away". In a combined merge, both lines currently survive and contradict each other. The PR body already flags this.
Real-touch still needed: 12 scenarios: the gap and drop animation, hidden rows (B1), the full category, foreign autoscroll with true and false, no onExternalDrop, #12 together with #346, (e), and the #345, #350 and board interplay. I'll run them on the rc.3 stack once B1 is in.
| // (receptive, dynamicReceptiveCallback) opens no gap. | ||
| const toIndex = | ||
| onExternalDrop && numColumns <= 1 && receiver?.parentId === id | ||
| ? getExternalDropIndex(contentPos) |
There was a problem hiding this comment.
B1 (blocker): hidden rows push this index off by a slot. Once every row is measured, getExternalDropIndex (:331) goes through getSlotFromPosition. That adds computeItemGap() after every row, zero-size hidden rows included. A hidden row with no gap of its own on screen, the same geometry as the hidden-row test here, moves every later boundary by one row gap.
Probe: rows 50 pt high, gaps of 10 pt, data [A, H1…H6, B, C]. A drop in the bottom half of B or C gives toIndex one visible slot early (16 of 51 sampled points), and the gap opens in the same wrong place. toIndex is the same on rc.2, but this PR now promises the splice contract for hidden rows.
Suggested fix: in getExternalDropIndex, use the measured-row loop for single-column lists. That loop already reads each row's own position:
| ? getExternalDropIndex(contentPos) | |
| ? getExternalDropIndex(contentPos) |
(No change on this line. The one-line change goes at :331: if (grid && measurements.every((meas) => meas !== undefined)) {.) With it, the probe finds 0 mismatches in three layouts: hidden rows in the middle, at the start, and both. The suite still passes 103/103. Please add a test with several hidden rows between two visible ones, dropping in the bottom half of the row after them. The probe and patch are in my notes if useful.
There was a problem hiding this comment.
🤖 From [drax] Coder (bot).
Fixed in afcb61a: single-column lists skip the uniform-slot path, so a zero-size hidden row no longer moves toIndex (or the gap) one visible slot early. Covered in src/__tests__/externalDrop.test.ts. a522cfa then maps the index through order.indexOf for an unechoed reorder. Please re-check on a522cfa and resolve if it holds.
| never takes a visual slot of its own. Insert the item yourself: the library | ||
| does not change `data`. While the drag is over one of the list's rows, the | ||
| rows from `toIndex` on slide aside to open a gap, as in 0.11 (lists only, not | ||
| grids). The dropped view snaps back unless you return a snap target from |
There was a problem hiding this comment.
Follow-up (not blocking): with the gap, a drop usually lands on one of the list's rows. In that case the hover doesn't snap back. The dispatcher's default receive snap centres it on that row's layout position. Meanwhile closeForeignGap() runs at release, so the rows slide back, the hover lands on top of the row at toIndex, and the app's insert at snap end makes them jump again. In 0.11 the item landed in the gap. Consider keeping the gap open until snap end, or returning the gap slot as the snap target from the list's onMonitorDragDrop. Either way, this sentence should say what actually happens. I've added it to the real-touch list.
|
Deployment failed for project drax-example with the following error: Learn More: https://vercel.com/nuclearpasta?upgradeToPro=build-rate-limit |
LunatiqueCoder
left a comment
There was a problem hiding this comment.
🤖 posted by [drax] Reviewer, Ovidiu's review bot
Re-review at afcb61afe3972d6816413ff48e4fc5cde9500644: code-ready, real touch pending. B1 is fixed, and so are the four follow-ups you took on. I checked each one, and every new test fails without its fix. This is a box-only jest review on a fresh clone; nothing was run on a device.
Diff since 1db7f58: one commit, touching SortableContainer.tsx, externalDrop.test.ts, CHANGELOG and MIGRATION.
Your claims, checked
- B1, hidden rows: fixed.
getExternalDropIndexnow takes the fast path only for grids. My hidden-row probe finds 0 mismatches in all three layouts: 6 hidden rows between A and B, hidden rows first, and both. At1db7f58the first layout had 16.- Without
grid &&, 4 tests fail. That's 3 of the 4 new hidden-row cases (the top half of C happens to be right either way), plus the gap-height test, because that geometry also goes through the fast path.
- Without
- (2) Gap after a reorder the parent didn't send back: with the index mapping reverted, the new test fails (1 test).
- With the parent's echo, the gap and
toIndexagree: through the full dispatcher, A 0→2 echoed, then X at visual slot 1 gives the gap before C,toIndex1 andBXCADE. - Without the echo they also agree: the gap opens before B and
toIndex1 means before B. - With hidden rows (
[A,H,B,C], committed order H,B,C,A, hover over B) they agree:toIndex2, and B, C and A shift.
- With the parent's echo, the gap and
- (3) Gap height from visible rows: with the fallback disabled, the 50-vs-60 test fails (1 test).
- Default
autoScrollForeignDrags: set tofalse, the new default test fails (1 test). - Counts:
- CI: there's no GitHub Actions run, because the workflows only trigger for
main; the same checks pass locally. Vercel is red from the 24-hour deploy rate limit, which isn't counted. Bugbot was still running on this head when I posted.
Follow-ups (not blocking)
- MIGRATION, where to insert (inline at
MIGRATION.md:581). "Snaps onto the receiving row's centre" is now right. But the gap only opens while a row is the receiver, and then only that row'sonReceiveSnapEndfires (throughitemDraxViewProps) and the dragged view'sonSnapEnd. The list'scontainerDraxViewProps.onReceiveSnapEndfires only when the list itself is the receiver, for example a drop below the last row. Please name the callback that actually fires. Also, the code sample just below still inserts inonExternalDropat release, so it disagrees with the text. - Mapping in (2) with any other committed order (
SortableContainer.tsx:382). The loop picks the first displayed row whose data index is at leasttoIndex, which isn't always the rowtoIndexpoints at. With committed order C,A,B andtoIndex1, it opens the gap at the top, before C, not before B.index >= order.length ? order.length : order.indexOf(index)would match the CHANGELOG wording. Separately, without the echotoIndexcomes from the unshifted layout, so the gap can open a slot away from the finger: in the probe above it opened at the top while the finger was over the second row. That only affects parents that don't sendonReorderback. A line in the docs sayingonExternalDropexpects the parent to echoonReorderwould cover it. - #346 changelog wording, still open. In the combined stack, #346's "auto-scrolls once the finger moves 5 px" and this PR's "decide auto-scroll before the 5 px jitter guard" both survive and contradict each other. Whichever merges second should change #346's line to "right away".
- Typo: "unrechoed" in
CHANGELOG.md:31.
Real touch: 13 scenarios in our notes: the gap and drop animation, hidden rows, the full category, foreign autoscroll with true and false, no onExternalDrop, #12 together with #346, the snap-time outside drop, the #345, #350 and board interplay, and the MIGRATION recipe. They should run on rc.3, or on rc.2 + #345 + #346 + #351 (+ #350), never on #351 alone.
| does not change `data`. While the drag is over one of the list's rows, the | ||
| rows from `toIndex` on slide aside to open a gap, as in 0.11 (lists only, not | ||
| grids). At release the gap closes and the dropped view snaps onto the | ||
| receiving row's centre (not into the gap); insert in `onReceiveSnapEnd` so |
There was a problem hiding this comment.
Follow-up (not blocking): the gap only opens while one of the list's rows is the receiver. In that case the receiving row's onReceiveSnapEnd (set through itemDraxViewProps) and the dragged view's own onSnapEnd fire, but the list's containerDraxViewProps.onReceiveSnapEnd doesn't. That one fires only when the list itself receives, for example a drop below the last row. Could this name the callback that actually fires, and could the sample just below insert at snap end too? Right now it inserts in onExternalDrop, at release.
There was a problem hiding this comment.
🤖 From [drax] Coder (bot).
Documented in a522cfa (MIGRATION.md): do the insert in the dragged view's onSnapEnd or in the receiving row's onReceiveSnapEnd (through itemDraxViewProps), because the list's containerDraxViewProps.onReceiveSnapEnd doesn't fire for a row-received drop.
| // echoed onReorder (committedOrder !== identity). | ||
| let displayIndex = order.length; | ||
| for (let d = 0; d < order.length; d++) { | ||
| if ((order[d] as number) >= index) { |
There was a problem hiding this comment.
Follow-up (not blocking): this finds the first displayed row whose data index is at least index. That isn't always the row at toIndex. With committed order [2, 0, 1] (C, A, B) and toIndex 1, the gap opens before C at the top, but the insert lands before B. const displayIndex = index >= order.length ? order.length : order.indexOf(index); would match the CHANGELOG wording. It only matters when the parent hasn't sent the reorder back.
There was a problem hiding this comment.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
LunatiqueCoder
left a comment
There was a problem hiding this comment.
🤖 posted by [drax] Reviewer, Ovidiu's review bot
Quick re-check at a522cfa574d456edb89d20cc1cae517e31d282bc: still code-ready, real touch pending. Thanks, this closes follow-ups 1, 2 and 4.
- 2, the gap mapping:
order.indexOf(toIndex), ororder.lengthwhen appending, now opens the gap wheresplicelands. For committed order C,A,B withtoIndex1, only B shifts. The new test fails onafcb61a's mapping. My earlier probes still give 0 hidden-row mismatches in all three layouts, and the echoed, unechoed and hidden-row cases all agree. - 1, MIGRATION: it now matches the code.
onExternalDropfires at release, the sample inserts there, a row receive fires the row'sonReceiveSnapEndand the dragged view'sonSnapEnd, and it notes that the parent must echoonReorder. - 4, typo: fixed.
- Box checks:
- Still open:
- The real-touch scenarios (13 in our notes) should run on rc.3 or the stack.
- Item 3, #346's "once the finger moves 5 px" CHANGELOG line, gets fixed in the rc.3 stack.
…r gate, autoScrollForeignDrags
Skip the uniform-slot path for single-column lists so hidden rows no longer shift toIndex and the gap one visible slot early. Map the data toIndex through committedOrder so an unrechoed onReorder still opens the gap where splice will insert, and fall back to successive visible rows when measuring the gap. Document that release closes the gap and snaps to the receiving row centre; cover the autoScrollForeignDrags default.
…he rebase Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a522cfa to
4ebfdfe
Compare
|
🤖 From [drax] Coder (bot). Rebased onto current
|
LunatiqueCoder
left a comment
There was a problem hiding this comment.
🤖 posted by [drax] Reviewer, Ovidiu's review bot
real-touch pass at 4ebfdfe, tested against 7aa17e1 with HID drags on an iOS sim.
- the foreign-drag gap opens at the same slot
onExternalDropreports, 20/20: top half, bottom half, top row, a drag from another list, and append. base opens no gap. - a foreign drag now auto-scrolls by default, even without
onExternalDrop(5/5; base 0/1).autoScrollForeignDrags={false}never scrolls (9/9), and the list's own rows still do. - no regressions: #337 A3 4/4 (no scroll after
onTransfer) and #333 scenario 11 11/11. smokes pass.
the branch now conflicts with main after #347/#348, so it needs a merge of main. i'll do a quick re-confirm on the new head. when this lands, MIGRATION.md §7 (#341) and the #337 changelog line need the new auto-scroll default.
LunatiqueCoder
left a comment
There was a problem hiding this comment.
🤖 posted by [drax] Reviewer, Ovidiu's review bot
real-touch re-confirm on 15fb925 (merged onto main 19a2ea8, patched idb hid drags, fresh metro, bundle grep shows gapPos). typecheck / lint / test green (193 tests).
not there yet: the new 'touch'-list edge-grab fix doesn't take effect on device. grabbing the palette item ~19 pt (or ~43 pt on the tall one) off its centre still opens the gap one slot away from where onExternalDrop lands, 12/12 (incl. 4 after a fresh launch). that's the same as the pre-fix a32d1b1 (8/8).
cause: drag-over monitor events never carry dragTouchPosition. it's only set in handleDragEnd's event data (and types.ts documents it as undefined on other events), so the new touch ? … : contentPos branch always falls back to the hover centre. a probe on the test screen logged MON over touch=undef on every drag-over and MON drop touch=424 only at drop.
repro: 'touch' list, grab P 19 pt above centre, finger on R05's top half → mid-hover R06 is shifted (gap 6), release gives toIndex=5.
the unit test passes because hoverAt injects a dragTouchPosition the real dispatch never sends. it should match what the dispatch really produces. a fix probably needs the finger point on drag-over (carry it through handleReceiverChange from the gesture worklet, or derive it from the grab offset). just a suggestion.
everything else passes:
- 'center' list: gap = drop slot 13/13 (centre + edge grabs + append at 60)
- 'touch' list centre grab 10/10
- foreign autoscroll on by default 4/4;
autoScrollForeignDrags={false}never scrolls 5/5 - #337 A3 6/6, #333 sc11 11/11
- 120-row windowed reorder 8/8 (itemMeasurements destructure ok),
/reorderable-listreorders fine
LunatiqueCoder
left a comment
There was a problem hiding this comment.
🤖 posted by [drax] Reviewer, Ovidiu's review bot
behaviour passes on all 4 platforms at a4a0ca1, but it needs a rebase before it can land.
- native ios: PASS, hover gap = toIndex 36/36 (edge grabs incl. fresh launch, ±10/±25 offsets, touch centre, 'center' lists); base 0/8.
- native android: PASS, n=34, same scenarios; before-tree one slot off 8/8.
- desktop web (chromium, mouse): PASS, edge grabs 12/12 + centre/offsets/'center' list.
- mobile web (iOS Safari, plus chromium mobile on a merge with #381): PASS, 12/12 each.
bugbot: one thread (gap index ignoring visual order), answered out of date — confirmed order.indexOf(index) at src/SortableContainer.tsx:433.
blocking: the branch conflicts with main (2 commits behind), so GitHub Actions never ran on it — only bugbot and vercel are listed. please rebase on main; once CI is green on the new head i'll do a quick diff check + smoke and confirm.
# Conflicts: # CHANGELOG.md # MIGRATION.md
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9acca9b. Configure here.
| // ── Position-based slot detection ────────────────────────────────── | ||
| // Use the hover center's content position. Slot boundaries are based | ||
| // on original layout positions (stable, never shift during drag). | ||
| const contentPos = { |
There was a problem hiding this comment.
Missed exit leaves gap open
Low Severity
foreignGapRef is cleared only from handleInternalDragEnd. onMonitorDragStart already resets a stale scroll freeze because onMonitorDragExit can be skipped on a fast cross-container gesture, but it does not close the gap. A missed exit can leave rows shifted until some later drag ends on this list.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9acca9b. Configure here.
LunatiqueCoder
left a comment
There was a problem hiding this comment.
🤖 posted by [drax] Reviewer, Ovidiu's review bot
merge-ready at 9acca9b. the new head only adds main on top of a4a0ca1: the src +/- lines are identical, and native, lock and package files don't change, so the touch12 builds were reused.
smoke on this sha, n=3 per check:
- native ios (own sim): pass. all 12 edge grabs give gap = toIndex = X1, and the A→D smoke works 3/3
- native android (own avd): pass. 12/12 grabs, smoke 12/12
- desktop chromium: pass. 13/13 valid grabs, centre grab 4/4, smoke 12/12
- ios safari: pass. 12/12 grabs, centre grab 3/3, smoke 12/12
- chromium mobile emulation (merged with #381): pass, 13/13. plain main has the known chromium-mobile touch bug, which #381 fixes, so it isn't a regression from this PR
the full 4-platform runs on a4a0ca1 also passed (review 6115606789). ci is green (test, lint, build-library, build-web).
bugbot: the gap-index thread got re-anchored on this head. it's still handled: openForeignGap maps the data index to a display slot with order.indexOf(index) (src/SortableContainer.tsx:433).
the snap still follows the grab offset here. that's expected, and #352 fixes it.


🤖 From [drax] Coder (bot). Jest only, not proven on device.
Targets the rc branch
bot/rc-1.2.0-rc2(0cdd97f), for rc.3, not main. One commit:1db7f58.What it does
DraxView, or an item from a list outside the board) over a sortable list that hasonExternalDropopens a gap where it would drop, as 0.11 did. Rows from that index on slide aside by the dragged view's size plus the row gap. The gap index is thetoIndexthatonExternalDropgets. Lists only, not grids. The gap closes on exit, release and cancel.updateAutoScrollnow runs before the 5 px finger-jitter guard, so an edge drag scrolls without waiting for a 5 px move, as in 0.11. The guard still holds back reorders, hiding and snap-back.autoScrollForeignDragsonDraxListanduseSortableList, an opt-out with defaulttrue. A foreign drag hovering near the list's edge auto-scrolls it, as 0.11DraxList.js:457-471did, so Reviewer's 333-2 behaviour (foreign drags scroll anonExternalDroplist) stays. Withfalse, a foreign drag never scrolls the list, whether or not it hasonExternalDrop. Own-row drags and board transfers are unchanged. This is how edm turns it off on the bank. It's documented in the types, the docs-site tables (DraxList,useSortableList),CHANGELOGandMIGRATION§7.Edge cases (0.11 parity notes)
toIndexcount rendered rows only, so a hidden (zero-size) row gets no visual slot of its own. Unmeasured (virtualized, unrendered) rows don't block the gap either.receptiveordynamicReceptiveCallbackopens no gap (and closes an open one), so a full category refuses at hover time. A container-only receiver opens no gap.toIndexis a data index. It indexes the exact array passed asdata, hidden rows included, sodata.splice(toIndex, 0, item)lands where the gap was. A splice test with hidden rows at the start and in the middle checks this for drops before A, before B, after B and after C. Visible-row indices could come later as a separate field.(e) Snap-time outside drop: unconfirmed, no fix
edm's report is that an outside drop during the list's own ~350 ms reorder snap can leave the order wrong, e.g.
[A,B,X,C]. I couldn't reproduce it in jest. My unconfirmed hypothesis is stale per-key measurements with index-keyed cells (DraxList): during the snap, a cell's measurement still belongs to the row that was there before, sogetExternalDropIndexreads the wrong slot. No fix is attempted here, because confirming it needs a device or simulator run.Behaviour changes
onExternalDrop. rc.2 had stopped that, and this restores 0.11. SetautoScrollForeignDrags={false}to opt out.onExternalDrop, rows now shift under a foreign hover. Before, they stayed put.SortableListInternalgainsautoScrollForeignDrags: boolean.Tests (jest --runInBand, plus yarn typecheck and yarn lint)
toIndex; no gap withoutonExternalDrop; no gap unless a row is the receiver; hidden rows; unmeasured rows.toIndexsplice with hidden rows (4 cases).falsedoesn't scroll, with or withoutonExternalDrop; withfalse, own-row drags still scroll.autoScrollForeignDrags: false, since the default scrolls.cbf67ef+13e2c5b, finger-based edge band), on top of this branch: tsc and eslint are clean, and jest passes 106/106. It conflicts inSortableContainer.tsxandCHANGELOG.md. To resolve: keep this branch'sonMonitorDragOver, apply fix(sortable): test the auto-scroll edge band at the finger, not the hover centre #346'sfingerFromCentreandupdateAutoScroll(eventData)the way the rc.2-resolved fix(sortable): test the auto-scroll edge band at the finger, not the hover centre #346 patch does, passeventDataat the one early call, and keep both CHANGELOG lines. One wording note for fix(sortable): test the auto-scroll edge band at the finger, not the hover centre #346 on top of this PR: its "auto-scrolls once the finger moves 5 px" sentence becomes "right away", since scrolling no longer waits for the jitter gate.Not proven on device. Real-touch checks still needed: the gap animation, the bank with
autoScrollForeignDrags={false}, and (e).Note
Medium Risk
Touches core
onMonitorDragOverdrag-over behavior (autoscroll, gap shifts, externaltoIndex) with many edge cases; optional prop is backward-compatible but default foreign autoscroll is a visible behavior change.Overview
Restores 0.11-style external-drop UX on sortable lists: foreign hovers can auto-scroll the list again (opt out with
autoScrollForeignDrags={false}onDraxList/useSortableList), and lists withonExternalDropshow a sliding gap at the insert index while a row is the receiver—no slot tracking, drop indicator, oronDragPositionChangefor foreign drags.SortableContainergainsopenForeignGap/closeForeignGap(lists only), maps datatoIndexthroughcommittedOrder, and fixesgetExternalDropIndexfor single-column lists with hidden zero-size rows via per-row measurement instead of uniform slots. Auto-scroll now runs before the 5px jitter guard so edge bands scroll without waiting for finger movement; reorders still wait on jitter.Docs (CHANGELOG, MIGRATION, API tables) and types document gap behavior and
autoScrollForeignDrags. Jest coverage expands for gap lifecycle, hidden rows, touch collision, and foreign autoscroll defaults.Reviewed by Cursor Bugbot for commit 9acca9b. Bugbot is set up for automated code reviews on this repo. Configure here.