Add scene graph viewer and persist migration (#115)

Render an interactive Scene Graph in the Settings panel using @visual-json/react. Introduces SceneNode/SceneGraphNode types and buildSceneGraphValue to build a tree (handles missing nodes and cycles), and adds handlers to block drag/drop/context/delete mutations inside the viewer. Adds @visual-json/react to apps/editor package.json and updates the dev script to forbid .env.local and source the root .env instead. Also adds a persistence migration in use-scene to preserve existing nodes and rootNodeIds when the persist version changes.
This commit is contained in:
Aymeric Rabot
2026-02-24 00:40:18 -05:00
committed by GitHub
parent 5781e98270
commit db05c86120
4 changed files with 203 additions and 2 deletions
+3
View File
@@ -155,6 +155,9 @@ const useScene: UseSceneStore = create<SceneState>()(
{
name: 'editor-storage',
version: 1,
// Keep existing local scenes when the persist version changes.
migrate: (persistedState) =>
persistedState as Pick<SceneState, 'nodes' | 'rootNodeIds'>,
partialize: (state) => ({
nodes: Object.fromEntries(
Object.entries(state.nodes).filter(([_, node]) => {