13 Commits

Author SHA1 Message Date
geopenta
ed6ed3f018
fix(editor): release scene singletons on Editor unmount (#214)
The spatial-grid manager, scene-store subscriptions, and the viewer
outliner's Object3D arrays are module-level singletons that previously
lived for the whole page lifetime. When an app unmounted the Editor
(e.g. navigating away from the 3D editor and back in an SPA host) they
retained references to the disposed Three.js scene graph, which caused
the app to freeze on re-entry as the stale data was replayed against a
fresh scene.

- initSpatialGridSync now returns the unsubscribe handle from its
  scene-store subscription so callers can detach it.
- initializeEditorRuntime becomes reversible: it wires up the spatial
  grid, space detection and SFX bus on mount and returns a teardown
  closure that detaches both store subscriptions, clears the spatial
  grid manager, and truncates the viewer outliner's selected/hovered
  arrays in place.
- The Editor component's runtime-init effect now returns that teardown,
  so the singletons are reset cleanly every time the Editor unmounts.
- initSFXBus is now idempotent via an internal guard so repeated
  Editor mounts do not stack duplicate mitt listeners.

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-05 23:37:30 -04:00
wass08
f2501be2bf remove community 2026-03-13 09:07:46 +01:00
wass08
20f5f7ab4a fix wall elevation with slab holes 2026-02-24 10:27:51 +09:00
wass08
d15f601107 item scale 2026-02-23 10:59:42 +09:00
wass08
408fd8b87c slab polygons elevation 2026-01-27 19:20:01 +09:00
wass08
11aba2af36 draft item-system + elevation 2026-01-27 19:05:08 +09:00
wass08
e49ba32d18 attach to wall side 2026-01-23 12:33:50 +09:00
wass08
aaadec8add fix default spatial grid 2026-01-23 11:31:14 +09:00
wass08
5de0818633 biome 2026-01-21 10:03:29 +09:00
wass08
980dd4c3dc level items 2026-01-20 08:39:14 +09:00
wass08
f3456aed42 can place on wall 2026-01-19 09:32:46 +09:00
wass08
35a479df15 can place draft 2026-01-18 11:03:48 +09:00
wass08
8bf933ed36 draft spatial grid 2026-01-18 10:54:02 +09:00