A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
test(viewport): preserve spatial view through tool selection
yhh8001dfb5b691
diff --git a/.github/workflows/editor-spatial.yml b/.github/workflows/editor-spatial.ymlnew file mode 100644index 000000000..02dd25341--- /dev/null+++ b/.github/workflows/editor-spatial.yml@@ -0,0 +1,60 @@+name: Editor spatial acceptance++on:+ workflow_dispatch:+ inputs:+ artifact-run:+ description: Build run with successful Web artifacts from identical runtime sources+ type: string+ required: true++permissions:+ contents: read+ actions: read++jobs:+ spatial:+ runs-on: ubuntu-latest+ timeout-minutes: 15+ env:+ ESTELLA_WIN_W: '1480'+ ESTELLA_WIN_H: '920'+ steps:+ - uses: actions/checkout@v7+ with:+ fetch-depth: 0+ - uses: ./.github/actions/editor-checkout+ with:+ ssh-key: ${{ secrets.EDITOR_SSH_KEY }}+ - uses: ./.github/actions/setup+ - name: Require identical runtime sources and a successful Web build+ env:+ GH_TOKEN: ${{ github.token }}+ ARTIFACT_RUN: ${{ inputs.artifact-run }}+ run: |+ [[ "$ARTIFACT_RUN" =~ ^[0-9]+$ ]]+ source=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$ARTIFACT_RUN" --jq .head_sha)+ git diff --exit-code "$source" HEAD -- src sdk native desktop include CMakeLists.txt package.json toolchain.manifest.json build-tools pipeline+ passed=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$ARTIFACT_RUN/jobs?per_page=100" --jq '[.jobs[] | select(.name == "Web (Emscripten)" and .conclusion == "success")] | length')+ test "$passed" -eq 1+ gh run download "$ARTIFACT_RUN" --repo "$GITHUB_REPOSITORY" --name wasm-web --dir build/wasm/web+ - name: Install the virtual display dependencies+ run: |+ sudo apt-get update+ sudo apt-get install -y xvfb libasound2t64 libgtk-3-0t64 libgbm1+ - name: Build the editor against the measured runtime+ run: |+ pnpm --filter ./sdk build+ mkdir -p desktop/public/wasm+ cp build/wasm/web/* desktop/public/wasm/+ pnpm --dir desktop exec vite build+ - name: Check trusted spatial gestures and undo+ run: node tools/verify-gizmo-planes.mjs+ - name: Keep spatial acceptance evidence+ if: always()+ uses: actions/upload-artifact@v7+ with:+ name: gizmo-planes-editor-checks+ path: output/gizmo-planes-ci+ if-no-files-found: warn+ retention-days: 3diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex cf9311860..2f8870784 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -28,6 +28,8 @@ export const NOTES_FLOOR = 'v0.65.0';* the reader recognises anyway.*/export const NOTED = {+ 'test(viewport): preserve spatial view through tool selection':+ { internal: 'Spatial acceptance uses the actual editor projection command so selecting a tool retains the store-owned view; a focused CI workflow can reuse a proven identical runtime.' },'test(viewport): retain spatial drag startup diagnostics':{ internal: 'CI spatial gesture acceptance preserves process output and reports startup failures before a trusted drag observation is available.' },'chore(release): classify editor capabilities for v0.86.0':diff --git a/tools/verify-gizmo-planes.mjs b/tools/verify-gizmo-planes.mjsindex 546d77b1c..85c8e9032 100644--- a/tools/verify-gizmo-planes.mjs+++ b/tools/verify-gizmo-planes.mjs@@ -23,7 +23,7 @@ try{const point=`(()=>{const g=window.__estellaEditor.gizmoLayout();if(!g?.spatial)throw Error('Missing spatial frame');${axis==='view'||axis==='xyz'?'return g.screen;':`const p=g.planes.find(p=>p.axis==='${axis}');if(!p)throw Error('Missing ${axis} plane');return {x:g.screen.x+p.corners.reduce((n,p)=>n+p.x,0)/4,y:g.screen.y+p.corners.reduce((n,p)=>n+p.y,0)/4};`}})()`;const run=runElectron(['.'],{via:'npx',encoding:'utf8',cwd:path.join(root,'desktop'),timeout:180000,env:{ESTELLA_SHOT:path.join(out,axis+'.png'),ESTELLA_SHOT_PROJECT:project,ESTELLA_SHOT_SCENE:'assets/scenes/main.esscene',- ESTELLA_SHOT_EVAL:`(async()=>{const e=window.__estellaEditor;e.runCommand('mode.scene');e.surface.setViewPerspective(true);e.surface.setViewOrbit(45,30);e.surface.select(1);e.frame([1]);await new Promise(r=>setTimeout(r,750));e.runCommand('tool.${mode}');return true;})()`,+ ESTELLA_SHOT_EVAL:`(async()=>{const e=window.__estellaEditor;e.runCommand('mode.scene');e.runCommand('view.toggleViewPerspective');e.surface.setViewOrbit(45,30);e.surface.select(1);e.frame([1]);await new Promise(r=>setTimeout(r,750));e.runCommand('tool.${mode}');const layout=e.gizmoLayout();if(!layout?.spatial)throw Error('Spatial view was reset before drag: '+JSON.stringify({view:e.editorView(),orbit:e.surface.viewOrbit(),layout}));return {view:e.editorView(),layout};})()`,ESTELLA_SHOT_EDITOR_DRAG:JSON.stringify({selector:'.viewport__stage canvas',point,dx:axis==='xyz'?58:11,dy:axis==='xyz'?0:7,read})}});fs.writeFileSync(path.join(out,axis+'.log'),run.stdout+'\n'+run.stderr);assert.equal(run.status,0,run.stderr);const line=run.stdout.split('\n').find(l=>l.startsWith('[editorDrag] '));assert(line,'Missing trusted spatial drag: '+axis+'\n'+run.stdout+'\n'+run.stderr);