Files
editor/packages
Wassim SAMADandClaude Opus 4.7 0540692bd5 item: fix 2D move — floor items stay parented to the level
Two related bugs caused floor items to disappear mid-2D-drag:

1. `startLevelId` did `parent.parentId` unconditionally for non-wall
   parents — so for a floor item parented directly to the level (the
   canonical convention from `use-placement-coordinator`), it returned
   `level.parentId = building.id`. `findContainingSurface` then iterated
   the building's children (levels, not slabs) and the fallback
   `parentId: startLevelId` reparented the item to the building. Now we
   walk the parent chain until we hit a `level` and short-circuit on
   `parent.type === 'level'`.

2. `buildSurfaceItemSession` reparented floor items to a slab when the
   cursor was over one. Slabs don't carry a `children` field on their
   schema (only ceilings + level do), so `updateNodesAction`'s reparent
   logic operated on `undefined.children` — the item dropped out of the
   level→children DFS the floor-plan layer walks, and the polygon
   stopped rendering mid-drag. Split into `buildFloorItemSession`
   (always parents to the level, just updates position) and a
   ceiling-only `buildSurfaceItemSession`. `findContainingSurface`
   narrows to `'ceiling'` as the only valid target.

Matches the 3D `detachItemSurfaceToFloor` convention: floor items live
as level children, not slab children.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 15:12:15 -04:00
..
2026-01-21 10:03:29 +09:00
2026-02-05 08:35:09 +09:00
2026-02-26 22:09:40 -05:00