fix: group drag uses original trackId for offset math

Store trackId in multiIds at drag start. Each item computes
target from original track + crossOffset, immune to stale state
from previous drag events. Track 1 item drags n tracks -> track
1+n, track 2 item -> track 2+n, etc.
This commit is contained in:
2026-07-29 11:00:51 +07:00
parent ec355da58d
commit 8e8fc58082
3 changed files with 31 additions and 29 deletions
+6
View File
@@ -748,3 +748,9 @@
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
---
### [2026-07-29 11:00] Task: Fix group drag — use ORIGINAL trackId from drag start
- **Tóm tắt thay đổi:** Lưu `trackId: t.id` vào `multiIds` lúc bắt đầu drag. Dùng `inf.trackId` (original) để tính `origIdx + crossOffset` — không dùng `currentTrackMap` (live state có thể stale). Item track1 drag n track → track1+n, item track2+n track → track2+n.
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
---