This prevents duplicating shapes if we get to the max allowed shapes. Before this change we would create as many shapes as we could and skip the rest. After this change we don't create any shapes in this case.
We already do this for copy pasting (via putContentOntoCurrentPage), so no change was needed there.
[ ] docs — Changes to the documentation, examples, or templates.
[ ] vs code — Changes to the vscode plugin
[ ] internal — Does not affect user-facing stuff
[ ] bugfix — Bug fix
[ ] feature — New feature
[x] improvement — Improving existing features
[ ] chore — Updating dependencies, other boring stuff
[ ] galaxy brain — Architectural changes
[ ] tests — Changes to any test code
[ ] tools — Changes to infrastructure, CI, internal scripts, debugging tools, etc.
[ ] dunno — I don't know
Test Plan
Create close to 2000 shapes.
Select so many shapes that duplicating them would go over the 2000 shapes per page limit.
Duplicate.
You should not create any shapes even if there is space for some of them.
[ ] Unit Tests
[ ] End to end tests
Release Notes
Prevent duplicating shapes if we would go over the maximum shape limit. It's now an all or nothing operation, where as before some shapes would get created.
This prevents duplicating shapes if we get to the max allowed shapes. Before this change we would create as many shapes as we could and skip the rest. After this change we don't create any shapes in this case.
We already do this for copy pasting (via
putContentOntoCurrentPage
), so no change was needed there.Resolves https://github.com/tldraw/tldraw/issues/3669
Change Type
sdk
— Changes the tldraw SDKdotcom
— Changes the tldraw.com web appdocs
— Changes to the documentation, examples, or templates.vs code
— Changes to the vscode plugininternal
— Does not affect user-facing stuffbugfix
— Bug fixfeature
— New featureimprovement
— Improving existing featureschore
— Updating dependencies, other boring stuffgalaxy brain
— Architectural changestests
— Changes to any test codetools
— Changes to infrastructure, CI, internal scripts, debugging tools, etc.dunno
— I don't knowTest Plan
Release Notes