From 19e8ac2f61bdec50cb8caf55c781d4e9a3c7e9a3 Mon Sep 17 00:00:00 2001 From: Aculix Technologies Date: Sun, 16 Aug 2026 01:33:51 +0530 Subject: [PATCH] fix: fluid drop instead of the whole list lurching Letting go of a card was abrupt and pulled its neighbours with it. Frame capture showed non-dragged rows moving about 68px after release, still going 13 frames later. Two things owned transform on the same elements: manual shift transforms for the gap, and animate:flip for the reorder. On drop, flip measured a "before" rect that already had a manual offset in it, then the order changed and the offsets cleared in the same update, so it animated toward a position that never existed. One owner each now. The list reorders as the pointer crosses each boundary rather than on release, so flip moves the displaced cards on its own, one swap at a time, and the swaps look right while you're dragging. Only the lifted card is positioned by hand, with flip off for it so it stays under the pointer. By release the order is already final, and nothing moves but that card settling. After the change, every non-dragged row moves 0px on release and the dropped card eases 4px into place. Slot geometry is replaced with offsetTop and offsetHeight, layout values that ignore transforms, so the target can't feed back into itself and can't go stale. Removes src/lib/drag.js and its tests. The rule they covered doesn't exist in this design any more. --- src/App.svelte | 132 ++++++++++++++++++++++++------------------- src/lib/drag.js | 20 ------- src/lib/drag.test.js | 69 ---------------------- src/style.css | 15 +++-- 4 files changed, 84 insertions(+), 152 deletions(-) delete mode 100644 src/lib/drag.js delete mode 100644 src/lib/drag.test.js diff --git a/src/App.svelte b/src/App.svelte index 1fbf2d3..e9c2543 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,5 +1,5 @@