Cut duplicated and dead code across the engines, the layers and the QA scripts

- src/geo drops the ported debug argument checks and the tests that
  bitExact already covers; package boundaries accept a directory entry,
  so src/geo/ is listed once per group.
- Cesium no longer carries movers and lines nobody draws with: they are
  optional engine capabilities. The fake engine and the Cesium camera use
  the shared cameraMath; unused contract tables, clock.ticked, the
  'finest' surface detail and Navara click statistics are gone.
- ALPR keeps one overlay core and one presentation model for both
  engines, bikeshare one station bookkeeping, the Navara ground effects
  one definition helper; image atlases, view centres, mover banks and
  colours are shared.
- The legacy switch route, the clock offset and rate controls and other
  unused exports are removed.
- The acceptance runs the Navara draw, geo import and scope checks;
  scenarios use the harness switch and page helpers; the main chunk
  check keeps the size budget only and runs once in CI.
This commit is contained in:
German Khokhlov committed 2026-11-05 13:32:39 +04:00
1 parent c502404e1d
commit 7abf74518f
272 files changed
+4828 -10213

No files matched your search

+4 -4
View File
@@ -666,8 +666,8 @@ export class StyleManager extends ShellFacade {
// production source explicitly registers entries.
initWorldOverlay(engine);
// Initialize detection overlay BEFORE style stages so the composite
// stage is first in the post-process pipeline. Both run on the engine
// (the Navara mode too: its layers arrive with Tasks 10a-13a).
// stage is first in the post-process pipeline. Both run on the engine,
// Navara's too.
{
initDetection(
engine,
@@ -2061,8 +2061,8 @@ export class StyleManager extends ShellFacade {
const handoff =
Boolean(layerSession?.handoffLayers) &&
!layerSession.lifetime.signal.aborted;
// A Context mode the next shell can resume (the legacy engine route,
// ?switch=legacy, still builds a shell per engine).
// A Context mode the next shell can resume when the session is handed to
// a new application.
const retainContext = handoff && this._contextControls.canRetainScene();
this._feedback.clearLoadingStatus();
this._disposed = true;
+2 -2
View File
@@ -142,7 +142,7 @@ export function readCameraTargetFrame(target, tracker) {
* @param {object} frame From {@link readCameraTargetFrame}.
* @param {object} [tracker] As in readCameraTargetFrame.
*/
export function setCameraTargetFrame(target, frame, tracker) {
function setCameraTargetFrame(target, frame, tracker) {
const engine = engineOf(target);
if (!engine || !frame?.target || !Number.isFinite(frame.range)) return false;
const viewer = trackerOf(target, tracker);
@@ -311,7 +311,7 @@ export function createCameraOrientationAnimator(
* showToast?: Function,
* animationMs?: number,
* }} options `engine` defaults to the one registered for `viewer`; the viewer
* is otherwise only read for its tracked entity (phase 1c).
* is otherwise only read for its clock and tracked entity.
*/
export function bindCameraOrientationControls({
viewer = null,
+3 -1
View File
@@ -18,8 +18,10 @@ import { createCesiumEngine } from '../globe/cesium/createCesiumEngine.js';
import { registerViewerEngine } from '../globe/cesium/engineFromViewer.js';
// The controls run on the globe engine; these viewer doubles get the Cesium
// engine registered for them, as the app's scene engine is.
// engine registered for them, as the app's scene engine is. A Viewer's
// canvas is its scene's.
function withEngine(viewer) {
viewer.canvas = viewer.scene.canvas;
registerViewerEngine(viewer, createCesiumEngine(viewer));
return viewer;
}
+3 -3
View File
@@ -11,7 +11,7 @@ import DrawControls from './views/panels/DrawControls.vue';
import GeoImport from './views/panels/GeoImport.vue';
import { AircraftDisplay } from './aircraftDisplay.js';
import { VisualSettings } from './visualSettings.js';
import { initGeoFileImport } from './geoFileImport.js';
import { createGeoFileImport } from './geoFileImport.js';
import { CockpitDisplayPortal } from './cockpitDisplayPortal.js';
// Core's classes on an element, without the kit's `ui-` classes.
const coreClasses = (el) =>
@@ -413,8 +413,7 @@ test('the imported files render what the file import publishes and keep focus',
scene: { requestRender() {} },
dataSources: { add: async (ds) => ds, remove: () => true },
};
const tool = initGeoFileImport({
viewer,
const tool = createGeoFileImport({
load: async (file) => ({
dataSource: { show: true },
name: file.name,
@@ -430,6 +429,7 @@ test('the imported files render what the file import publishes and keep focus',
return () => store.detach(token);
},
});
tool.attachScene({ viewer });
t.after(() => tool.destroy());
await tool.importFiles([{ name: '<b>a</b>.geojson' }, { name: 'b.kml' }]);
await nextTick();
+1 -13
View File
@@ -20,18 +20,6 @@ function localizedValues(values) {
);
}
/**
* Run the Import control on one viewer: the session's control (see
* createGeoFileImport) attached to `viewer`. Null without a viewer or the
* Import markup.
*/
export function initGeoFileImport({ viewer, ...options }) {
if (!viewer) return null;
const tool = createGeoFileImport(options);
tool?.attachScene({ viewer });
return tool;
}
/**
* The Import control for the page session.
* @param {{load?: Function, document?: Document, publish?: Function,
@@ -618,7 +606,7 @@ export function summarize(outcomes) {
* What the attached globe leaves out of the given files (each `{ name,
* undrawn }`): the first file's name and the total count.
*/
export function undrawnHint(items) {
function undrawnHint(items) {
return t('Map objects this engine leaves out of {name}: {count}.', {
name: items[0].name,
count: formatNumber(items.reduce((n, item) => n + item.undrawn, 0)),
+5 -12
View File
@@ -7,7 +7,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { initGeoFileImport, summarize } from './geoFileImport.js';
import { createGeoFileImport, summarize } from './geoFileImport.js';
import { GeoImportError, MAX_IMPORTED_FILES } from '../data/geoFileImport.js';
class FakeClassList {
@@ -105,8 +105,7 @@ function setup({ load, navigation, flyToSource, subscribeMapSource } = {}) {
revoke: () => revoked.push(file.name),
};
};
const tool = initGeoFileImport({
viewer,
const tool = createGeoFileImport({
load: load || defaultLoad,
document,
...(navigation ? { navigation } : {}),
@@ -120,6 +119,7 @@ function setup({ load, navigation, flyToSource, subscribeMapSource } = {}) {
return () => (actions = null);
},
});
tool?.attachScene({ viewer });
return {
tool,
els,
@@ -148,16 +148,9 @@ const ROW_ACTIONS = {
};
const press = (t, row, name) => t.act(ROW_ACTIONS[name], row.id);
test('returns null without its markup or viewer', () => {
test('returns null without its markup', () => {
const document = { getElementById: () => null };
assert.equal(initGeoFileImport({ viewer: {}, document }), null);
assert.equal(
initGeoFileImport({
viewer: null,
document: { getElementById: () => new FakeElement() },
}),
null,
);
assert.equal(createGeoFileImport({ document }), null);
});
test('a pick imports each file', async () => {
+1 -1
View File
@@ -10,7 +10,7 @@ import {
/**
* Own camera authority generations, pending search UI and tracking handoff.
* The camera is the globe `engine`'s. `viewer` is optional and only clears
* Cesium's tracked entity (entity tracking moves to the engine in phase 1c).
* Cesium's tracked entity.
*/
export class NavigationController {
constructor({
+1 -1
View File
@@ -6,7 +6,7 @@
// Reads answer from the outgoing settings' last state.
/** The visual choices kept for the next engine, by method name. */
export const PENDING_VISUAL_CHOICES = Object.freeze(
const PENDING_VISUAL_CHOICES = Object.freeze(
new Set([
'setStyle',
'setBloom',
+1 -1
View File
@@ -2,7 +2,7 @@ import { LayerStateCoordinator } from '../data/layerStateCoordinator.js';
import { APPLICATION_LAYER_DIRECTORY } from '../app/layers/directory.js';
/** How long the "kept in the link" notice stays up (ms). */
export const NOT_ON_THIS_ENGINE_DWELL_MS = 15_000;
const NOT_ON_THIS_ENGINE_DWELL_MS = 15_000;
/** Names of the layers a link turned on that this engine does not have. */
export function layersNotOnThisEngine(results) {
+1 -1
View File
@@ -18,7 +18,7 @@ import {
* reaches the engine. A value the engine refuses (NaN from an old link,
* say) stays here and is reported, as a Cesium uniform would just draw it.
*/
export function engineStyleStage(render, name, shader) {
function engineStyleStage(render, name, shader) {
const values = { intensity: 0 };
if (shader.fragmentShader.includes('uniform float time')) values.time = 0;
for (const [uniform, meta] of Object.entries(shader.uniforms || {}))