feat(core): upgrade mjolnir.js for DoubleClickDrag recognizer#10416
feat(core): upgrade mjolnir.js for DoubleClickDrag recognizer#10416Pessimistress wants to merge 4 commits into
Conversation
…blclick (#10418) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
chrisgervang
left a comment
There was a problem hiding this comment.
Thanks for the cleanup!
|
The click: [Tap, {event: 'click'}, null, ['dblclick', 'dblclickdrag']]I think it should be in the list to avoid spurious clicks, and then if we agree on prioritizing responsiveness, I'd consider disabling it by default along the same lines as #10422. |
Same principle — once #10416 lands, dblclickdrag should be in click's requireFailure list to prevent spurious clicks before a drag-zoom. That would reintroduce the 300ms delay, so disable by default too. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 03074f5. Configure here.
| dblclick: [Tap, {event: 'dblclick', taps: 2}], | ||
| click: [Tap, {event: 'click'}, null, ['dblclick']] | ||
| click: [Tap, {event: 'click'}, null, ['dblclick']], | ||
| dblclickdrag: [DoubleClickDrag, {event: 'dblclickdrag'}, ['dblclick', 'click'], null] |
There was a problem hiding this comment.
Click ignores double-click-drag failure
Medium Severity
Adding the dblclickdrag recognizer leaves the click Tap configured to wait only for dblclick to fail. After a double-click-and-drag zoom, the single-click recognizer can still emit a click, so Deck’s onClick path may run when the user only intended the drag-zoom gesture.
Reviewed by Cursor Bugbot for commit 03074f5. Configure here.
Same principle — once #10416 lands, dblclickdrag should be in click's requireFailure list to prevent spurious clicks before a drag-zoom. That would reintroduce the 300ms delay, so disable by default too. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>


Change List
Note
Medium Risk
Changes core map interaction (double-click-drag zoom) and depends on new mjolnir recognizer behavior; regression risk is mainly touch/mouse gesture edge cases, not auth or data.
Overview
Upgrades mjolnir.js to 3.0.1 and moves double-click-drag zoom from hand-rolled pointer/tap timing in
Controllerto mjolnir’sDoubleClickDragrecognizer.RECOGNIZERSnow registersdblclickdrag(withdblclick/clickfailure rules). The controller listens fordblclickdragstart/dblclickdragmove/dblclickdragendand applies zoom viaevent.scaleand a stored anchor, instead of rawpointer*events and local double-tap heuristics. Pan/pinch no longer need special-case blocking during that gesture.Tests and controller harness cases were updated to fire the new event types.
Reviewed by Cursor Bugbot for commit 03074f5. Bugbot is set up for automated code reviews on this repo. Configure here.