From cfd644d40ecd33a7cab3651d5b9cfab00b1cb3f5 Mon Sep 17 00:00:00 2001 From: Wassim SAMAD Date: Tue, 2 Jun 2026 11:07:46 -0400 Subject: [PATCH] fix(editor): guard null bounds in box-select registry-selectable branch (#359) The registry-driven selectable branch in `collectNodeIdsInBounds` called `objectBoundsIntersectsBounds(node.id, bounds)` directly, but `bounds` is `Bounds | null` (null = select-all / no rectangle). Every other branch guards with `!bounds ||`; this one didn't, so `tsc --build` failed in consumers (`@pascal-app/nodes`) with TS2345 "Bounds | null not assignable to Bounds". Add the same guard, which also restores correct select-all behavior for registry-selectable kinds. Co-authored-by: Claude Opus 4.8 --- packages/editor/src/components/tools/select/box-select-tool.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/components/tools/select/box-select-tool.tsx b/packages/editor/src/components/tools/select/box-select-tool.tsx index 3862e1cc..1aa09ee7 100644 --- a/packages/editor/src/components/tools/select/box-select-tool.tsx +++ b/packages/editor/src/components/tools/select/box-select-tool.tsx @@ -285,7 +285,7 @@ function collectNodeIdsInBounds(bounds: Bounds | null): string[] { // Registry-driven selectable kinds (shelf + future furnish/structure // kinds) aren't in the hardcoded list above; pick them up by their // rendered bounding box, the same path column/stair use. - if (objectBoundsIntersectsBounds(node.id, bounds)) { + if (!bounds || objectBoundsIntersectsBounds(node.id, bounds)) { result.push(node.id) } }