Skip to content

[pull] main from tldraw:main#586

Merged
pull[bot] merged 2 commits into
code:mainfrom
tldraw:main
Jun 11, 2026
Merged

[pull] main from tldraw:main#586
pull[bot] merged 2 commits into
code:mainfrom
tldraw:main

Conversation

@pull

@pull pull Bot commented Jun 11, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

mimecuvalo and others added 2 commits June 11, 2026 16:08
#9139)

In order to fix the redo shortcut regressing on macOS, this PR changes
the held-key fallback guard added in #9099 so it only applies to
auto-repeat keydowns.

#9099 tracked which registration each physically-held key (keyed by
`event.code`) first triggered, and cleared that tracking on `keyup`. But
macOS swallows the `keyup` for non-modifier keys while `cmd` is held. So
after `cmd+z` (undo), the stale undo registration for `KeyZ` was never
cleared, and the next `cmd+shift+z` (redo) — which lands on the same
physical `KeyZ` — was suppressed as an "adjacent shortcut" and never
fired. Redo silently did nothing.

The fix only guards auto-repeat (`event.repeat`) keydowns, which is the
actual case #9099 targeted (holding `q` and releasing shift produces
auto-repeat `q` events). A fresh keypress is always free to trigger
whatever it matches, even on the same physical key, so `cmd+z` then
`cmd+shift+z` works regardless of whether the intervening `keyup` was
delivered. Holding `shift+q` and releasing shift still does not fall
back to plain `q`.

### Change type

- [x] `bugfix`

### Test plan

1. On macOS, draw something and make a couple of edits.
2. Hold `cmd` and press `z` to undo.
3. Keeping `cmd` held, press `shift+z` to redo.
4. Confirm redo fires (it previously did nothing).

- [x] Unit tests

### Release notes

- Fix redo (`cmd+shift+z`) not firing after an undo (`cmd+z`) on macOS
when cmd is kept held.
…pan (#9140)

In order to stop fast right-click pans from zooming the camera to 800%
on release, this PR passes a sanitized direction (`z: 0`) to
`slideCamera` in the right-mouse-button pointer-up path. The raw
pointer-velocity `Vec` was being passed directly, and `Vec.z` defaults
to 1 because it doubles as pen pressure; since #7858, `slideCamera`
interprets `direction.z` as a zoom direction, so the inertia fling
multiplied the zoom every tick until it hit the max-zoom clamp. The left
and middle button paths already sanitize the direction this way; this
brings the right-click path in line. Closes #9138. The underlying hazard
of `Vec.z` carrying different meanings across APIs is tracked separately
in #9146.

### Change type

- [x] `bugfix`

### Test plan

1. Open any tldraw canvas.
2. Right-click and drag quickly to pan, then release while still moving.
3. The camera glides to a stop at the same zoom level instead of jumping
to 800%.
4. Slow right-click pans and left/middle button (spacebar) pans behave
as before.

- [x] Unit tests

### Release notes

- Fixed a bug where releasing a fast right-click pan zoomed the camera
to the maximum zoom level.

### Code changes

| Section   | LOC change |
| --------- | ---------- |
| Core code | +4 / -1    |
| Tests     | +11 / -0   |
@pull pull Bot locked and limited conversation to collaborators Jun 11, 2026
@pull pull Bot added the ⤵️ pull label Jun 11, 2026
@pull pull Bot merged commit 23344c6 into code:main Jun 11, 2026
@pull pull Bot had a problem deploying to bemo-canary June 11, 2026 21:13 Failure
@pull pull Bot had a problem deploying to deploy-production June 11, 2026 21:13 Failure
@pull pull Bot had a problem deploying to deploy-staging June 11, 2026 21:13 Failure
@pull pull Bot had a problem deploying to vsce publish June 11, 2026 21:13 Failure
@pull pull Bot had a problem deploying to bemo-canary June 11, 2026 21:13 Failure
@pull pull Bot requested a deployment to deploy-staging June 11, 2026 21:13 Queued
@pull pull Bot had a problem deploying to deploy-staging June 12, 2026 01:00 Failure
@pull pull Bot deployed to e2e-dotcom June 12, 2026 02:38 Active
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants