Skip to content

fix: use clientX/clientY in drag-and-drop system#2

Merged
jonathan-beebe merged 1 commit into
mainfrom
fix/001-drag-drop-page-vs-client-coords
Mar 29, 2026
Merged

fix: use clientX/clientY in drag-and-drop system#2
jonathan-beebe merged 1 commit into
mainfrom
fix/001-drag-drop-page-vs-client-coords

Conversation

@jonathan-beebe
Copy link
Copy Markdown
Owner

Summary

  • Switches drag-and-drop coordinate system from pageX/pageY to clientX/clientY to match getBoundingClientRect() viewport-relative space
  • Fixes incorrect drop targets and positions when the page is scrolled (BUG-001)
  • Updates DragStartInfo interface, useDragAndDrop hook, and Card component

Test plan

  • All 208 existing tests pass
  • Added coordinate-system consistency test
  • Manual: scroll page, drag item between quadrants — should land in correct quadrant at correct position

🤖 Generated with Claude Code

The drag system compared pageX/pageY (page-relative) coordinates against
getBoundingClientRect() values (viewport-relative), causing incorrect
drop targets and positions when the page was scrolled. Switch to
clientX/clientY throughout to match the client coordinate space.

Fixes BUG-001.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jonathan-beebe jonathan-beebe force-pushed the fix/001-drag-drop-page-vs-client-coords branch from 7bcf0b5 to 1e404f6 Compare March 29, 2026 14:33
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 29, 2026

Deploy Preview for golden-scone-6bfeb1 ready!

Name Link
🔨 Latest commit 1e404f6
🔍 Latest deploy log https://app.netlify.com/projects/golden-scone-6bfeb1/deploys/69c9385a3fbbf100080f90a3
😎 Deploy Preview https://deploy-preview-2--golden-scone-6bfeb1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jonathan-beebe jonathan-beebe merged commit a50e9cd into main Mar 29, 2026
5 checks passed
@jonathan-beebe jonathan-beebe deleted the fix/001-drag-drop-page-vs-client-coords branch March 29, 2026 14:47
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