mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-07 10:31:46 +00:00
Migrates components and engine code from reading signals/engine.ts (cameraAspectRatio, editorState, gridVisibility, previewSrc) to reading the Zustand store. Components migrated to usePageEnigmaStore reads: - AspectRatioMenu (also dropped useSignals + collapsed two duplicated lookup ladders into ICON_BY_RATIO / LABEL_BY_RATIO) - PreviewFrameImage - Letterbox (no longer reactive via signals; reads camAspect from store) - StyleButtons (editorState, previewSrc, setEditorState) - Outliner (cameraAspectRatio) - SidePanelMenu (editorState + setEditorState) - ControlPanelSceneObject (editorState) - PreviewEngineCamera (cameraAspectRatio + editorState) - PageEditor (cameraAspectRatio for getScale; the signal version still flows into PromptBox3D as a prop) Engine code migrated to usePageEnigmaStore.getState(): - editor.ts: snapShotOfCurrentFrame reads cameraAspectRatio + grid; switchPreview / switchEdit set editorState - helper.ts: switchCameraView writes editorState - video_generation.ts: generateFrame writes previewSrc + editorState - SceneMetadata.ts: cameraAspectRatio for snapshot metadata - scene.ts: subscribes to store gridVisible (not the signal) signals/engine.ts becomes a thin compatibility layer for PromptBox3D's signal-typed props. Its setters dual-write into the store so any PromptBox3D-driven changes (grid toggle, aspect ratio dropdown) keep the store authoritative. editorState / previewSrc / setEditorState removed entirely -- nothing outside the store needs them anymore. Net effect on typecheck: 148 -> 147 errors in PageEnigma. Zero new errors introduced.