feat(shared-ui, todo): add cross-type drag & drop system with tag enrichment

Implement a two-layer DnD system in @manacore/shared-ui/dnd that coexists
with svelte-dnd-action (same-type reordering):

- Layer 1 (Pointer Events): dragSource + dropTarget actions for cross-type
  drags (e.g. Tag → Task). Mobile-first with long-press (300ms) and haptic
  feedback.
- Layer 2 (Passive Overlay): passiveDropZone action detects when
  svelte-dnd-action drags hover over external targets (e.g. Task → Tag pill,
  Task → Trash zone).
- DragPreview: floating pill that follows the finger/cursor during Layer 1
  drags.
- ActionZone: auto-appearing drop zones (trash, archive) during any drag.

Integrate into Todo app:
- TagStrip pills: draggable (dragSource) + accept tasks (passiveDropZone)
- TaskList items: accept tags (dropTarget) + register drags for passive layer
- ViewColumn + FokusLayout: register svelte-dnd-action drags for passive layer
- Layout: DragPreview + ActionZone (trash) added, tasks enriched with resolved
  label objects from shared tags so tag badges actually render on TaskItem.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-01 21:00:25 +02:00
parent 6dc259d743
commit 8409f8a8a2
16 changed files with 1343 additions and 297 deletions

View file

@ -26,6 +26,11 @@
"svelte": "./src/organisms/index.ts",
"types": "./src/organisms/index.ts",
"default": "./src/organisms/index.ts"
},
"./dnd": {
"svelte": "./src/dnd/index.ts",
"types": "./src/dnd/index.ts",
"default": "./src/dnd/index.ts"
}
},
"scripts": {