Skip to content

Luma/v5.0#15

Open
kaznaan wants to merge 7 commits intov5.0.xfrom
luma/v5.0
Open

Luma/v5.0#15
kaznaan wants to merge 7 commits intov5.0.xfrom
luma/v5.0

Conversation

@kaznaan
Copy link
Copy Markdown
Collaborator

@kaznaan kaznaan commented May 8, 2026

Long-running integration branch for Luma's v5.0 patches on top of v5.0.x.

Change type

  • other

Test plan

  • Unit tests
  • End to end tests

API changes

Code changes

Section LOC change
Core code +95 / -26
Automated files +15 / -0

Rolled-up commits

kaznaan and others added 7 commits May 8, 2026 09:52
Add public setUniqueIdGenerator for custom ID generation
Add frame selection overhaul for grid shapes
* selecting assets now has no margin

* +1 px hover area

* Revert comment back

---------

Co-authored-by: Kazuho Okui <kazuho@lumalabs.ai>
@cursor
Copy link
Copy Markdown

cursor Bot commented May 8, 2026

PR Summary

Medium Risk
Touches core editor behaviors (rendering pipeline hook, hit-testing/selection logic, and descendant traversal), which could cause subtle interaction regressions. ID generation override also changes a cross-cutting primitive if misused by integrators.

Overview
Adds a new Editor.components.ShapeRenderer slot and exports DefaultShapeRenderer/TLShapeRendererProps, letting consumers override how getRenderingShapes() are mapped to React elements.

Adjusts selection/editing behavior: double-click-to-edit now respects ShapeUtil.canEditInReadonly when the editor is readonly, hit-testing avoids “margin bleed” for filled shapes (notably assets), and frame-like selection logic is tweaked to treat grid differently.

Reworks Editor.visitDescendants to an iterative, order-preserving traversal with cycle protection, and exposes a new public setUniqueIdGenerator() to override global uniqueId generation (in addition to existing test mocks).

Reviewed by Cursor Bugbot for commit 19fde0f. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Redundant readonly check after canEditShape guard
    • Removed the redundant readonly/canEditInReadonly check on lines 154-158 since canEditShape already guarantees this condition is satisfied when it returns true.

Create PR

Or push these changes by commenting:

@cursor push fc13a8d3cb
Preview (fc13a8d3cb)
diff --git a/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingShape.ts b/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingShape.ts
--- a/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingShape.ts
+++ b/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingShape.ts
@@ -151,13 +151,6 @@
 
 										if (!this.editor.canEditShape(selectingShape)) return
 
-										const util = this.editor.getShapeUtil(selectingShape)
-										if (this.editor.getIsReadonly()) {
-											if (!util.canEditInReadonly(selectingShape)) {
-												return
-											}
-										}
-
 										this.editor.setEditingShape(selectingShape.id)
 										this.editor.setCurrentTool('select.editing_shape')

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 19fde0f. Configure here.

if (!util.canEditInReadonly(selectingShape)) {
return
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant readonly check after canEditShape guard

Low Severity

The canEditInReadonly check on lines 154–158 is fully redundant with the canEditShape guard on line 152. canEditShape already returns false when getIsReadonly() is true and canEditInReadonly() is false (see Editor.ts line 2701). If canEditShape returns true, the readonly/canEditInReadonly condition here can never trigger. Additionally, setEditingShape internally calls canEditShape again, making this a third redundant layer.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 19fde0f. Configure here.

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.

3 participants