Skip to content

feat(core): upgrade mjolnir.js for DoubleClickDrag recognizer#10416

Open
Pessimistress wants to merge 4 commits into
masterfrom
x/mjolnir-up
Open

feat(core): upgrade mjolnir.js for DoubleClickDrag recognizer#10416
Pessimistress wants to merge 4 commits into
masterfrom
x/mjolnir-up

Conversation

@Pessimistress

@Pessimistress Pessimistress commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Change List

  • Upgrade mjolnir.js to v3.0.1
  • Remove raw gesture handling from Controller class and use new recognizer
  • Test

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 Controller to mjolnir’s DoubleClickDrag recognizer.

RECOGNIZERS now registers dblclickdrag (with dblclick/click failure rules). The controller listens for dblclickdragstart / dblclickdragmove / dblclickdragend and applies zoom via event.scale and a stored anchor, instead of raw pointer* 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.

@coveralls

coveralls commented Jul 3, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 83.136% (+0.02%) from 83.112% — x/mjolnir-up into master

…blclick (#10418)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!

@chrisgervang

chrisgervang commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

The dblclickdrag recognizer is not in the click recognizer's requireFailure list, so it does not contribute to click delay being discussed in #10388. But, should it be included for the same reason dblclick is in the list?

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.

chrisgervang added a commit that referenced this pull request Jul 4, 2026
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 03074f5. Configure here.

chrisgervang added a commit that referenced this pull request Jul 4, 2026
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>
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.

4 participants