# Full-state runtime restore and Product 3D parts

This pass fixes two related integration problems found with the mixed Fabric + Babylon demo.

## Product 3D parts in Elements

A Product 3D can declare real logical parts in `product3d.parts` while still carrying an old, flat variation tree. The editor could display the detected meshes, but the Elements module only browsed the variation tree, so those parts disappeared after save/import.

The catalog is now normalized through `core/product3dParts.ts`:

- every editable multi-part product gets one top-level variation group per logical part;
- variation choices are scoped to that part and its `targetMeshIds`;
- add, edit, full-state import and the Elements module share the same normalization;
- legacy demo states that contain one generic `Whole product` part are upgraded from the mesh ids already stored in the Babylon scene;
- the matching runtime product record is upgraded too, so part-level variation changes work immediately after import.

Explicit single logical parts such as `Upper assembly` are not split automatically.

## Full-state import

During `importFull()`, the old mounted Fabric/Babylon runtime could unmount or switch views while the new document was being committed. Its persistence listeners then exported the old empty canvas/scene back into Zustand, overwriting the valid imported data.

The state-import guard is now shared with runtime persistence paths:

- Fabric before/after view-switch synchronization is suspended;
- Babylon scene/history timers and engine cleanup exports are suspended;
- the old 3D view-load cleanup cannot overwrite an imported scene;
- when an import switches from Babylon to Fabric, rebuilding waits until the replacement Fabric runtime is mounted;
- the demo importer waits for the public runtime transition and rebuilds the imported active Fabric view before reporting success.

The JSON format itself did not need a migration. Existing `asuka-modular-state` files remain supported.

## Mixed demo

`index.html` now declares the actual GLB parts:

- Body
- Front panel
- Cap
- Handle

Each part has White and Blue choices. The Elements module therefore displays the same logical structure that Babylon uses.
