feat(viewer): unify spatial clipping, planning and observation surfaces

Share spatial clipping and height slices across live planning and recorded observations. Refine scene navigation, report serialization and viewer presentation.
This commit is contained in:
DCCONSTRUCTIONS
2026-10-29 09:10:01 +03:00
parent f48411f8fe
commit 7878937691
40 changed files with 464 additions and 138 deletions
@@ -0,0 +1,13 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {build} from 'esbuild';
const result=await build({entryPoints:[new URL('../src/core/heightSlice.ts',import.meta.url).pathname],bundle:true,write:false,platform:'node',format:'esm'});
const {heightSlice}=await import('data:text/javascript;base64,'+Buffer.from(result.outputFiles[0].contents).toString('base64'));
test('each boundary independently disables clipping and fractional native rounding restores full scene',()=>{
const bounds=[-51.4623,77.72065000000002];
assert.deepEqual(heightSlice([-51.4623,77.72065],bounds),{floor:null,ceiling:null});
assert.deepEqual(heightSlice([0,77.72065],bounds),{floor:0,ceiling:null});
assert.deepEqual(heightSlice([-51.4623,20],bounds),{floor:null,ceiling:20});
assert.deepEqual(heightSlice([2,20],bounds),{floor:2,ceiling:20});
assert.deepEqual(heightSlice([2,2],bounds),{floor:2,ceiling:2});
});
+2 -2
View File
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import { after, before, test } from "node:test";
import { createServer } from "vite";
import { createServer } from "./support/vite-server.mjs";
let server;
let mapView;
@@ -217,7 +217,7 @@ test("map workspace keeps the canonical top actions without a bottom toolbar", a
);
assert.doesNotMatch(source, /<Toolbar/);
assert.match(source, /className="mission-map__map-actions"/);
assert.match(source, /className="mission-map__map-actions nodedc-viewport-controls"/);
assert.match(source, /label="Настройки карты"/);
assert.match(source, /label="Слои карты"/);
assert.doesNotMatch(source, /label="Сбросить камеру"/);
@@ -10,6 +10,8 @@ test('planning live scene reuses the canonical vertical height range inside the
assert.match(source,/formatLimit=\{value=>value\.toFixed\(1\)\.replace\('\.',','\)\}/);
assert.match(source,/heightBounds=null/);
assert.match(source,/const CLIP_CEILING_M=80/);
assert.match(source,/max:CLIP_CEILING_M/);
assert.match(source,/setBounds\(next\);setCeiling\(null\);/);
assert.match(source,/max:Math\.max\(CLIP_CEILING_M,sourceBounds\.max,ceiling\?\?-Infinity\)/);
assert.match(source,/floor_m:floorRef\.current/);
assert.match(source,/value=\{\[floor\?\?rangeBounds\.min,ceiling\?\?rangeBounds\.max\]\}/);
assert.match(source,/floorRef\.current=null;setCeiling\(null\);setFloor\(null\);\s*\},\[runId\]\)/);
});