Skip to content

[pull] main from tldraw:main#567

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

[pull] main from tldraw:main#567
pull[bot] merged 3 commits into
code:mainfrom
tldraw:main

Conversation

@pull

@pull pull Bot commented Jun 1, 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 3 commits June 1, 2026 15:31
In order to stop callers from hanging forever when a debounced function
is cancelled mid-flight, this PR makes `debounce(...).cancel()` reject
the pending promise with `Error('Debounced function was cancelled')`.
Follow-up to a review note on #8604, where `cancel()` was updated to
release captured arguments but the pending promise was still left
unsettled.

Previously, `cancel()` cleared the pending timeout but never resolved or
rejected the in-flight promise — so any code that did `await
debouncedFn(...)` and then called `.cancel()` (or had it called
externally, e.g. via a hook cleanup) would hang forever. To avoid
breaking the common fire-and-forget pattern (`useZoomCss`,
`Editor.deepLink`, search debouncers, bookmark debouncer, VS Code change
responder, etc.), an internal no-op `.catch` is attached so callers that
discard the promise don't trigger unhandled-rejection warnings.
Consumers that `await` or chain `.then` / `.catch` on the returned
promise still observe the rejection through their own chain.

### Change type

- [x] `bugfix`

### Test plan

- [x] Unit tests

New tests cover:

- `cancel()` rejects all pending callers from the same debounce window
with the expected error.
- A fresh call after `cancel()` gets a brand-new promise (and verifies
state is reset cleanly).
- `cancel()` is a no-op when nothing is pending; double-cancel is safe.
- No `unhandledRejection` event fires when callers discard the promise
and call `cancel()` (verifies the fire-and-forget pattern is
unaffected).

### Release notes

- Fixed `debounce(...).cancel()` leaving any in-flight promise
unsettled. Calling `cancel()` while a debounced call is pending now
rejects the returned promise with `Error('Debounced function was
cancelled')`. Code that `await`s a debounced call across a cancel should
wrap it in `try/catch`.

### Code changes

| Section   | LOC change |
| --------- | ---------- |
| Core code | +21 / -3   |
| Tests     | +62 / -0   |

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… note (#8958)

In order to make list editing in note shapes behave like text and geo
shape labels, this PR stops `Tab` from creating a new adjacent note when
the caret is inside a bullet or ordered list. Closes #8713.

Previously the note's keydown handler always created a new note on
`Tab`, while the rich text editor's own keymap *also* indented the list
item on the original note. This produced two bugs: an unwanted new note
was created and focused, and the original note's list item was silently
indented. Now, when a bullet or ordered list is active, the handler
bails out early and lets the rich text editor indent the list item.

### Change type

- [x] `bugfix`

### Test plan

1. Create a note shape and start editing it.
2. Open the rich text toolbar and turn on a bullet list (or ordered
list).
3. Type some text, press `Enter` to start a second item, then press
`Tab`.
4. Confirm the second item is indented under the first and no new note
is created.
5. With no list active, confirm `Tab` still creates an adjacent note as
before.

### Release notes

- Fixed a bug where pressing `Tab` while editing a list inside a note
shape created a new note instead of indenting the list item.
Fixing the app example page for custom colors: the example did not take
reloading into account and when a shape is created with a custom style
unfortunately it crashes the app because we don't persist the new
additions to palette and fonts

### Change type

- [x] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`

### Test plan

1. go to example `/color-picker`
2. add a colour in the palette and some fonts
3. create a shape with new colour and font
4. reload 

- [ ] Unit tests
- [ ] End to end tests

### Release notes

- Fixed a bug in color-picker example that occurs when reloading the
canvas without persisting the added styles

Co-authored-by: Guillaume <guillaume@tldraw.com>
@pull pull Bot locked and limited conversation to collaborators Jun 1, 2026
@pull pull Bot added the ⤵️ pull label Jun 1, 2026
@pull pull Bot merged commit ed2a504 into code:main Jun 1, 2026
@pull pull Bot had a problem deploying to bemo-canary June 1, 2026 21:13 Failure
@pull pull Bot had a problem deploying to deploy-production June 1, 2026 21:13 Failure
@pull pull Bot had a problem deploying to npm deploy June 1, 2026 21:13 Failure
@pull pull Bot had a problem deploying to deploy-staging June 1, 2026 21:13 Failure
@pull pull Bot had a problem deploying to deploy-staging June 1, 2026 21:13 Error
@pull pull Bot had a problem deploying to npm deploy June 1, 2026 21:13 Failure
@pull pull Bot had a problem deploying to bemo-canary June 1, 2026 21:13 Failure
@pull pull Bot had a problem deploying to vsce publish June 1, 2026 21:13 Failure
@pull pull Bot had a problem deploying to deploy-staging June 2, 2026 00:58 Failure
@pull pull Bot temporarily deployed to e2e-dotcom June 2, 2026 02:38 Inactive
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.

3 participants