Skip to content

[pull] main from tldraw:main#598

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

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

Conversation

@pull

@pull pull Bot commented Jun 17, 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 : )

kaneel and others added 2 commits June 16, 2026 21:38
Closes #8892 (partial — focused fix; no `EditorManager` base class or
full manager sweep).

I've had some more ideas for a suitable way to keep having the Editor
being the event emitter bus with every "managers" owning their events,
it has been spiked in #9204

## Summary

- `InputsManager` now subscribes to the editor's `frame` event and tears
down its own listener in `dispose()`.
- `TickManager` no longer hard-codes
`editor.inputs.updatePointerVelocity()`; it only drives the clock and
emits `frame` / `tick`.
- `Editor.dispose()` calls `removeAllListeners()` after emitting
`dispose`, and the strict-mode camera workaround is simplified to
`_setCameraState('idle')` only.

## Why

Issue #8892 flagged asymmetric lifecycle: `TickManager` drove updates
but didn't own the listeners they triggered. This moves pointer velocity
into a normal frame subscription owned by `InputsManager`, and
centralizes dispose-time listener cleanup on the editor.

The load-bearing strict-mode fix is resetting persisted `cameraState` to
`'idle'` when the editor is disposed — leftover tick listeners on a dead
editor instance were never the real bug.

## Test plan

- [x] `cd packages/editor && yarn test run TickManager InputsManager`
- [x] `cd packages/tldraw && yarn test run HandTool Editor setCamera`
- [x] `yarn workspace @tldraw/editor build-api` (no public API change on
`InputsManager`)

### API changes

- No public API changes for SDK consumers.
- Added `@internal` `InputsManager.dispose()` to the API report. This is
an editor lifecycle hook; do not call it from app code — use
`editor.dispose()` instead.
- `Editor.dispose()` now removes all event listeners after emitting
`dispose`. Custom `editor.on(...)` handlers are cleared when the editor
is torn down (expected for a disposed instance).

### Release notes

- Fix camera state getting stuck at `moving` when the editor is disposed
during camera movement (e.g. React strict mode with a shared store).
In order to ship the sidebar improvements with a reviewable history,
this PR is a clean-history reimplementation of
[`sidebar_improvements`](https://github.com/tldraw/tldraw/tree/sidebar_improvements).
The final tree is identical to that branch; the work is re-split into
focused commits so each step reads on its own. Review commit-by-commit.

The change reworks the dotcom sidebar and the workspace model around it:

- **Renameable home workspace** — the home/private workspace is now a
normal, named workspace. Its name no longer mirrors the user's profile
(migration `036` drops the name-sync trigger and defaults it to "My
workspace"), and the mutator layer allows renaming it while keeping it
private for invite/leave/delete/member actions.
- **Sidebar redesign** — the workspace switcher becomes a dropdown plus
dedicated action rows (new file, search, settings). The invite action
moves out of the switcher and into the workspace settings dialog.
- **Sidebar file search** — a new search action filters the file list as
you type, with match highlighting and an empty state.
- **File "Move to" checklist** — the menu now lists every workspace as a
checkbox with the current one checked.
- **Drag behavior** — dragging only reorders already-pinned files;
dragging into the pinned section no longer pins (pinning happens through
the menu).
- **Dev tooling** — the dotcom dev stack uses a single fixed set of
identifiers instead of per-branch ones, persisting local state across
branch switches and self-healing leftover per-branch stacks that hold
required ports.
- **SDK** — `TldrawUiIcon` gains a `tiny` (12×12) size.

### Change type

- [x] `feature`

### Test plan

1. Rename the home workspace from its settings dialog; confirm it
persists and the sidebar reflects the new name.
2. Open the sidebar search, type a query, and confirm the file list
filters with matches highlighted and a "No files found" empty state.
3. Use a file's "Move to" menu; confirm every workspace appears as a
checkbox with the current one checked.
4. Copy a workspace invite link from the workspace settings dialog.
5. Drag a pinned file to reorder it; drag an unpinned file into the
pinned section and confirm it does not pin.

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

### API changes

- Added `tiny` prop to `TLUiIconProps` / `TldrawUiIcon` for a 12×12 icon
size.

### Release notes

- Make the home workspace a normal, renameable workspace.
- Redesign the dotcom sidebar with a workspace switcher, dedicated
action rows, and file search.
- Move the workspace invite link into the workspace settings dialog.
- Show the file "Move to" menu as a checklist of every workspace.

### Code changes

| Section         | LOC change   |
| --------------- | ------------ |
| Core code       | +24 / -6     |
| Tests           | +175 / -144  |
| Automated files | +2 / -0      |
| Apps            | +970 / -612  |
@pull pull Bot locked and limited conversation to collaborators Jun 17, 2026
@pull pull Bot added the ⤵️ pull label Jun 17, 2026
@pull
pull Bot merged commit 74575c8 into code:main Jun 17, 2026
@pull
pull Bot had a problem deploying to bemo-canary June 17, 2026 03:13 Failure
@pull
pull Bot had a problem deploying to deploy-production June 17, 2026 03:13 Failure
@pull
pull Bot had a problem deploying to deploy-staging June 17, 2026 03:13 Error
@pull
pull Bot had a problem deploying to deploy-staging June 17, 2026 03:13 Error
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