diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-21 01:18:53 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-21 01:18:53 +0800 |
| commit | 0397c375acea763d3110163b045d259155ba2341 (patch) | |
| tree | 3873b99b5829b12ffc49a5ba10ed5fbaeb48a53b /src/SomhairlesDream.Frontend/Bindings.fs | |
| parent | 7b29dbff7e43e87741476f47df17ad1582b16546 (diff) | |
| download | somhairles-dream-fsharp-0397c375acea763d3110163b045d259155ba2341.tar.gz | |
feat(viewer): stream live pipeline GLBs into the browser viewport
Protocol: RunSnapshot gains CompletedSteps (accumulated from checkpoint
artifact paths, reset on start) so the frontend can tell when real
pipeline geometry exists. New coordinator method StepArtifact plus
GET /api/artifacts/steps serves steps/*.glb while a run is active (any
lifecycle status), traversal-guarded and .glb-only, so stages appear
without waiting for run completion.
Frontend: GLTFLoader loads the latest completed step into the viewport
group as soon as its checkpoint lands over SSE; replay placeholder
frames render only while no step artifacts exist. ?freeze=1 query param
stops rotation for deterministic screenshot verification. Three.js r160
and GLTFLoader (with BufferGeometryUtils) are vendored under public/
vendor with an import map and a window.THREE shim, replacing the CDN
UMD script; the ~1.4MB vendored three.js files are third-party
dependencies (MIT), not project assets.
Tests: store accumulation of completed artifact paths; steps endpoint
serves GLB during an active run, rejects traversal, 404s missing files.
Verified: dotnet build Debug+Release clean, 42/42 tests pass, Fable
compile clean, release server smoke serves index/vendor/steps endpoint.
Diffstat (limited to 'src/SomhairlesDream.Frontend/Bindings.fs')
| -rw-r--r-- | src/SomhairlesDream.Frontend/Bindings.fs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/SomhairlesDream.Frontend/Bindings.fs b/src/SomhairlesDream.Frontend/Bindings.fs index dc75d7d..9dbfa00 100644 --- a/src/SomhairlesDream.Frontend/Bindings.fs +++ b/src/SomhairlesDream.Frontend/Bindings.fs @@ -35,6 +35,19 @@ type ServerEvent = abstract data: string with get [<Erase>] +type GLTFScene = + abstract scene: ThreeNode with get + +[<Emit("new GLTFLoader()")>] +let createGLTFLoader () : obj = jsNative + +[<Emit("$0.load($1, $2, null, $3)")>] +let loadGLTF (loader: obj) (url: string) (onLoad: GLTFScene -> unit) (onError: obj -> unit) : unit = jsNative + +[<Emit("new URLSearchParams(window.location.search).get($0)")>] +let queryParam (name: string) : string = jsNative + +[<Erase>] type EventSource = abstract onerror: (obj -> unit) with get, set abstract onmessage: (ServerEvent -> unit) with get, set |
