mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-26 01:14:22 +00:00
Closes the biggest gap in the move/drag UX surfaced by review #8: moving a parent taskRef should bring its subtasks along, not strand them under the previous sibling. Also closes #9 (drop indicator stuck if the drag leaves the iframe). Changes: - New moveContentSliceToIndex replaces moveBlockToIndex. It accepts a slice length so a single block (sliceLen=1) and a parent group (sliceLen = 1 + trailing subTaskRefs) share one implementation. Captures the slice's nodes and total size up front, applies a single delete + sequential insert. - sliceLenAt(idx) returns the atomic-move length: 1 for any block except a taskRef, parent.nodeSize + sum of immediately-following subTaskRefs for a parent. - Move up / Move down (block menu) now uses the slice. subTaskRef Move up/down refuses to cross the parent boundary; taskRef Move jumps past the previous / next group as a whole, not the next block. - Drag flow: pendingDrag captures fromIdx + sliceLen + sourceType at pointerdown. computeDropTarget snaps the target — subtask source stays inside its parent's range; parent source advances past any foreign subTaskRef run so the parent never lands between a different parent and its first subtask. The .is-dragging dim is applied to every block in the slice so the whole group lifts visually. - endBlockDrag now defends against drag-end never firing: window blur and document.documentElement pointerleave (with no relatedTarget, i.e. crossing the iframe boundary) abort any pending drag so the drop indicator and dim state don't stick. |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||