Skip to content

fix: use overSlotIndex in onTimedAreaDrop to fix wrong-slot drops#309

Merged
jlunder00 merged 1 commit intomainfrom
fix/daytimeline-slot-position
May 6, 2026
Merged

fix: use overSlotIndex in onTimedAreaDrop to fix wrong-slot drops#309
jlunder00 merged 1 commit intomainfrom
fix/daytimeline-slot-position

Conversation

@jlunder00
Copy link
Copy Markdown
Owner

Problem

After PR #299 landed, drops on the DayTimeline timed area were still placed at the wrong slot. The pointer-events-none fix on TaskCards meant drops pass through to slot divs correctly, but the container's onTimedAreaDrop was still calling slotIndexFromClientY(e.clientY) — which depends on getBoundingClientRect() + scrollTop and gives wrong results when the timed area is scrolled.

Fix

onTimedAreaDrop now uses overSlotIndex.value ?? slotIndexFromClientY(e.clientY):

  • overSlotIndex is set by the slot div's @dragover handler via closure-captured i — exact, no coordinate math
  • The slotIndexFromClientY fallback only fires when overSlotIndex is null (drops in the hour-label gutter column, which has no slot divs)

Test Added

New flow test in DayTimelineDropZone.test.ts:

  1. dragenter on timed area
  2. dragover on [data-time="09:00"] slot div (sets overSlotIndex = 12)
  3. drop on container with clientY: 0 (would give slot 0 via math — wrong)
  4. Asserts promoteTask called with T09:00/T09:30, not T06:00

Anchor-to-Anchor

The anchor→anchor drop regression (task snaps back to source) is a separate pre-existing issue — this diff does not touch AnchorBlock.vue, useDropZone.ts, or PlanView.vue. Flagged for a separate task.

Test Results

553/553 tests pass. Build: zero type errors.

@jlunder00 jlunder00 merged commit ed91ef9 into main May 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant