perf(editor): per-node memo + own-slice subscriptions for floorplan registry
In split view, dragging any node re-rendered ALL ~150 per-node InteractiveGeometry instances every tick (profiler: InteractiveGeometry ×3192), because FloorplanRegistryLayer subscribed to the whole useLiveTransforms / useLiveNodeOverrides maps and the per-node component wasn't memoized. Extract a memoized FloorplanRegistryEntry that subscribes to ONLY its own slice (useLiveTransforms(s => s.transforms.get(id)) / overrides.get(id)). The live stores write a fresh value object for the changed node only, so unchanged nodes keep identity and don't re-render. The parent now watches just the stable node-id list; sibling invalidation (wall miters / opening cuts) moves to a store-subscribe that bumps only affected siblings' epoch. InteractiveGeometry is also memoized. Geometry cache, affected-sibling epochs, the base/overlay two-pass, hit-testing, and selection/hover are all preserved verbatim. An item move now re-renders only its own entry; a wall drag only the moving wall plus its linked-corner siblings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
5f603e83c4
commit
03284553aa