feat: add DragHandle and useDraggable to make toolbar draggable#880
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7942fdb The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@cursor review |
bd3c1c1 to
704297f
Compare
bdd4315 to
2f9cf4e
Compare
2de17c1 to
aafdaf6
Compare
2f9cf4e to
bde7c33
Compare
aafdaf6 to
88597c7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| ); | ||
| setPosition(clamped); | ||
| }); | ||
| }; |
There was a problem hiding this comment.
RAF throttle uses stale event, losing final drag position
Low Severity
The RAF throttle in onPointerMove drops intermediate events entirely and captures the stale moveEvent from the closure of the event that triggered the schedule, rather than the most recent event. When a new pointermove arrives while a RAF is pending, it's discarded (return), so the RAF callback processes an outdated position. Combined with cleanup cancelling the pending RAF on pointerup without applying a final position update, this can cause the toolbar to visibly snap back by several pixels on release during fast drags. The standard pattern stores the latest event coordinates in a mutable ref and reads them inside the RAF callback.
Additional Locations (1)
There was a problem hiding this comment.
Sounds benign enough, can come back if a real issue.
bde7c33 to
7942fdb
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #880 +/- ##
==========================================
+ Coverage 66.65% 66.79% +0.14%
==========================================
Files 205 207 +2
Lines 9032 9182 +150
Branches 1201 1224 +23
==========================================
+ Hits 6020 6133 +113
- Misses 2988 3025 +37
Partials 24 24
|



Description
Adds a drag handle to the toolbar v2 for drag-and-drop, so that it can be repositioned.
Note, as I commented in the module, the useDraggable hook was entirely generated with Claude. I mostly just verified the drag and drop behavior in the browser, and it works fine ✨
Screenshots or videos
CleanShot.2026-02-26.at.16.32.23.mp4