Update CHAT_CONTEXT.md and related code for project JSON format and asset handling

This commit is contained in:
2026-03-31 17:45:18 +02:00
parent d0460613b0
commit 297176b2d6
3 changed files with 11 additions and 6 deletions

View File

@@ -43,8 +43,9 @@ It is not:
- Editor-authored mutations should flow through commands.
- The editor viewport is derived from the document.
- The runner is a sibling system, not an editor hack.
- Canonical save format is project JSON, not glTF/GLB.
- Export/package output is downstream from the document/runtime build.
- Canonical document format is project JSON, not glTF/GLB.
- Portable save/load for asset-bearing scenes should use a project package built around that JSON.
- Runner/deployment output is downstream from the document/runtime build and is separate from editable project save/load.
- Model instances are separate from typed entities.
---
@@ -76,6 +77,9 @@ These are fixed for the early milestones unless a later slice explicitly changes
- version the document from day one
- keep migrations explicit
- early project persistence can be local draft storage plus JSON import/export
- once binary assets exist, portable save/load should use a project package such as `scene.json` plus bundled assets
- canonical JSON stays the source document format underneath that project package
- runner package output is a separate deployable artifact
- binary assets must survive reload via embedded or project-scoped persistent storage
- never rely on Blob URLs as the only persisted asset reference

View File

@@ -818,6 +818,7 @@ export function App({ store, initialStatusMessage }: AppProps) {
}
if (!cancelled) {
loadedModelAssetsRef.current = {};
setLoadedModelAssets({});
}

View File

@@ -74,14 +74,14 @@ export function RunnerCanvas({
}
}, [onFirstPersonTelemetryChange, onInteractionPromptChange, onRuntimeMessageChange]);
useEffect(() => {
hostRef.current?.loadScene(runtimeScene);
}, [runtimeScene]);
useEffect(() => {
hostRef.current?.updateAssets(projectAssets, loadedModelAssets);
}, [projectAssets, loadedModelAssets]);
useEffect(() => {
hostRef.current?.loadScene(runtimeScene);
}, [runtimeScene]);
useEffect(() => {
hostRef.current?.setNavigationMode(navigationMode);
}, [navigationMode]);