From 00d1e211fedd423ce087b76e69281a958ceb44da Mon Sep 17 00:00:00 2001 From: Aculix Technologies Date: Sun, 16 Aug 2026 01:27:44 +0530 Subject: [PATCH] feat: kanban-style drag feedback with a real drop gap The old feedback was a card faded to 0.4 opacity and a 3px line above the target. The fade read as "disabled" rather than "held", and a thin line is a weak signal for where something lands. The dragged card lifts now: full opacity, accent border, raised shadow, a small scale and tilt. Cards it passes slide by the space it vacated, which opens a real gap at the destination. The gap can't disagree with where the card lands, because it is where the card lands. Also fixes something found while building it. targetIndexFor measured live rects, but those rows carry the shift transforms the drag applies, so the midpoints used to pick the target moved as a result of picking it and the choice oscillated. Slot geometry is captured once at drag start, relative to the list so scrolling mid-drag is fine. The displacement rule moves to src/lib/drag.js with tests. Its up/down boundaries are where off-by-ones live. --- src/App.svelte | 63 ++++++++++++++++++++++++++++++++++++---- src/lib/drag.js | 20 +++++++++++++ src/lib/drag.test.js | 69 ++++++++++++++++++++++++++++++++++++++++++++ src/style.css | 39 ++++++++++++++++--------- 4 files changed, 171 insertions(+), 20 deletions(-) create mode 100644 src/lib/drag.js create mode 100644 src/lib/drag.test.js diff --git a/src/App.svelte b/src/App.svelte index 8ce5b70..1fbf2d3 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,6 +1,7 @@