mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Merge remote-tracking branch 'origin/main' into german/cctv-camera-counts
# Conflicts: # src/layers/cctv/lifecycle.test.mjs
This commit is contained in:
commit
2b7a6b0c63
1463 files changed
+48705
-10313
No files matched your search
@@ -20,13 +20,31 @@
|
||||
* request runs at a time, with a pause between requests, and a refusal's
|
||||
* Retry-After is honoured.
|
||||
*
|
||||
* With `--tiles`, the same query between `--min-population` and
|
||||
* `--max-population` (1,000 and 15,000 by default) builds the detail tiles
|
||||
* instead, and writes only to:
|
||||
*
|
||||
* src/data/local_data/wikidata_places/
|
||||
*
|
||||
* replacing that folder's tiles, `index.json` and `files.js` (see
|
||||
* scripts/wikidataPlaceTiles.mjs). The checks that well-known cities are
|
||||
* present apply to the cities pack only.
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/build-wikidata-cities.mjs [--min-population 15000]
|
||||
* node scripts/build-wikidata-cities.mjs --tiles [--min-population 1000] [--max-population 15000]
|
||||
*/
|
||||
|
||||
import { mkdir, writeFile } from 'node:fs/promises';
|
||||
import { mkdir, readdir, readFile, rm, writeFile } from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import {
|
||||
keepBuiltIfUnchanged,
|
||||
keepPackBuiltIfUnchanged,
|
||||
placeTileFiles,
|
||||
withoutCities,
|
||||
withoutNearTwins,
|
||||
} from './wikidataPlaceTiles.mjs';
|
||||
|
||||
const ENDPOINT = 'https://query.wikidata.org/sparql';
|
||||
const USER_AGENT =
|
||||
@@ -37,11 +55,23 @@ const LABEL_BATCH = 400;
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const flag = (name) =>
|
||||
args.includes(name) ? Number(args[args.indexOf(name) + 1]) : NaN;
|
||||
const minPopulation = flag('--min-population') || 15000;
|
||||
args.includes(name) ? Number(args[args.indexOf(name) + 1]) : undefined;
|
||||
const tilesMode = args.includes('--tiles');
|
||||
const minPopulation = flag('--min-population') ?? (tilesMode ? 1000 : 15000);
|
||||
const maxPopulation =
|
||||
flag('--max-population') ?? (tilesMode ? 15000 : Infinity);
|
||||
if (!(maxPopulation > minPopulation))
|
||||
throw new Error('--max-population must be above --min-population');
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const outDir = path.join(root, 'src/data/local_data/wikidata_cities');
|
||||
const outDir = path.join(
|
||||
root,
|
||||
tilesMode
|
||||
? 'src/data/local_data/wikidata_places'
|
||||
: 'src/data/local_data/wikidata_cities',
|
||||
);
|
||||
|
||||
/** A file's text, or undefined when there is none yet. */
|
||||
const readIfThere = (file) => readFile(file, 'utf8').catch(() => undefined);
|
||||
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
const qid = (uri) => uri.slice(uri.lastIndexOf('/') + 1);
|
||||
|
||||
@@ -222,7 +252,7 @@ const grouped = new Set();
|
||||
const settled = new Set();
|
||||
|
||||
const places = new Map();
|
||||
for (const [low, high] of bands(minPopulation, Infinity)) {
|
||||
for (const [low, high] of bands(minPopulation, maxPopulation)) {
|
||||
console.log(`Population ${low}–${Number.isFinite(high) ? high : '∞'}…`);
|
||||
const rows = await bandRows(low, high);
|
||||
let kept = 0;
|
||||
@@ -434,7 +464,7 @@ if (intruders.length) {
|
||||
`Groupings got in: ${intruders.map(([id, name]) => `${name} (${id})`).join(', ')}`,
|
||||
);
|
||||
}
|
||||
if (missing.length) {
|
||||
if (missing.length && !tilesMode) {
|
||||
throw new Error(
|
||||
`Expected cities are missing: ${missing.map(([id, name]) => `${name} (${id})`).join(', ')}`,
|
||||
);
|
||||
@@ -450,6 +480,53 @@ const meta = {
|
||||
};
|
||||
|
||||
await mkdir(outDir, { recursive: true });
|
||||
if (tilesMode) {
|
||||
// Places the cities pack already has stay out of the tiles: an item with
|
||||
// one stated population under the cut-off and another over it is in both
|
||||
// query ranges. Build the cities pack first.
|
||||
const citiesFile = path.join(
|
||||
root,
|
||||
'src/data/local_data/wikidata_cities/cities.json',
|
||||
);
|
||||
const cityIds = JSON.parse(await readFile(citiesFile, 'utf8')).rows.map(
|
||||
(row) => row[5],
|
||||
);
|
||||
const outsideCities = withoutCities(rows, cityIds);
|
||||
console.log(
|
||||
`${rows.length - outsideCities.length} places left to the cities pack`,
|
||||
);
|
||||
// One place listed twice nearby under one name keeps its larger listing.
|
||||
const tileRows = withoutNearTwins(outsideCities);
|
||||
console.log(`${outsideCities.length - tileRows.length} near twins left out`);
|
||||
const files = placeTileFiles(tileRows, {
|
||||
...meta,
|
||||
count: tileRows.length,
|
||||
maxPopulation,
|
||||
});
|
||||
// The new files are all written before tiles from an earlier build that
|
||||
// this one has no rows for go, so a build that stops part way never leaves
|
||||
// an index naming a removed tile.
|
||||
const earlier = new Map();
|
||||
for (const name of await readdir(outDir))
|
||||
if (/^-?\d+_-?\d+\.json$|^index\.json$|^files\.js$/.test(name))
|
||||
earlier.set(name, await readFile(path.join(outDir, name), 'utf8'));
|
||||
keepPackBuiltIfUnchanged(files, earlier);
|
||||
for (const [name, text] of files)
|
||||
await writeFile(path.join(outDir, name), text);
|
||||
for (const name of await readdir(outDir))
|
||||
if (/^-?\d+_-?\d+\.json$/.test(name) && !files.has(name))
|
||||
await rm(path.join(outDir, name));
|
||||
console.log(
|
||||
`Wrote ${tileRows.length} places in ${files.size - 2} tiles to ${path.relative(root, outDir)}`,
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
const file = path.join(outDir, 'cities.json');
|
||||
await writeFile(file, `${JSON.stringify({ meta, rows })}\n`);
|
||||
await writeFile(
|
||||
file,
|
||||
keepBuiltIfUnchanged(
|
||||
`${JSON.stringify({ meta, rows })}\n`,
|
||||
await readIfThere(file),
|
||||
),
|
||||
);
|
||||
console.log(`Wrote ${rows.length} places to ${path.relative(root, file)}`);
|
||||
@@ -227,6 +227,7 @@
|
||||
"src/ui/panelMeasurement.js",
|
||||
"src/ui/panelRailGeometry.js",
|
||||
"src/ui/panelRails.test.mjs",
|
||||
"src/ui/hudSonarStyle.test.mjs",
|
||||
"src/panelStackLayout.js",
|
||||
"src/ui/applicationShortcuts.js",
|
||||
"src/ui/styleParameters.js",
|
||||
@@ -296,6 +297,9 @@
|
||||
"src/ui/contextControls.js",
|
||||
"src/ui/contextControls.test.mjs",
|
||||
"src/ui/contextLayerChanges.js",
|
||||
"src/ui/spaceMissionsControls.js",
|
||||
"src/ui/spaceMissionsControls.test.mjs",
|
||||
"src/ui/stores/spaceMissions.js",
|
||||
"src/ui/contextPresentation.js",
|
||||
"src/ui/contextSession.js",
|
||||
"src/ui/contextSubscriptions.js",
|
||||
@@ -437,6 +441,12 @@
|
||||
"src/layers/earthquakes/model.js",
|
||||
"src/layers/earthquakes/source.js",
|
||||
"src/layers/earthquakes/ownership.test.mjs",
|
||||
"src/layers/earthquakes/selection.test.mjs",
|
||||
"src/layers/submarineCables/interaction.test.mjs",
|
||||
"src/ui/entityContextBridge.test.mjs",
|
||||
"src/layers/launches/clickYield.test.mjs",
|
||||
"src/app/layers/earthquakeRipples.js",
|
||||
"src/app/layers/earthquakeRipples.test.mjs",
|
||||
"src/layers/perimeters/index.js",
|
||||
"src/layers/perimeters/records.js",
|
||||
"src/layers/perimeters/source.js",
|
||||
@@ -520,6 +530,10 @@
|
||||
"src/layers/launches/source.test.mjs",
|
||||
"src/layers/launches/ingestion.test.mjs",
|
||||
"src/layers/launches/failedEntry.test.mjs",
|
||||
"src/layers/launches/labelClick.test.mjs",
|
||||
"src/layers/launches/missionCycler.test.mjs",
|
||||
"src/layers/launches/satelliteIntents.js",
|
||||
"src/layers/launches/satelliteIntents.test.mjs",
|
||||
"src/layers/installations/lifecycle.js",
|
||||
"src/layers/installations/viewport.js",
|
||||
"src/layers/installations/controls.js",
|
||||
@@ -614,6 +628,7 @@
|
||||
"src/layers/cctv/ingestion.js",
|
||||
"src/layers/cctv/hover.js",
|
||||
"src/layers/cctv/navigation.js",
|
||||
"src/layers/cctv/navigation.test.mjs",
|
||||
"src/layers/cctv/index.js",
|
||||
"src/layers/cctv/model.js",
|
||||
"src/layers/cctv/geometryQueue.js",
|
||||
@@ -656,6 +671,7 @@
|
||||
"src/layers/alpr/model.js",
|
||||
"src/layers/alpr/policy.js",
|
||||
"src/layers/alpr/presentation.js",
|
||||
"src/layers/alpr/presentation.test.mjs",
|
||||
"src/layers/alpr/visuals.js",
|
||||
"src/layers/alpr/overlay.js",
|
||||
"src/layers/alpr/overlay.test.mjs",
|
||||
@@ -867,6 +883,7 @@
|
||||
"src/data/rioRouteNames.js",
|
||||
"src/data/transitFeeds.js",
|
||||
"src/data/transitFeeds.test.mjs",
|
||||
"src/data/transitFeedsAustralia.test.mjs",
|
||||
"src/data/transitProxy.js",
|
||||
"src/data/transitProxy.test.mjs",
|
||||
"src/data/gtfsRealtime.js",
|
||||
@@ -1316,6 +1333,23 @@
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiBadge.test.mjs",
|
||||
"src/ui/kit/UiEmpty.vue",
|
||||
"src/ui/kit/kitStyles.test.mjs",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/kit/UiCloseButton.test.mjs",
|
||||
"src/ui/kit/closeButtons.test.mjs",
|
||||
"src/ui/styles/close-button.css",
|
||||
"src/ui/kit/UiSearchField.vue",
|
||||
"src/ui/kit/UiSearchField.test.mjs",
|
||||
"src/ui/styles/search-field.css",
|
||||
"src/ui/kit/UiCheckbox.vue",
|
||||
"src/ui/kit/UiCheckbox.test.mjs",
|
||||
"src/ui/kit/checkboxes.test.mjs",
|
||||
"src/ui/styles/checkbox.css",
|
||||
"src/ui/kit/UiDialog.vue",
|
||||
"src/ui/kit/UiDialog.test.mjs",
|
||||
"src/ui/kit/dialogs.test.mjs",
|
||||
"src/ui/styles/chip.css",
|
||||
"src/ui/styles/empty-state.css",
|
||||
"src/ui/rail/RailChips.vue",
|
||||
"src/ui/displayPanelActions.test.mjs",
|
||||
"src/testSupport/vueDom.mjs",
|
||||
@@ -1479,7 +1513,7 @@
|
||||
"src/overlays/worldOverlayDraw.test.mjs",
|
||||
"src/sources/rateLimit.js",
|
||||
"src/ui/layerNames.js",
|
||||
"src/ui/styles/cyber.css",
|
||||
"src/ui/styles/sonar.css",
|
||||
"src/voice/layerManifest.js",
|
||||
"src/worldFocus.js",
|
||||
"src/worldFocus.test.mjs",
|
||||
@@ -1553,6 +1587,8 @@
|
||||
"dev/stub-app/main.js",
|
||||
"scripts/qa-stub-boot.mjs",
|
||||
"src/ui/creditsView.js",
|
||||
"src/ui/creditLineHeight.js",
|
||||
"src/ui/creditLineHeight.test.mjs",
|
||||
"src/ui/creditsView.test.mjs",
|
||||
"src/cockpitSubjectProviders.js",
|
||||
"src/cockpitSubjectProviders.test.mjs",
|
||||
@@ -1586,5 +1622,18 @@
|
||||
"src/ui/layerFinder.test.mjs",
|
||||
"src/data/wikidataCities.js",
|
||||
"src/data/wikidataCities.test.mjs",
|
||||
"scripts/build-wikidata-cities.mjs"
|
||||
"scripts/build-wikidata-cities.mjs",
|
||||
"src/search/bip39Words.js",
|
||||
"src/search/placeSuggestions.test.mjs",
|
||||
"scripts/wikidataPlaceTiles.mjs",
|
||||
"src/tooling/wikidataPlaceTiles.test.mjs",
|
||||
"src/ui/omnibarIntent.test.mjs",
|
||||
"src/ui/omnibarRows.test.mjs",
|
||||
"src/ui/styles/omnibar-dock.css",
|
||||
"src/ui/styles/guide.css",
|
||||
"src/ui/commandDock.test.mjs",
|
||||
"src/layers/firms/selection.test.mjs",
|
||||
"src/layers/vessels/selection.test.mjs",
|
||||
"src/layers/bikeshare/selection.test.mjs",
|
||||
"src/layers/satellites/interaction.test.mjs"
|
||||
]
|
||||
+245
-12
@@ -13,6 +13,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/iconAtlas.js",
|
||||
"src/data/iconSet.js",
|
||||
@@ -129,6 +130,7 @@
|
||||
"src/ui/radioTunerModel.js",
|
||||
"src/ui/views/panels/MissionDetail.vue",
|
||||
"src/ui/views/panels/MissionRoster.vue",
|
||||
"src/ui/views/panels/SpaceMissionsPanel.vue",
|
||||
"src/ui/views/panels/AwarenessPanel.vue",
|
||||
"src/ui/views/panels/AwarenessNames.vue",
|
||||
"src/ui/views/DisplayControlsView.vue",
|
||||
@@ -162,6 +164,7 @@
|
||||
"src/ui/stores/cctv.js",
|
||||
"src/ui/stores/radio.js",
|
||||
"src/ui/stores/context.js",
|
||||
"src/ui/stores/spaceMissions.js",
|
||||
"src/ui/stores/cockpit.js",
|
||||
"src/ui/stores/locale.js",
|
||||
"src/ui/stores/providerSettings.js",
|
||||
@@ -238,6 +241,10 @@
|
||||
"src/ui/kit/UiSelect.js",
|
||||
"src/ui/kit/UiEmpty.vue",
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/kit/UiSearchField.vue",
|
||||
"src/ui/kit/UiCheckbox.vue",
|
||||
"src/ui/kit/UiDialog.vue",
|
||||
"src/ui/stores/globeActions.js",
|
||||
"src/ui/views/panels/GlobeActions.vue",
|
||||
"src/ui/views/panels/RenderFailure.vue",
|
||||
@@ -285,7 +292,27 @@
|
||||
"src/ui/views/panels/SatelliteGroundView.vue",
|
||||
"src/data/vesselTypes.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/ui/views/panels/AircraftModelHero.vue"
|
||||
"src/render/modelParts.js",
|
||||
"src/ui/views/panels/AircraftModelHero.vue",
|
||||
"src/data/retryableLoad.js",
|
||||
"src/data/local_data/wikidata_places/files.js",
|
||||
"src/ui/views/panels/Omnibar.vue",
|
||||
"src/exclusiveSurfaces.js",
|
||||
"src/geoDistance.js",
|
||||
"src/ui/omnibarGuide.js",
|
||||
"src/cityPois.js",
|
||||
"src/search/photonSetting.js",
|
||||
"src/sources/requestDeadline.js",
|
||||
"src/ui/omnibarEnter.js",
|
||||
"src/ui/omnibarIntent.js",
|
||||
"src/data/placeNames.js",
|
||||
"src/search/plusCode.js",
|
||||
"src/keylessGeocoder.js",
|
||||
"src/ui/omnibarRows.js",
|
||||
"src/search/gridReference.js",
|
||||
"src/search/coordinateParser.js",
|
||||
"src/search/placeSuggestions.js",
|
||||
"src/search/bip39Words.js"
|
||||
],
|
||||
"external": ["vue", "pinia", "vue-i18n"]
|
||||
},
|
||||
@@ -421,7 +448,11 @@
|
||||
},
|
||||
"place-payloads": {
|
||||
"exports": ["./sources/places"],
|
||||
"modules": ["src/data/placeProviderPayloads.js"],
|
||||
"modules": [
|
||||
"src/data/placeProviderPayloads.js",
|
||||
"src/data/routeSteps.js",
|
||||
"src/data/distanceFormat.js"
|
||||
],
|
||||
"external": []
|
||||
},
|
||||
"space-providers": {
|
||||
@@ -812,7 +843,6 @@
|
||||
"exports": ["./ui/layout"],
|
||||
"modules": [
|
||||
"src/ui/panelRails.js",
|
||||
"src/ui/displayPanelScroll.js",
|
||||
"src/ui/leftPanelRail.js",
|
||||
"src/ui/rightPanelRail.js",
|
||||
"src/ui/panelMeasurement.js",
|
||||
@@ -988,6 +1018,8 @@
|
||||
"src/ui/kit/UiSelect.js",
|
||||
"src/ui/kit/UiButton.vue",
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/kit/UiIcon.vue",
|
||||
"src/ui/rail/fieldValue.js",
|
||||
"src/ui/kit/UiSlider.js",
|
||||
"src/ui/kit/UiSegmented.vue"
|
||||
@@ -1122,7 +1154,8 @@
|
||||
"src/i18n/locales/uk.json",
|
||||
"src/i18n/locales/zh-CN.json",
|
||||
"src/i18n/locales/zh-Hant.json",
|
||||
"src/ui/layerNames.js"
|
||||
"src/ui/layerNames.js",
|
||||
"src/ui/statusText.js"
|
||||
],
|
||||
"external": []
|
||||
},
|
||||
@@ -1150,6 +1183,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/motionModel.js",
|
||||
"src/data/iconAtlas.js",
|
||||
@@ -1185,7 +1219,6 @@
|
||||
"src/ui/cockpitController.js",
|
||||
"src/data/followed.js",
|
||||
"src/ui/cockpitDisplayPortal.js",
|
||||
"src/ui/displayPanelScroll.js",
|
||||
"src/ui/cockpitInput.js",
|
||||
"src/ui/cockpitInstruments.js",
|
||||
"src/cockpitSubjectProviders.js",
|
||||
@@ -1344,6 +1377,7 @@
|
||||
"src/data/bundledJson.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/motionModel.js",
|
||||
"src/geo/julian.js",
|
||||
@@ -1407,7 +1441,6 @@
|
||||
"src/ui/cockpitContext.js",
|
||||
"src/ui/cockpitController.js",
|
||||
"src/ui/cockpitDisplayPortal.js",
|
||||
"src/ui/displayPanelScroll.js",
|
||||
"src/ui/cockpitInput.js",
|
||||
"src/ui/cockpitInstruments.js",
|
||||
"src/cockpitSubjectProviders.js",
|
||||
@@ -1425,6 +1458,7 @@
|
||||
"src/ui/contextSession.js",
|
||||
"src/ui/contextSubscriptions.js",
|
||||
"src/ui/contextTransactions.js",
|
||||
"src/ui/spaceMissionsControls.js",
|
||||
"src/ui/displayControls.js",
|
||||
"src/ui/effects.js",
|
||||
"src/ui/frameRateMonitor.js",
|
||||
@@ -1553,6 +1587,7 @@
|
||||
"src/ui/stores/cctv.js",
|
||||
"src/ui/stores/radio.js",
|
||||
"src/ui/stores/context.js",
|
||||
"src/ui/stores/spaceMissions.js",
|
||||
"src/ui/stores/cockpit.js",
|
||||
"src/ui/stores/locale.js",
|
||||
"src/ui/stores/providerSettings.js",
|
||||
@@ -1573,6 +1608,7 @@
|
||||
"src/ui/kit/UiSlider.js",
|
||||
"src/ui/kit/UiButton.vue",
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/stores/globeActions.js",
|
||||
"src/ui/stores/recording.js",
|
||||
"src/ui/i18n.js",
|
||||
@@ -1646,7 +1682,8 @@
|
||||
"src/ui/entityContextBridge.js",
|
||||
"src/data/trackingClickGesture.js",
|
||||
"src/ui/stores/sceneSharing.js",
|
||||
"src/maps/attribution.js"
|
||||
"src/maps/attribution.js",
|
||||
"src/data/dataCredits.js"
|
||||
],
|
||||
"external": [
|
||||
"cesium",
|
||||
@@ -1733,6 +1770,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/motionModel.js",
|
||||
"src/data/iconSet.js",
|
||||
@@ -1872,10 +1910,14 @@
|
||||
"civil-flights": {
|
||||
"exports": ["./layers/flights"],
|
||||
"modules": [
|
||||
"src/data/rotorFrames.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/vesselTypes.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
"src/data/fleetModelInstances.js",
|
||||
"src/data/fleetModelDraw.js",
|
||||
"src/data/modelPartDrivers.js",
|
||||
"src/data/headingDegrees.js",
|
||||
"src/i18n/marker.js",
|
||||
"src/cyberSonar.js",
|
||||
@@ -2018,12 +2060,16 @@
|
||||
"military-flights": {
|
||||
"exports": ["./layers/military"],
|
||||
"modules": [
|
||||
"src/data/rotorFrames.js",
|
||||
"src/layers/flights/modelSpec.js",
|
||||
"src/layers/flights/policy.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/vesselTypes.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
"src/data/fleetModelInstances.js",
|
||||
"src/data/fleetModelDraw.js",
|
||||
"src/data/modelPartDrivers.js",
|
||||
"src/data/headingDegrees.js",
|
||||
"src/i18n/marker.js",
|
||||
"src/cyberSonar.js",
|
||||
@@ -2198,10 +2244,16 @@
|
||||
"vessel-layer": {
|
||||
"exports": ["./layers/vessels"],
|
||||
"modules": [
|
||||
"src/data/units.js",
|
||||
"src/render/color.js",
|
||||
"src/data/vesselSprites.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftClass.js",
|
||||
"src/i18n/marker.js",
|
||||
"src/data/fleetModelInstances.js",
|
||||
"src/data/fleetModelDraw.js",
|
||||
"src/data/modelPartDrivers.js",
|
||||
"src/data/aircraftModelLighting.js",
|
||||
"src/data/modelEligibility.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
@@ -2393,6 +2445,7 @@
|
||||
"src/data/iconAtlas.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/render/motion/iconMotion.js",
|
||||
"src/render/cesium/heights.js",
|
||||
"src/render/baseTilesets.js",
|
||||
@@ -2451,6 +2504,7 @@
|
||||
"src/render/cesium/tileRequests.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/motionModel.js",
|
||||
"src/geo/julian.js",
|
||||
@@ -2544,7 +2598,8 @@
|
||||
"src/layers/earthquakes/model.js",
|
||||
"src/layers/earthquakes/source.js",
|
||||
"src/layers/earthquakes/records.js",
|
||||
"src/time/worldClock.js"
|
||||
"src/time/worldClock.js",
|
||||
"src/data/trackingClickGesture.js"
|
||||
],
|
||||
"external": ["cesium"]
|
||||
},
|
||||
@@ -2616,6 +2671,7 @@
|
||||
"src/render/cesium/drawQuads.js",
|
||||
"src/render/cesium/drawMeshes.js",
|
||||
"src/render/cesium/drawModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/render/recession.js",
|
||||
"src/geo/polyline.js",
|
||||
"src/render/cesium/gpuIcons.js",
|
||||
@@ -2714,6 +2770,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/iconSet.js",
|
||||
"src/geo/horizon.js",
|
||||
@@ -2805,6 +2862,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/motionModel.js",
|
||||
"src/geo/julian.js",
|
||||
@@ -2830,6 +2888,7 @@
|
||||
"src/data/entityRecords.js",
|
||||
"src/render/cesium/follow.js",
|
||||
"src/layers/launches/ingestion.js",
|
||||
"src/layers/launches/satelliteIntents.js",
|
||||
"src/layers/launches/launchPad.js",
|
||||
"src/layers/launches/lifecycle.js",
|
||||
"src/layers/launches/model.js",
|
||||
@@ -2905,6 +2964,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/iconAtlas.js",
|
||||
"src/data/motionModel.js",
|
||||
@@ -3082,7 +3142,8 @@
|
||||
"src/loadingFeedback.js",
|
||||
"src/data/installationFeedback.js",
|
||||
"src/ui/layerNames.js",
|
||||
"src/render/cesium/zoomOutGuard.js"
|
||||
"src/render/cesium/zoomOutGuard.js",
|
||||
"src/ui/statusText.js"
|
||||
],
|
||||
"external": ["cesium", "kdbush"]
|
||||
},
|
||||
@@ -3133,6 +3194,7 @@
|
||||
"src/render/rendererOf.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/iconSet.js",
|
||||
"src/geo/horizon.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
@@ -3325,6 +3387,7 @@
|
||||
"src/render/cesium/drawQuads.js",
|
||||
"src/render/cesium/drawMeshes.js",
|
||||
"src/render/cesium/drawModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/render/recession.js",
|
||||
"src/geo/polyline.js",
|
||||
"src/render/cesium/gpuIcons.js",
|
||||
@@ -3418,6 +3481,7 @@
|
||||
"src/render/cesium/credits.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/iconSet.js",
|
||||
"src/geo/horizon.js",
|
||||
@@ -3650,6 +3714,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/iconSet.js",
|
||||
"src/geo/horizon.js",
|
||||
@@ -3853,6 +3918,7 @@
|
||||
"src/render/baseTilesets.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/iconSet.js",
|
||||
"src/geo/horizon.js",
|
||||
@@ -4064,6 +4130,9 @@
|
||||
"./standalone/catalog"
|
||||
],
|
||||
"modules": [
|
||||
"src/data/units.js",
|
||||
"src/data/vesselSprites.js",
|
||||
"src/data/rotorFrames.js",
|
||||
"src/render/stub/viewRectangle.js",
|
||||
"src/render/stub/math.js",
|
||||
"src/render/cesium/controlledCamera.js",
|
||||
@@ -4079,10 +4148,13 @@
|
||||
"src/data/aircraftIconLayer.js",
|
||||
"src/data/fixCurve.js",
|
||||
"src/data/aircraftModelLayer.js",
|
||||
"src/data/modelPartDrivers.js",
|
||||
"src/data/aircraftMotionRegime.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
"src/data/fleetModelInstances.js",
|
||||
"src/data/fleetModelDraw.js",
|
||||
"src/app/layers/fleetModels.js",
|
||||
"src/sources/adsbFields.js",
|
||||
"src/data/headingDegrees.js",
|
||||
@@ -4129,6 +4201,7 @@
|
||||
"src/app/layers/bikeshare.js",
|
||||
"src/app/layers/cctv.js",
|
||||
"src/app/layers/cyclones.js",
|
||||
"src/app/layers/earthquakeRipples.js",
|
||||
"src/app/layers/earthquakes.js",
|
||||
"src/app/layers/firms.js",
|
||||
"src/app/layers/flights.js",
|
||||
@@ -4481,6 +4554,7 @@
|
||||
"src/layers/launches/controls.js",
|
||||
"src/layers/launches/index.js",
|
||||
"src/layers/launches/ingestion.js",
|
||||
"src/layers/launches/satelliteIntents.js",
|
||||
"src/layers/launches/launchPad.js",
|
||||
"src/layers/launches/lifecycle.js",
|
||||
"src/layers/launches/model.js",
|
||||
@@ -4694,7 +4768,6 @@
|
||||
"src/ui/cockpitContext.js",
|
||||
"src/ui/cockpitController.js",
|
||||
"src/ui/cockpitDisplayPortal.js",
|
||||
"src/ui/displayPanelScroll.js",
|
||||
"src/ui/cockpitInput.js",
|
||||
"src/ui/cockpitInstruments.js",
|
||||
"src/cockpitSubjectProviders.js",
|
||||
@@ -4713,6 +4786,7 @@
|
||||
"src/ui/contextSession.js",
|
||||
"src/ui/contextSubscriptions.js",
|
||||
"src/ui/contextTransactions.js",
|
||||
"src/ui/spaceMissionsControls.js",
|
||||
"src/ui/displayControls.js",
|
||||
"src/ui/effects.js",
|
||||
"src/ui/frameRateMonitor.js",
|
||||
@@ -5275,6 +5349,7 @@
|
||||
"src/ui/stores/cctv.js",
|
||||
"src/ui/stores/radio.js",
|
||||
"src/ui/stores/context.js",
|
||||
"src/ui/stores/spaceMissions.js",
|
||||
"src/ui/stores/cockpit.js",
|
||||
"src/ui/stores/locale.js",
|
||||
"src/ui/stores/providerSettings.js",
|
||||
@@ -5307,6 +5382,7 @@
|
||||
"src/ui/kit/UiButton.vue",
|
||||
"src/ui/kit/UiEmpty.vue",
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/stores/globeActions.js",
|
||||
"src/ui/stores/recording.js",
|
||||
"src/ui/i18n.js",
|
||||
@@ -5415,6 +5491,7 @@
|
||||
"src/render/applicationHooks.js",
|
||||
"src/maps/globeEngine.js",
|
||||
"src/render/cesium/viewers.js",
|
||||
"src/ui/creditLineHeight.js",
|
||||
"src/ui/creditsView.js",
|
||||
"src/data/planespottersPhoto.js",
|
||||
"src/maps/keylessTerrain.js",
|
||||
@@ -5467,20 +5544,26 @@
|
||||
"application-layer-construction": {
|
||||
"exports": ["./application/layers"],
|
||||
"modules": [
|
||||
"src/data/units.js",
|
||||
"src/data/vesselSprites.js",
|
||||
"src/data/rotorFrames.js",
|
||||
"src/layers/flights/icons.js",
|
||||
"src/data/aircraftIconLayer.js",
|
||||
"src/data/fixCurve.js",
|
||||
"src/data/aircraftModelLayer.js",
|
||||
"src/data/modelPartDrivers.js",
|
||||
"src/data/aircraftMotionRegime.js",
|
||||
"src/geo/julian.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/iconSet.js",
|
||||
"src/data/iconSegment.js",
|
||||
"src/data/iconAtlas.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
"src/data/fleetModelInstances.js",
|
||||
"src/data/fleetModelDraw.js",
|
||||
"src/app/layers/fleetModels.js",
|
||||
"src/data/feedState.js",
|
||||
"src/loadingFeedback.js",
|
||||
@@ -5538,6 +5621,7 @@
|
||||
"src/app/layers/bikeshare.js",
|
||||
"src/app/layers/cctv.js",
|
||||
"src/app/layers/cyclones.js",
|
||||
"src/app/layers/earthquakeRipples.js",
|
||||
"src/app/layers/earthquakes.js",
|
||||
"src/app/layers/firms.js",
|
||||
"src/app/layers/flights.js",
|
||||
@@ -5759,6 +5843,7 @@
|
||||
"src/layers/launches/controls.js",
|
||||
"src/layers/launches/index.js",
|
||||
"src/layers/launches/ingestion.js",
|
||||
"src/layers/launches/satelliteIntents.js",
|
||||
"src/layers/launches/launchPad.js",
|
||||
"src/layers/launches/lifecycle.js",
|
||||
"src/layers/launches/model.js",
|
||||
@@ -6316,6 +6401,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/iconSet.js",
|
||||
"src/geo/horizon.js",
|
||||
@@ -6475,6 +6561,7 @@
|
||||
"src/render/cesium/camera.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/iconSet.js",
|
||||
"src/geo/horizon.js",
|
||||
@@ -6636,7 +6723,6 @@
|
||||
"ui-panel-chrome": {
|
||||
"exports": ["./ui/panel-chrome"],
|
||||
"modules": [
|
||||
"src/ui/displayPanelScroll.js",
|
||||
"src/ui/radioPanelPlacement.js",
|
||||
"src/panelStackLayout.js",
|
||||
"src/ui/leftPanelRail.js",
|
||||
@@ -6685,6 +6771,7 @@
|
||||
"src/data/aircraftClass.js",
|
||||
"src/data/aircraftEmergency.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/vesselTypes.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
"src/data/courseFromFixes.js"
|
||||
@@ -7045,6 +7132,120 @@
|
||||
"modules": ["src/sources/httpBody.js", "src/i18n/marker.js"],
|
||||
"external": []
|
||||
},
|
||||
"library-proxy": {
|
||||
"exports": ["./sources/library"],
|
||||
"modules": [
|
||||
"src/library/proxy.js",
|
||||
"src/library/catalog.js",
|
||||
"src/library/manifest.js",
|
||||
"src/data/libraryLayerIds.js",
|
||||
"src/library/ledger.json",
|
||||
"src/library/entries/ak-statewide-imagery.json",
|
||||
"src/library/entries/ar-statewide-imagery.json",
|
||||
"src/library/entries/az-statewide-imagery.json",
|
||||
"src/library/entries/amsterdam-traffic-cameras.json",
|
||||
"src/library/entries/bayern-dop40.json",
|
||||
"src/library/entries/bismarck-mandan-nd.json",
|
||||
"src/library/entries/bkg-topplus-open.json",
|
||||
"src/library/entries/cctv-florida-fl511.json",
|
||||
"src/library/entries/cctv-lithuania.json",
|
||||
"src/library/entries/cctv-nyc-dot.json",
|
||||
"src/library/entries/ct-statewide-imagery.json",
|
||||
"src/library/entries/dakota-county-mn.json",
|
||||
"src/library/entries/dc-statewide-imagery.json",
|
||||
"src/library/entries/de-statewide-imagery.json",
|
||||
"src/library/entries/ee-maa-amet-ortofoto.json",
|
||||
"src/library/entries/eia-power-plants.json",
|
||||
"src/library/entries/epa-superfund-sites.json",
|
||||
"src/library/entries/epa-toxic-release-facilities.json",
|
||||
"src/library/entries/epc-england-wales.json",
|
||||
"src/library/entries/fema-usa-structures.json",
|
||||
"src/library/entries/gbif-occurrence-density.json",
|
||||
"src/library/entries/gdacs-disaster-alerts.json",
|
||||
"src/library/entries/grand-forks-nd.json",
|
||||
"src/library/entries/gsi-japan-map.json",
|
||||
"src/library/entries/gsi-japan-photo.json",
|
||||
"src/library/entries/gvp-holocene-volcanoes.json",
|
||||
"src/library/entries/ia-statewide-imagery.json",
|
||||
"src/library/entries/id-statewide-imagery.json",
|
||||
"src/library/entries/ign-orthophotos-france.json",
|
||||
"src/library/entries/il-statewide-imagery.json",
|
||||
"src/library/entries/imf-portwatch-chokepoints.json",
|
||||
"src/library/entries/imf-portwatch-disruptions.json",
|
||||
"src/library/entries/in-statewide-imagery.json",
|
||||
"src/library/entries/jrc-surface-water.json",
|
||||
"src/library/entries/kartverket-admin-units.json",
|
||||
"src/library/entries/kartverket-cadastre.json",
|
||||
"src/library/entries/kartverket-depth.json",
|
||||
"src/library/entries/kartverket-hillshade.json",
|
||||
"src/library/entries/kartverket-nautical-charts.json",
|
||||
"src/library/entries/kartverket-terrain-relief.json",
|
||||
"src/library/entries/kartverket-topo-grey.json",
|
||||
"src/library/entries/kartverket-topo.json",
|
||||
"src/library/entries/kartverket-toporaster.json",
|
||||
"src/library/entries/ks-statewide-imagery.json",
|
||||
"src/library/entries/ky-statewide-imagery.json",
|
||||
"src/library/entries/lake-county-in.json",
|
||||
"src/library/entries/lawrence-ks.json",
|
||||
"src/library/entries/lee-county-fl.json",
|
||||
"src/library/entries/loudoun-county-va.json",
|
||||
"src/library/entries/louisville-lojic-ky.json",
|
||||
"src/library/entries/ma-statewide-imagery.json",
|
||||
"src/library/entries/macrostrat-geology.json",
|
||||
"src/library/entries/mapterhorn-terrain.json",
|
||||
"src/library/entries/maris-ms.json",
|
||||
"src/library/entries/md-statewide-imagery.json",
|
||||
"src/library/entries/me-statewide-imagery.json",
|
||||
"src/library/entries/mi-statewide-imagery.json",
|
||||
"src/library/entries/mountain-village-co.json",
|
||||
"src/library/entries/ms-statewide-imagery.json",
|
||||
"src/library/entries/mt-statewide-imagery.json",
|
||||
"src/library/entries/naip.json",
|
||||
"src/library/entries/nasa-black-marble.json",
|
||||
"src/library/entries/nasa-eonet-events.json",
|
||||
"src/library/entries/nc-statewide-imagery.json",
|
||||
"src/library/entries/nctcog-tx.json",
|
||||
"src/library/entries/nd-statewide-imagery.json",
|
||||
"src/library/entries/new-orleans-rpc-la.json",
|
||||
"src/library/entries/nh-statewide-imagery.json",
|
||||
"src/library/entries/nj-statewide-imagery.json",
|
||||
"src/library/entries/noaa-tide-stations.json",
|
||||
"src/library/entries/nrw-dop.json",
|
||||
"src/library/entries/nsw-imagery.json",
|
||||
"src/library/entries/ntad-national-bridges.json",
|
||||
"src/library/entries/nwa-benton-washington-ar.json",
|
||||
"src/library/entries/nws-active-alerts.json",
|
||||
"src/library/entries/ny-statewide-imagery.json",
|
||||
"src/library/entries/oakland-county-mi.json",
|
||||
"src/library/entries/oh-statewide-imagery.json",
|
||||
"src/library/entries/or-statewide-imagery.json",
|
||||
"src/library/entries/pa-statewide-imagery.json",
|
||||
"src/library/entries/pl-ortofotomapa.json",
|
||||
"src/library/entries/pnoa-ma.json",
|
||||
"src/library/entries/portland-metro-or.json",
|
||||
"src/library/entries/pt-dgt-ortos.json",
|
||||
"src/library/entries/ri-statewide-imagery.json",
|
||||
"src/library/entries/swisstopo-swissimage.json",
|
||||
"src/library/entries/tx-statewide-imagery.json",
|
||||
"src/library/entries/union-county-oh.json",
|
||||
"src/library/entries/usgs-hydrography.json",
|
||||
"src/library/entries/usgs-topo.json",
|
||||
"src/library/entries/va-statewide-imagery.json",
|
||||
"src/library/entries/vt-statewide-imagery.json",
|
||||
"src/library/entries/wallonie-ortho.json",
|
||||
"src/library/entries/wi-statewide-imagery.json",
|
||||
"src/library/entries/wri-global-power-plants.json",
|
||||
"src/library/entries/wv-statewide-imagery.json",
|
||||
"src/library/formats.js",
|
||||
"src/library/parquet.js",
|
||||
"src/sources/httpBody.js",
|
||||
"src/i18n/marker.js",
|
||||
"src/library/source.js",
|
||||
"src/keySetupCore.mjs",
|
||||
"src/localRequestGate.mjs"
|
||||
],
|
||||
"external": ["hyparquet", "fzstd"]
|
||||
},
|
||||
"overpass-lexer": {
|
||||
"exports": ["./sources/overpass"],
|
||||
"modules": ["src/sources/overpass.js"],
|
||||
@@ -7102,10 +7303,13 @@
|
||||
"exports": ["./layers/transit/standalone"],
|
||||
"modules": [
|
||||
"src/data/fleetModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/vesselTypes.js",
|
||||
"src/data/aircraftClass.js",
|
||||
"src/i18n/marker.js",
|
||||
"src/data/fleetModelInstances.js",
|
||||
"src/data/fleetModelDraw.js",
|
||||
"src/data/modelPartDrivers.js",
|
||||
"src/data/modelEligibility.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
"src/data/aircraftModelLighting.js",
|
||||
@@ -7255,8 +7459,11 @@
|
||||
"modules": [
|
||||
"src/i18n/marker.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/vesselTypes.js",
|
||||
"src/data/fleetModelInstances.js",
|
||||
"src/data/fleetModelDraw.js",
|
||||
"src/data/modelPartDrivers.js",
|
||||
"src/data/aircraftClass.js",
|
||||
"src/data/aircraftModelLighting.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
@@ -7644,6 +7851,7 @@
|
||||
"src/render/cesium/drawHit.js",
|
||||
"src/render/cesium/iconSetPrimitive.js",
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/aircraftRecession.js",
|
||||
"src/data/motionModel.js",
|
||||
"src/data/iconSet.js",
|
||||
@@ -8032,6 +8240,28 @@
|
||||
],
|
||||
"external": []
|
||||
},
|
||||
"fleet": {
|
||||
"exports": ["./fleet"],
|
||||
"modules": [
|
||||
"src/fleet/index.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/data/aircraftClass.js",
|
||||
"src/i18n/marker.js",
|
||||
"src/render/modelParts.js",
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
"src/data/vesselTypes.js",
|
||||
"src/layers/flights/modelSpec.js",
|
||||
"src/layers/flights/policy.js",
|
||||
"src/data/aircraftEmergency.js",
|
||||
"src/render/color.js",
|
||||
"src/data/aircraftModelLighting.js",
|
||||
"src/data/modelPartDrivers.js",
|
||||
"src/data/modelEligibility.js",
|
||||
"src/data/fleetModelDraw.js",
|
||||
"src/data/vesselSprites.js"
|
||||
],
|
||||
"external": []
|
||||
},
|
||||
"sky": {
|
||||
"exports": ["./sky"],
|
||||
"modules": [
|
||||
@@ -8058,6 +8288,7 @@
|
||||
"./render/vectorBase",
|
||||
"./render/iconSegment",
|
||||
"./render/recession",
|
||||
"./render/modelParts",
|
||||
"./render/windStreamlines",
|
||||
"./geo/screenCluster"
|
||||
],
|
||||
@@ -8080,6 +8311,7 @@
|
||||
"src/render/input/wheel.js",
|
||||
"src/render/conformance/expect.js",
|
||||
"src/render/conformance/checks/ports.js",
|
||||
"src/render/conformance/partsModel.js",
|
||||
"src/render/stub/math.js",
|
||||
"src/geo/index.js",
|
||||
"src/geo/julian.js",
|
||||
@@ -8108,7 +8340,8 @@
|
||||
"src/data/motionModel.js",
|
||||
"src/layers/wind/streamlines.js",
|
||||
"src/layers/wind/model.js",
|
||||
"src/render/recession.js"
|
||||
"src/render/recession.js",
|
||||
"src/render/modelParts.js"
|
||||
],
|
||||
"external": ["pbf", "@mapbox/vector-tile", "kdbush"]
|
||||
},
|
||||
|
||||
+108
-382
@@ -193,41 +193,74 @@ try {
|
||||
});
|
||||
const contactMissionHandoff = await page.evaluate(async () => {
|
||||
const { styleManager, dataManager } = window.__godsEyeView;
|
||||
// Launch Library is not contacted: the layer's own work is stubbed so the
|
||||
// check covers only how Space Missions sits beside Context.
|
||||
const stubMissions = (rocketEntry) => {
|
||||
const original = {
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
};
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.init = async () => true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => true;
|
||||
rocketEntry.module.disable = async () => true;
|
||||
return () => {
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
};
|
||||
};
|
||||
const originalShowToast = styleManager._showToast;
|
||||
const toasts = [];
|
||||
styleManager._showToast = (message) => { toasts.push(String(message)); };
|
||||
const restoreMissions = stubMissions(dataManager.layers.get('rocket-launches'));
|
||||
try {
|
||||
if (styleManager._contextControls._contextMode) await styleManager._contextControls._selectContextMode(null);
|
||||
const contactsResult = await styleManager._contextControls._selectContextMode('flights');
|
||||
const missionResult = await styleManager._contextControls._selectContextMode('space-missions');
|
||||
const switched = {
|
||||
const missionResult = await dataManager.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
const together = {
|
||||
contactsResult,
|
||||
missionResult,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
missionsEnabled: dataManager.isEnabled('rocket-launches'),
|
||||
toasts: [...toasts],
|
||||
};
|
||||
const missionOff = await dataManager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
const modeAfterMissions = styleManager._contextControls._contextMode;
|
||||
const exitResult = await styleManager._contextControls._selectContextMode(null);
|
||||
return {
|
||||
...switched,
|
||||
...together,
|
||||
missionOff,
|
||||
modeAfterMissions,
|
||||
exitResult,
|
||||
modeAfterExit: styleManager._contextControls._contextMode,
|
||||
missionsOffAfterExit: !dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
};
|
||||
} finally {
|
||||
restoreMissions();
|
||||
styleManager._showToast = originalShowToast;
|
||||
}
|
||||
});
|
||||
check(
|
||||
'Contacts hands off to Space Missions on the first request without a failure toast',
|
||||
'Space Missions runs beside Contacts, and switching it off leaves Contacts on',
|
||||
contactMissionHandoff.contactsResult === true
|
||||
&& contactMissionHandoff.missionResult === true
|
||||
&& contactMissionHandoff.mode === 'space-missions'
|
||||
&& contactMissionHandoff.mode === 'flights'
|
||||
&& contactMissionHandoff.missionsEnabled
|
||||
&& contactMissionHandoff.toasts?.length === 0
|
||||
&& contactMissionHandoff.missionOff === true
|
||||
&& contactMissionHandoff.modeAfterMissions === 'flights'
|
||||
&& contactMissionHandoff.exitResult === true
|
||||
&& contactMissionHandoff.modeAfterExit === null
|
||||
&& contactMissionHandoff.missionsOffAfterExit,
|
||||
&& contactMissionHandoff.modeAfterExit === null,
|
||||
JSON.stringify(contactMissionHandoff),
|
||||
);
|
||||
const cancelledMissionEntry = await page.evaluate(async () => {
|
||||
@@ -330,7 +363,7 @@ try {
|
||||
}
|
||||
});
|
||||
check(
|
||||
'cancelled direct Space Missions entry restores its exact isolated sibling state',
|
||||
'a cancelled Space Missions start leaves its sibling layer on and opens no Context session',
|
||||
cancelledMissionEntry.exercised
|
||||
&& cancelledMissionEntry.transitionResult === false
|
||||
&& !cancelledMissionEntry.timedOut
|
||||
@@ -341,214 +374,45 @@ try {
|
||||
JSON.stringify(cancelledMissionEntry),
|
||||
);
|
||||
check(
|
||||
'successful Space Missions cancellation rollback stays silent',
|
||||
'a cancelled Space Missions start stays silent',
|
||||
cancelledMissionEntry.exercised && cancelledMissionEntry.toasts?.length === 0,
|
||||
JSON.stringify(cancelledMissionEntry.toasts || []),
|
||||
);
|
||||
const replacementMissionEntry = await page.evaluate(async () => {
|
||||
const styleManager = window.__godsEyeView.styleManager;
|
||||
const dataManager = window.__godsEyeView.dataManager;
|
||||
const rocketEntry = dataManager.layers.get('rocket-launches');
|
||||
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
|
||||
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
|
||||
}
|
||||
const siblingId = 'qa-cockpit-replacement-sibling';
|
||||
window.__gevQaRegisterLayer(dataManager, {
|
||||
id: siblingId,
|
||||
name: 'QA replacement sibling',
|
||||
icon: 'science',
|
||||
source: 'QA',
|
||||
updateInterval: -1,
|
||||
async init() { return true; },
|
||||
async enable() { return true; },
|
||||
async update() { return true; },
|
||||
async disable() { return true; },
|
||||
async destroy() {},
|
||||
getStats() { return { count: 1, status: 'live' }; },
|
||||
});
|
||||
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
|
||||
const original = {
|
||||
siblingInitialized: dataManager.layers.get(siblingId)?.initialized,
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
showToast: styleManager._showToast,
|
||||
};
|
||||
let firstUpdate = true;
|
||||
let releaseUpdate;
|
||||
let markUpdateStarted;
|
||||
const updateStarted = new Promise((resolve) => { markUpdateStarted = resolve; });
|
||||
const updateGate = new Promise((resolve) => { releaseUpdate = resolve; });
|
||||
const toasts = [];
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => {
|
||||
if (!firstUpdate) return true;
|
||||
firstUpdate = false;
|
||||
markUpdateStarted();
|
||||
await updateGate;
|
||||
return true;
|
||||
};
|
||||
rocketEntry.module.disable = async () => true;
|
||||
styleManager._showToast = (message) => { toasts.push(String(message)); };
|
||||
try {
|
||||
const entry = styleManager._contextControls._selectContextMode('space-missions');
|
||||
await updateStarted;
|
||||
const replacement = dataManager.setEnabled('rocket-launches', true, { origin: 'programmatic' });
|
||||
releaseUpdate();
|
||||
const [entryResult, replacementResult] = await Promise.all([entry, replacement]);
|
||||
const committed = {
|
||||
entryResult,
|
||||
replacementResult,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingIsolated: !dataManager.isEffectivelyEnabled(siblingId),
|
||||
missionEnabled: dataManager.isEnabled('rocket-launches'),
|
||||
missionEffective: dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
toasts: [...toasts],
|
||||
};
|
||||
const exitResult = await styleManager._contextControls._selectContextMode(null);
|
||||
return {
|
||||
exercised: true,
|
||||
...committed,
|
||||
exitResult,
|
||||
siblingRestored: dataManager.isEnabled(siblingId),
|
||||
missionRestoredOff: !dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
};
|
||||
} finally {
|
||||
styleManager._showToast = original.showToast;
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
|
||||
await window.__gevQaUnregisterLayer(dataManager, siblingId);
|
||||
}
|
||||
});
|
||||
check(
|
||||
'right-rail Space Missions adopts a newer authoritative ON without stale restoration',
|
||||
replacementMissionEntry.exercised
|
||||
&& replacementMissionEntry.entryResult === true
|
||||
&& replacementMissionEntry.replacementResult === true
|
||||
&& replacementMissionEntry.mode === 'space-missions'
|
||||
&& replacementMissionEntry.entering === null
|
||||
&& replacementMissionEntry.snapshotRetained
|
||||
&& replacementMissionEntry.siblingIsolated
|
||||
&& replacementMissionEntry.missionEnabled
|
||||
&& replacementMissionEntry.missionEffective
|
||||
&& replacementMissionEntry.toasts?.length === 0
|
||||
&& replacementMissionEntry.exitResult === true
|
||||
&& replacementMissionEntry.siblingRestored
|
||||
&& replacementMissionEntry.missionRestoredOff,
|
||||
JSON.stringify(replacementMissionEntry),
|
||||
);
|
||||
const supersededMissionEntry = await page.evaluate(async () => {
|
||||
const styleManager = window.__godsEyeView.styleManager;
|
||||
const dataManager = window.__godsEyeView.dataManager;
|
||||
const rocketEntry = dataManager.layers.get('rocket-launches');
|
||||
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
|
||||
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
|
||||
}
|
||||
const siblingId = 'qa-cockpit-superseded-sibling';
|
||||
window.__gevQaRegisterLayer(dataManager, {
|
||||
id: siblingId,
|
||||
name: 'QA superseded sibling',
|
||||
icon: 'science',
|
||||
source: 'QA',
|
||||
updateInterval: -1,
|
||||
async init() { return true; },
|
||||
async enable() { return true; },
|
||||
async update() { return true; },
|
||||
async disable() { return true; },
|
||||
async destroy() {},
|
||||
getStats() { return { count: 1, status: 'live' }; },
|
||||
});
|
||||
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
|
||||
const original = {
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
showToast: styleManager._showToast,
|
||||
};
|
||||
let releaseUpdate;
|
||||
let markUpdateStarted;
|
||||
const updateStarted = new Promise((resolve) => { markUpdateStarted = resolve; });
|
||||
const updateGate = new Promise((resolve) => { releaseUpdate = resolve; });
|
||||
const toasts = [];
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => {
|
||||
markUpdateStarted();
|
||||
await updateGate;
|
||||
return true;
|
||||
};
|
||||
rocketEntry.module.disable = async () => true;
|
||||
styleManager._showToast = (message) => { toasts.push(String(message)); };
|
||||
try {
|
||||
const entry = styleManager._runUserFacingContextAction(
|
||||
(notificationToken) => styleManager._contextControls._selectContextMode(
|
||||
'space-missions',
|
||||
{ notificationToken },
|
||||
),
|
||||
'Space Missions could not complete the requested transition; try again',
|
||||
);
|
||||
await updateStarted;
|
||||
const supersedingOff = dataManager.setEnabled('rocket-launches', false, {
|
||||
origin: 'programmatic',
|
||||
});
|
||||
releaseUpdate();
|
||||
const [entryResult, offResult] = await Promise.all([entry, supersedingOff]);
|
||||
return {
|
||||
exercised: true,
|
||||
entryResult,
|
||||
offResult,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingRestored: dataManager.isEnabled(siblingId),
|
||||
missionEffective: dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
toasts,
|
||||
};
|
||||
} finally {
|
||||
styleManager._showToast = original.showToast;
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
|
||||
await window.__gevQaUnregisterLayer(dataManager, siblingId);
|
||||
}
|
||||
});
|
||||
check(
|
||||
'right-rail Space Missions superseded by OFF restores exactly without a failure toast',
|
||||
supersededMissionEntry.exercised
|
||||
&& supersededMissionEntry.entryResult === null
|
||||
&& supersededMissionEntry.mode === null
|
||||
&& supersededMissionEntry.entering === null
|
||||
&& !supersededMissionEntry.snapshotRetained
|
||||
&& supersededMissionEntry.siblingRestored
|
||||
&& !supersededMissionEntry.missionEffective
|
||||
&& supersededMissionEntry.toasts?.length === 0,
|
||||
JSON.stringify(supersededMissionEntry),
|
||||
);
|
||||
const voiceMissionEntry = await page.evaluate(async () => {
|
||||
const ordinaryMissionLayer = await page.evaluate(async () => {
|
||||
const { dataManager, styleManager } = window.__godsEyeView;
|
||||
const siblingId = '__qa_voice_context_sibling__';
|
||||
const rocketEntry = dataManager.layers.get('rocket-launches');
|
||||
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
|
||||
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
|
||||
}
|
||||
// Launch Library is not contacted: the layer's own work is stubbed so the
|
||||
// check covers only how Space Missions sits beside Context.
|
||||
const stubMissions = (rocketEntry) => {
|
||||
const original = {
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
};
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.init = async () => true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => true;
|
||||
rocketEntry.module.disable = async () => true;
|
||||
return () => {
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
};
|
||||
};
|
||||
const siblingId = '__qa_space_missions_sibling__';
|
||||
window.__gevQaRegisterLayer(dataManager, {
|
||||
id: siblingId,
|
||||
name: 'QA voice Context sibling',
|
||||
name: 'QA Space Missions sibling',
|
||||
icon: 'science',
|
||||
source: 'QA',
|
||||
updateInterval: -1,
|
||||
@@ -559,94 +423,48 @@ try {
|
||||
async destroy() {},
|
||||
getStats() { return { count: 1, status: 'live' }; },
|
||||
});
|
||||
const original = {
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
};
|
||||
const siblingLayerEntry = dataManager.layers.get(siblingId);
|
||||
siblingLayerEntry.initialized = true;
|
||||
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.init = async () => true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => true;
|
||||
rocketEntry.module.disable = async () => true;
|
||||
const restoreMissions = stubMissions(rocketEntry);
|
||||
try {
|
||||
const voiceOn = await dataManager.setEnabled('rocket-launches', true, { origin: 'voice' });
|
||||
await new Promise((resolve) => setTimeout(resolve, 80));
|
||||
const voiceState = {
|
||||
voiceOn,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingIsolated: !dataManager.isEffectivelyEnabled(siblingId),
|
||||
};
|
||||
const snapshotBeforeOff = [...(styleManager._contextControls._contextSessionSnapshot?.enabledLayerIds || [])];
|
||||
const voiceOff = await dataManager.setEnabled('rocket-launches', false, { origin: 'voice' });
|
||||
const reactionCountAfterOff = styleManager._contextControls._contextLayerReactionPromises.size;
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
const restoredSiblingEntry = dataManager.layers.get(siblingId);
|
||||
const voiceExit = {
|
||||
voiceOff,
|
||||
snapshotBeforeOff,
|
||||
reactionCountAfterOff,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingRestored: dataManager.isEffectivelyEnabled(siblingId),
|
||||
siblingEnabled: restoredSiblingEntry?.enabled,
|
||||
siblingLifecycle: restoredSiblingEntry?.lifecycleState,
|
||||
restoreActive: Boolean(styleManager._contextControls._contextRestoreState),
|
||||
};
|
||||
|
||||
await dataManager.setEnabled('rocket-launches', true, { origin: 'programmatic' });
|
||||
await new Promise((resolve) => setTimeout(resolve, 40));
|
||||
const internalState = {
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
missionEnabled: dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
};
|
||||
await dataManager.setEnabled('rocket-launches', false, { origin: 'programmatic' });
|
||||
return { exercised: true, voiceState, voiceExit, internalState };
|
||||
const results = {};
|
||||
for (const origin of ['user', 'voice', 'programmatic']) {
|
||||
const on = await dataManager.setEnabled('rocket-launches', true, { origin });
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
const during = {
|
||||
on,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
snapshot: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingOn: dataManager.isEffectivelyEnabled(siblingId),
|
||||
};
|
||||
const off = await dataManager.setEnabled('rocket-launches', false, { origin });
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
results[origin] = {
|
||||
...during,
|
||||
off,
|
||||
siblingOnAfter: dataManager.isEffectivelyEnabled(siblingId),
|
||||
snapshotAfter: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
};
|
||||
}
|
||||
return { exercised: true, results };
|
||||
} finally {
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
restoreMissions();
|
||||
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
|
||||
siblingLayerEntry.initialized = original.siblingInitialized;
|
||||
await window.__gevQaUnregisterLayer(dataManager, siblingId);
|
||||
}
|
||||
});
|
||||
check(
|
||||
'voice Space Missions uses the same Context snapshot and exact-restore transaction as UI entry',
|
||||
voiceMissionEntry.exercised
|
||||
&& voiceMissionEntry.voiceState?.voiceOn
|
||||
&& voiceMissionEntry.voiceState.mode === 'space-missions'
|
||||
&& voiceMissionEntry.voiceState.entering === null
|
||||
&& voiceMissionEntry.voiceState.snapshotRetained
|
||||
&& voiceMissionEntry.voiceState.siblingIsolated
|
||||
&& voiceMissionEntry.voiceExit?.voiceOff
|
||||
&& voiceMissionEntry.voiceExit.mode === null
|
||||
&& voiceMissionEntry.voiceExit.entering === null
|
||||
&& !voiceMissionEntry.voiceExit.snapshotRetained
|
||||
&& voiceMissionEntry.voiceExit.siblingRestored,
|
||||
JSON.stringify(voiceMissionEntry),
|
||||
);
|
||||
check(
|
||||
'internal programmatic Space Missions activation does not create a user Context session',
|
||||
voiceMissionEntry.internalState?.missionEnabled
|
||||
&& voiceMissionEntry.internalState.mode === null
|
||||
&& voiceMissionEntry.internalState.entering === null
|
||||
&& !voiceMissionEntry.internalState.snapshotRetained,
|
||||
JSON.stringify(voiceMissionEntry),
|
||||
'Space Missions is an ordinary layer: no Context session, no isolation, from any origin',
|
||||
ordinaryMissionLayer.exercised
|
||||
&& Object.values(ordinaryMissionLayer.results || {}).length === 3
|
||||
&& Object.values(ordinaryMissionLayer.results).every((entry) =>
|
||||
entry.on === true
|
||||
&& entry.mode === null
|
||||
&& !entry.snapshot
|
||||
&& entry.siblingOn
|
||||
&& entry.off === true
|
||||
&& entry.siblingOnAfter
|
||||
&& !entry.snapshotAfter),
|
||||
JSON.stringify(ordinaryMissionLayer),
|
||||
);
|
||||
await page.evaluate(() => window.__godsEyeView.dataManager.setEnabled(
|
||||
'flights',
|
||||
@@ -1998,98 +1816,6 @@ try {
|
||||
}),
|
||||
);
|
||||
|
||||
// Cyber relocates its collapsed briefing header into the expanded utility
|
||||
// lane. Exercise actual height changes without reload and measure both cards.
|
||||
await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
manager._setHudVariant('cyber');
|
||||
manager.hud.setMode('on');
|
||||
manager._setCockpitDisclosure('display', false);
|
||||
manager._setCockpitDisclosure('radio', true);
|
||||
});
|
||||
const cyberRadioOrder = await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
manager.cockpitView.syncSignalLayout();
|
||||
const display = document
|
||||
.getElementById('cockpit-display-toggle-btn')
|
||||
.closest('.cockpit-utility-control');
|
||||
const radio = document
|
||||
.getElementById('cockpit-radio-toggle-btn')
|
||||
.closest('.cockpit-utility-control');
|
||||
const displayRect = display.getBoundingClientRect();
|
||||
const radioRect = radio.getBoundingClientRect();
|
||||
return {
|
||||
display: displayRect.toJSON(),
|
||||
radio: radioRect.toJSON(),
|
||||
displayExpanded: display.classList.contains('is-expanded'),
|
||||
radioExpanded: radio.classList.contains('is-expanded'),
|
||||
gap: radioRect.top - displayRect.bottom,
|
||||
};
|
||||
});
|
||||
check(
|
||||
'Cyber expanding Radio preserves the authored Display-then-Radio order',
|
||||
!cyberRadioOrder.displayExpanded
|
||||
&& cyberRadioOrder.radioExpanded
|
||||
&& cyberRadioOrder.display.height > 0
|
||||
&& cyberRadioOrder.radio.height > 0
|
||||
&& cyberRadioOrder.gap >= 7,
|
||||
JSON.stringify(cyberRadioOrder),
|
||||
);
|
||||
await page.screenshot({ path: path.join(shotsDir, 'cyber-radio-order.png') });
|
||||
await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
manager._setCockpitDisclosure('radio', false);
|
||||
manager._setCockpitDisclosure('display', true);
|
||||
});
|
||||
const cyberStyleStates = await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
const states = [];
|
||||
for (const style of ['normal', 'surveillance', 'thermal', 'retro']) {
|
||||
document.querySelector(`.style-btn[data-style="${style}"]`).click();
|
||||
states.push({
|
||||
requestedStyle: style,
|
||||
activeStyle: manager.activeStyle,
|
||||
hud: manager.hud.getVariant(),
|
||||
theme: document.documentElement.dataset.uiTheme,
|
||||
selector: document.getElementById('hud-layout-select').value,
|
||||
savedHud: manager.getVisualState().hud.variant,
|
||||
});
|
||||
}
|
||||
return states;
|
||||
});
|
||||
check('Cockpit visual-style controls retain Cyber HUD, selector, shell and saved layout',
|
||||
cyberStyleStates.every(state => state.activeStyle === state.requestedStyle
|
||||
&& state.hud === 'cyber' && state.theme === 'cyber'
|
||||
&& state.selector === 'cyber' && state.savedHud === 'cyber'),
|
||||
JSON.stringify(cyberStyleStates));
|
||||
for (const height of [987, 720, 640, 900]) {
|
||||
await page.setViewport({ width: 1440, height, deviceScaleFactor: 1 });
|
||||
await new Promise((resolve) => setTimeout(resolve, 400));
|
||||
const geometry = await page.evaluate(() => {
|
||||
const signal = document.getElementById('cockpit-signal-stream');
|
||||
const utility = document.getElementById('cockpit-utility-controls');
|
||||
const expanded = utility.querySelector('.cockpit-utility-control.is-expanded');
|
||||
const s = signal.getBoundingClientRect();
|
||||
const u = expanded.getBoundingClientRect();
|
||||
const toggle = document.getElementById('cockpit-signal-toggle');
|
||||
const t = toggle.getBoundingClientRect();
|
||||
const hit = document.elementFromPoint(t.x + t.width / 2, t.y + t.height / 2);
|
||||
return { height: innerHeight, theme: document.documentElement.dataset.uiTheme,
|
||||
collapsed: signal.dataset.collapsed, signal: s.toJSON(), utility: u.toJSON(),
|
||||
reachable: Boolean(hit && toggle.contains(hit)),
|
||||
contained: u.bottom <= s.top - 7 && s.bottom < innerHeight,
|
||||
};
|
||||
});
|
||||
check(`Cyber collapsed Live Signals remains visible and reachable after resize to ${height}px`,
|
||||
geometry.theme === 'cyber' && geometry.collapsed === 'true'
|
||||
&& geometry.signal.width > 0 && geometry.signal.height > 0
|
||||
&& geometry.reachable && geometry.contained, JSON.stringify(geometry));
|
||||
if (height === 640 || height === 900) {
|
||||
await page.screenshot({ path: path.join(shotsDir, `cyber-resize-${height}.png`) });
|
||||
}
|
||||
}
|
||||
await page.evaluate(() => window.__godsEyeView.styleManager._setHudVariant('tactical'));
|
||||
|
||||
const signalTransition = await page.evaluate(async () => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
const cockpit = manager.cockpitView;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* E4 diversity : ≥5 distinct glyph data-URIs displayed ambiently after
|
||||
* enrichment (expected: 8)
|
||||
* E5 glyphs : every billboard's image === aircraftIcon(classify(typeCode))
|
||||
* E6 scales : every billboard's scale === CLASS_SCALE_2D[klass]
|
||||
* E6 scales : every billboard's scale === 1, whatever its class
|
||||
* E7 bounds : ≤4 concurrent requests, ≥185 ms between dispatches (≤5/s
|
||||
* drip), total ≤300 (budget ceiling)
|
||||
* E8 next poll : another poll neither reverts glyphs nor re-requests hexes
|
||||
@@ -53,7 +53,7 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import puppeteer from 'puppeteer';
|
||||
import { classifyAircraft, CLASS_SCALE_2D } from '../src/data/aircraftClass.js';
|
||||
import { classifyAircraft } from '../src/data/aircraftClass.js';
|
||||
import { aircraftIcon } from '../src/data/aircraftIcons.js';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -362,7 +362,7 @@ async function main() {
|
||||
const bb = beforeById.get(hex);
|
||||
if (!bb) baselineBad.push(`${hex}:missing`);
|
||||
else if (bb.image !== AIRLINER_ICON) baselineBad.push(`${hex}:not-default-glyph`);
|
||||
else if (Math.abs(bb.scale - (CLASS_SCALE_2D.airliner || 1)) > 1e-9) baselineBad.push(`${hex}:scale=${bb.scale}`);
|
||||
else if (Math.abs(bb.scale - 1) > 1e-9) baselineBad.push(`${hex}:scale=${bb.scale}`);
|
||||
}
|
||||
record('E2 baseline: all 12 category-0 planes default to the airliner glyph',
|
||||
baselineBad.length === 0,
|
||||
@@ -415,13 +415,13 @@ async function main() {
|
||||
for (const [hex, klass] of expected) {
|
||||
const bb = afterById.get(hex);
|
||||
const wantImg = aircraftIcon(klass);
|
||||
const wantScale = CLASS_SCALE_2D[klass] || 1;
|
||||
const wantScale = 1;
|
||||
if (!bb || bb.image !== wantImg) glyphBad.push(`${hex}(${klass})${bb ? ':wrong-image' : ':missing'}`);
|
||||
if (bb && Math.abs(bb.scale - wantScale) > 1e-9) scaleBad.push(`${hex}: ${bb.scale} != ${wantScale}`);
|
||||
}
|
||||
record('E5 glyphs: every billboard matches aircraftIcon(classify(typeCode))',
|
||||
glyphBad.length === 0, glyphBad.length ? glyphBad.join(' ') : `${expected.size} matched (incl. the found:false miss staying airliner)`);
|
||||
record('E6 scales: every billboard has its per-class CLASS_SCALE_2D',
|
||||
record('E6 scales: every billboard has the one fleet scale',
|
||||
scaleBad.length === 0, scaleBad.length ? scaleBad.join(' ') : 'all scales exact (composes with scaleByDistance)');
|
||||
|
||||
await page.screenshot({ path: path.join(SHOT_DIR, 'enrich-after-diverse.png') });
|
||||
@@ -469,7 +469,7 @@ async function main() {
|
||||
for (const [hex, klass] of expected) {
|
||||
const bb = afterPollById.get(hex);
|
||||
if (!bb || bb.image !== aircraftIcon(klass)) pollBad.push(`${hex}(${klass})${bb ? ':reverted' : ':missing'}`);
|
||||
else if (Math.abs(bb.scale - (CLASS_SCALE_2D[klass] || 1)) > 1e-9) pollBad.push(`${hex}:scale-reverted`);
|
||||
else if (Math.abs(bb.scale - 1) > 1e-9) pollBad.push(`${hex}:scale-reverted`);
|
||||
}
|
||||
const noReRequests = afterPoll.starts === Object.keys(TYPES).length;
|
||||
record('E8 next poll: enriched glyphs persist and no hex is re-requested',
|
||||
|
||||
@@ -276,21 +276,21 @@ const MUTATIONS = [
|
||||
},
|
||||
{
|
||||
defect: 'the tile stops promising the fires it actually turns on',
|
||||
file: 'html',
|
||||
file: 'module',
|
||||
from: " 'Live earthquakes and active fires, from USGS and NASA',",
|
||||
to: " 'Live earthquakes worldwide, straight from USGS',",
|
||||
},
|
||||
{
|
||||
defect: 'the owner-authored first-run line is quietly rewritten',
|
||||
defect: 'the maintainer-authored first-run line is quietly rewritten',
|
||||
file: 'html',
|
||||
from: 'It feels like a forbidden cockpit—then you realize the sources are public and the data is real.',
|
||||
to: "It feels like a forbidden cockpit. It isn't — every feed is public, and every contact is live.",
|
||||
to: 'A live 3D globe of public data. Pick a view to begin.',
|
||||
},
|
||||
{
|
||||
defect: 'the ledgered global-chip defect loses its pointer to the real fix',
|
||||
file: 'module',
|
||||
from: ' // means a KEY REQUIRED terminal state in src/loadingFeedback.js, a state',
|
||||
to: ' // (note removed)',
|
||||
from: ' // ends KEY REQUIRED (src/loadingFeedback.js), and the quakes half of the',
|
||||
to: ' // ends KEY REQUIRED, and the quakes half of the',
|
||||
},
|
||||
{
|
||||
defect: 'the globe missions never pull the camera out',
|
||||
@@ -307,14 +307,14 @@ const MUTATIONS = [
|
||||
{
|
||||
defect: 'a cancelled globe flight fails the whole mission',
|
||||
file: 'module',
|
||||
from: ' .catch(() => null);',
|
||||
to: ' .catch(() => { throw new Error("flight failed"); });',
|
||||
from: ' .catch(() => null)\n : null;',
|
||||
to: ' .catch(() => { throw new Error("flight failed"); })\n : null;',
|
||||
},
|
||||
{
|
||||
defect: 'Explore manually quietly runs a mission instead of nothing',
|
||||
file: 'module',
|
||||
from: "if (mission.kind === 'none') return { ok: true, choice };",
|
||||
to: "if (mission.kind === 'none') return { ok: true, choice, ran: await setContextMode('contacts') };",
|
||||
to: "if (mission.kind === 'none') return { ok: true, choice, ran: await setLayerEnabled('rocket-launches') };",
|
||||
},
|
||||
{
|
||||
defect: 'an unknown choice is treated as a success',
|
||||
@@ -348,15 +348,14 @@ const MUTATIONS = [
|
||||
{
|
||||
defect: 'a mission persists a 3D-models choice nobody made',
|
||||
file: 'module',
|
||||
from: ' const result = await styleManager.setContextMode(mode);',
|
||||
to: ' styleManager._setModels3dEnabled?.(true);\n const result = await styleManager.setContextMode(mode);',
|
||||
from: " setLayerEnabled: (layerId) =>\n dataManager.setEnabled(layerId, true, { origin: 'user' }),",
|
||||
to: " setLayerEnabled: (layerId) => {\n styleManager._setModels3dEnabled?.(true);\n return dataManager.setEnabled(layerId, true, { origin: 'user' });\n },",
|
||||
},
|
||||
{
|
||||
defect:
|
||||
'the Context panel is left collapsed, hiding the mode that just started',
|
||||
defect: 'a mission writes panel chrome nobody chose',
|
||||
file: 'module',
|
||||
from: " styleManager.setPanelCollapsed?.('global-context-panel', false, {\n explicit: true,\n });",
|
||||
to: ' // panel reveal removed',
|
||||
from: ' flyToGlobe: () => styleManager.resetToGlobeView(),',
|
||||
to: " flyToGlobe: () => {\n styleManager.setPanelCollapsed?.('global-context-panel', false, { explicit: true });\n return styleManager.resetToGlobeView();\n },",
|
||||
},
|
||||
{
|
||||
defect:
|
||||
@@ -371,8 +370,8 @@ const MUTATIONS = [
|
||||
defect:
|
||||
'disabling the focused tile drops the keyboard to <body> mid-flight',
|
||||
file: 'html',
|
||||
from: ':aria-disabled="launcher?.busy ?? undefined" @click="controls?.choose(\'contacts\')"',
|
||||
to: ':disabled="launcher?.busy === \'true\'" @click="controls?.choose(\'contacts\')"',
|
||||
from: ':aria-disabled="String(settling || launcher?.busy === \'true\')" @click="onPrimary"',
|
||||
to: ':disabled="launcher?.busy === \'true\'" @click="onPrimary"',
|
||||
},
|
||||
{
|
||||
defect: 'Tab escapes into an app the visitor has not seen yet',
|
||||
@@ -421,8 +420,8 @@ const MUTATIONS = [
|
||||
defect:
|
||||
'the card loses its viewport cap and clips on a short landscape phone',
|
||||
file: 'css',
|
||||
from: ' max-height: calc(100dvh - 1.5rem);',
|
||||
to: ' /* cap removed */',
|
||||
from: ' body.mobile-shell #first-run-launcher {\n bottom: 5.8rem;\n max-height: calc(100vh - 6.55rem);\n max-height: calc(100dvh - 6.55rem);\n }',
|
||||
to: ' body.mobile-shell #first-run-launcher {\n bottom: 5.8rem;\n /* cap removed */\n }',
|
||||
},
|
||||
{
|
||||
defect:
|
||||
@@ -437,7 +436,7 @@ const MUTATIONS = [
|
||||
// those instead and prove nothing about this feature.
|
||||
defect: "the launcher's reduced-motion opt-out is dropped",
|
||||
file: 'css',
|
||||
from: ' #first-run-launcher,\n .first-run-choices button,\n .first-run-arrow {\n transition: none;\n }\n /* Scrolling a tile into view must not animate either. */\n .first-run-choices {\n scroll-behavior: auto;\n }',
|
||||
from: ' #first-run-launcher,\n .first-run-backdrop,\n .first-run-back,\n .first-run-missions button,\n .first-run-link-card,\n .first-run-link-button,\n .first-run-enter {\n transition: none;\n }\n /* Scrolling a tile into view must not animate either. */\n .first-run-choices {\n scroll-behavior: auto;\n }',
|
||||
to: ' .first-run-nothing {\n transition: none;\n }',
|
||||
},
|
||||
|
||||
@@ -445,20 +444,20 @@ const MUTATIONS = [
|
||||
{
|
||||
defect: 'a mission tile is dropped from the menu',
|
||||
file: 'html',
|
||||
from: ' <button type="button" data-first-run-choice="space-missions"',
|
||||
to: ' <button type="button" data-first-run-choice-disabled="space-missions"',
|
||||
from: ' <button type="button" data-first-run-start="space-missions"',
|
||||
to: ' <button type="button" data-first-run-start-disabled="space-missions"',
|
||||
},
|
||||
{
|
||||
defect: "the menu order stops matching the owner's",
|
||||
file: 'html',
|
||||
from: '<button type="button" data-first-run-choice="environmental"',
|
||||
to: '<button type="button" data-first-run-choice="zzz-environmental"',
|
||||
from: '<button type="button" data-first-run-start="environmental"',
|
||||
to: '<button type="button" data-first-run-start="zzz-environmental"',
|
||||
},
|
||||
{
|
||||
defect: 'the "don\'t show again" checkbox is removed',
|
||||
defect: 'the "don\'t show again" checkbox loses its hook',
|
||||
file: 'html',
|
||||
from: '<input type="checkbox" data-first-run-suppress @change="onSuppress" />',
|
||||
to: '<span data-first-run-suppress-removed></span>',
|
||||
from: '<UiCheckbox class="first-run-suppress" :input-attrs="suppressBoxAttrs" @change="onSuppress">',
|
||||
to: '<UiCheckbox class="first-run-suppress" @change="onSuppress">',
|
||||
},
|
||||
{
|
||||
defect: 'the status line stops being a polite live region',
|
||||
|
||||
+108
-42
@@ -33,7 +33,7 @@ const TEETH = args.includes('--teeth');
|
||||
const HEADFUL = args.includes('--headful');
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const SHOT_DIR = path.join(ROOT, 'qa-shots', 'firstrun');
|
||||
const SHOT_DIR = process.env.QA_OUTPUT_DIR || path.join(ROOT, 'qa-shots', 'firstrun');
|
||||
|
||||
const CHROME_CANDIDATES = [
|
||||
process.env.PUPPETEER_EXECUTABLE_PATH,
|
||||
@@ -109,7 +109,7 @@ const appState = (page) => page.evaluate(() => {
|
||||
const gev = window.__godsEyeView || {};
|
||||
const sm = gev.styleManager;
|
||||
const dm = gev.dataManager;
|
||||
const carto = sm?.viewer?.camera?.positionCartographic;
|
||||
const carto = gev.viewer?.camera?.positionCartographic;
|
||||
const layers = {};
|
||||
const counts = {};
|
||||
const all = dm?.getAll?.() || [];
|
||||
@@ -170,8 +170,22 @@ async function watchLoadingChip(page) {
|
||||
|
||||
const readLoadingChip = (page) => page.evaluate(() => window.__chipSeen || []);
|
||||
|
||||
async function nextStep(page, readySelector) {
|
||||
await page.click('[data-first-run-next]');
|
||||
await page.waitForSelector(readySelector, { visible: true });
|
||||
await page.waitForFunction(() => {
|
||||
const steps = [...document.querySelectorAll('#first-run-launcher .first-run-step')];
|
||||
return steps.length === 1
|
||||
&& !/first-run-step-(forward|back)-(enter|leave)-/.test(steps[0].className)
|
||||
&& document.querySelector('[data-first-run-primary]')?.getAttribute('aria-disabled') !== 'true';
|
||||
});
|
||||
}
|
||||
|
||||
async function pick(page, choice, { timeout = 40000, settle = [] } = {}) {
|
||||
await page.click(`[data-first-run-choice="${choice}"]`);
|
||||
await nextStep(page, '[data-first-run-start]');
|
||||
await page.click(`[data-first-run-start="${choice}"]`);
|
||||
await nextStep(page, '[data-first-run-choice]');
|
||||
await page.click('[data-first-run-choice]');
|
||||
await page.waitForFunction(
|
||||
(sel) => !document.querySelector(sel) || !document.querySelector(sel).classList.contains('visible'),
|
||||
{ timeout },
|
||||
@@ -190,8 +204,8 @@ async function pick(page, choice, { timeout = 40000, settle = [] } = {}) {
|
||||
/** Every section the run is expected to reach; the teeth verdict requires all. */
|
||||
const EXPECTED_SECTIONS = [
|
||||
'show-policy', 'esc-arbitration',
|
||||
'mission-environmental', 'mission-contacts', 'mission-space', 'mission-explore',
|
||||
'viewports', 'console',
|
||||
'mission-environmental', 'mission-space', 'mission-explore',
|
||||
'stories-card', 'viewports', 'console',
|
||||
];
|
||||
|
||||
/*
|
||||
@@ -482,8 +496,8 @@ async function main() {
|
||||
record('a fresh session gets the launcher', freshVisible);
|
||||
if (freshVisible) shots.push(await shoot(page, 'launcher-desktop'));
|
||||
|
||||
const focused = await page.evaluate(() => document.activeElement?.dataset?.firstRunChoice ?? null);
|
||||
record('focus lands on the first mission tile', focused === 'contacts', `activeElement=${focused}`);
|
||||
const focused = await page.evaluate(() => document.activeElement?.hasAttribute('data-first-run-next') ?? false);
|
||||
record('focus lands on Next', focused === true, `activeElement=${focused}`);
|
||||
|
||||
// The card is a flex column (so its list can scroll on short viewports),
|
||||
// and an author `display` on this id outranks the UA's `[hidden]` rule.
|
||||
@@ -500,10 +514,11 @@ async function main() {
|
||||
record('the hidden attribute still hides the flex card', hiddenHonored === 'none',
|
||||
`computed display while hidden = ${hiddenHonored}`);
|
||||
|
||||
const tiles = await page.$$eval('[data-first-run-choice]', (nodes) => nodes.map((n) => n.dataset.firstRunChoice));
|
||||
await nextStep(page, '[data-first-run-start]');
|
||||
const tiles = await page.$$eval('[data-first-run-start]', (nodes) => nodes.map((n) => n.dataset.firstRunStart));
|
||||
record(
|
||||
'four tiles in the owner\'s order',
|
||||
JSON.stringify(tiles) === JSON.stringify(['contacts', 'space-missions', 'environmental', 'explore']),
|
||||
'three tiles in the owner\'s order',
|
||||
JSON.stringify(tiles) === JSON.stringify(['space-missions', 'environmental', 'explore']),
|
||||
tiles.join(' · '),
|
||||
);
|
||||
|
||||
@@ -558,7 +573,7 @@ async function main() {
|
||||
|
||||
// ── Mission outcomes ────────────────────────────────────────────────────
|
||||
// One section PER MISSION: a throw in one (a tile that never rendered under
|
||||
// --teeth, say) must not take the other four down with it, or the teeth
|
||||
// --teeth, say) must not take the other two down with it, or the teeth
|
||||
// tally reports "reached" for assertions that never ran.
|
||||
let state;
|
||||
let before;
|
||||
@@ -642,47 +657,93 @@ async function main() {
|
||||
shots.push(await shoot(page, 'mission-environmental'));
|
||||
});
|
||||
|
||||
await section('mission-contacts', async () => {
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
await pick(page, 'contacts');
|
||||
state = await appState(page);
|
||||
record('LIVE CONTACTS activates the Contacts context mode', state.contextMode === 'flights',
|
||||
`contextMode=${state.contextMode}`);
|
||||
const panelOpen = await page.evaluate(() => {
|
||||
const panel = document.getElementById('global-context-panel');
|
||||
return !!panel && !panel.classList.contains('collapsed');
|
||||
});
|
||||
record('LIVE CONTACTS reveals the Context panel', panelOpen);
|
||||
record('LIVE CONTACTS still leaves the detection override untouched',
|
||||
state.detectionOverridden === false, `_detectionUserOverridden=${state.detectionOverridden}`);
|
||||
shots.push(await shoot(page, 'mission-contacts'));
|
||||
});
|
||||
|
||||
await section('mission-space', async () => {
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
await pick(page, 'space-missions');
|
||||
state = await appState(page);
|
||||
record('SPACE MISSIONS activates its context mode', state.contextMode === 'space-missions',
|
||||
`contextMode=${state.contextMode}`);
|
||||
const missions = await page.evaluate(() => {
|
||||
const panel = document.getElementById('space-missions-panel');
|
||||
return {
|
||||
layerOn: window.__godsEyeView.dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
panelOpen: !!panel && !panel.hidden && !panel.classList.contains('collapsed'),
|
||||
};
|
||||
});
|
||||
record('SPACE MISSIONS switches its layer on without a Context mode',
|
||||
missions.layerOn && state.contextMode == null,
|
||||
`layerOn=${missions.layerOn} contextMode=${state.contextMode}`);
|
||||
record('SPACE MISSIONS opens its own panel', missions.panelOpen,
|
||||
`panelOpen=${missions.panelOpen}`);
|
||||
record('SPACE MISSIONS still leaves the detection override untouched',
|
||||
state.detectionOverridden === false, `_detectionUserOverridden=${state.detectionOverridden}`);
|
||||
shots.push(await shoot(page, 'mission-space-missions'));
|
||||
});
|
||||
|
||||
await section('mission-explore', async () => {
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
// Start below the mission overview so an accidental overview flight is observable.
|
||||
await page.evaluate(() => {
|
||||
const camera = window.__godsEyeView.viewer.camera;
|
||||
camera.cancelFlight();
|
||||
camera.setView({ destination: camera.position.constructor.fromDegrees(-97.7431, 30.2672, 100000) });
|
||||
});
|
||||
const beforeExplore = await appState(page);
|
||||
await pick(page, 'explore');
|
||||
state = await appState(page);
|
||||
record('EXPLORE MANUALLY enables no layer and no context mode',
|
||||
Object.values(state.layers).every((on) => !on) && state.contextMode === null,
|
||||
Object.entries(state.layers).filter(([, on]) => on).map(([id]) => id).join(', ') || 'nothing enabled');
|
||||
// The real claim is that Explore issues no camera command of its own: the
|
||||
// arrival fly-in owns the camera and must still be heading down, not out.
|
||||
record('EXPLORE MANUALLY never commandeers the camera',
|
||||
(state.heightKm ?? 0) < 12000 && (state.heightKm ?? 1e9) <= (beforeExplore.heightKm ?? 1e9),
|
||||
`${beforeExplore.heightKm} → ${state.heightKm} km (globe would be 18000)`);
|
||||
beforeExplore.heightKm === 100 && state.heightKm === beforeExplore.heightKm,
|
||||
`${beforeExplore.heightKm} → ${state.heightKm} km (expected 100 → 100 km)`);
|
||||
shots.push(await shoot(page, 'mission-explore'));
|
||||
});
|
||||
|
||||
await section('stories-card', async () => {
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
const backdrop = await page.evaluate(() => {
|
||||
const el = document.querySelector('.first-run-backdrop');
|
||||
if (!el) return null;
|
||||
const style = getComputedStyle(el);
|
||||
return {
|
||||
filter: style.backdropFilter || style.webkitBackdropFilter || 'none',
|
||||
background: style.backgroundColor,
|
||||
pointerEvents: style.pointerEvents,
|
||||
};
|
||||
});
|
||||
record('the welcome backdrop tints the globe without blurring it',
|
||||
!!backdrop && backdrop.filter === 'none' && backdrop.background !== 'rgba(0, 0, 0, 0)'
|
||||
&& backdrop.pointerEvents === 'none',
|
||||
JSON.stringify(backdrop));
|
||||
await nextStep(page, '[data-first-run-start]');
|
||||
await nextStep(page, '[data-first-run-choice]');
|
||||
const button = await page.evaluate(() => {
|
||||
const el = document.querySelector('#first-run-launcher [data-first-run-stories]');
|
||||
return el ? { tag: el.tagName, href: el.getAttribute('href'), target: el.getAttribute('target') } : null;
|
||||
});
|
||||
record('the GEV Stories card offers an in-app BROWSE STORIES button',
|
||||
button?.tag === 'BUTTON' && button.href === null && button.target === null,
|
||||
JSON.stringify(button));
|
||||
const pagesBefore = (await browser.pages()).length;
|
||||
await page.click('#first-run-launcher [data-first-run-stories]');
|
||||
const opened = await page.waitForFunction(
|
||||
() => document.body.classList.contains('stories-mode')
|
||||
&& !!document.querySelector('#gev-stories .app'),
|
||||
{ timeout: 30000 },
|
||||
).then(() => true, () => false);
|
||||
const after = await page.evaluate((sel) => ({
|
||||
launcherVisible: !!document.querySelector(sel)?.classList.contains('visible'),
|
||||
session: sessionStorage.getItem('gev:first-run-mission-session:v1'),
|
||||
query: location.search,
|
||||
}), LAUNCHER);
|
||||
record('BROWSE STORIES opens Stories Explore in this tab',
|
||||
opened && (await browser.pages()).length === pagesBefore,
|
||||
`stories-mode=${opened}, query=${after.query}`);
|
||||
record('BROWSE STORIES closes the welcome card for the session',
|
||||
!after.launcherVisible && after.session !== null,
|
||||
`visible=${after.launcherVisible}, session=${after.session}`);
|
||||
shots.push(await shoot(page, 'stories-card-explore'));
|
||||
});
|
||||
|
||||
// ── Viewports ───────────────────────────────────────────────────────────
|
||||
await section('viewports', async () => {
|
||||
// Portrait phone, LANDSCAPE phone (the short viewport that clipped the card
|
||||
@@ -695,6 +756,8 @@ async function main() {
|
||||
for (const vp of VIEWPORTS) {
|
||||
await page.setViewport({ width: vp.width, height: vp.height, deviceScaleFactor: vp.dpr });
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
for (let step = 1; step <= 3; step++) {
|
||||
if (step > 1) await nextStep(page, step === 2 ? '[data-first-run-start]' : '[data-first-run-choice]');
|
||||
const box = await page.evaluate((sel) => {
|
||||
const node = document.querySelector(sel);
|
||||
if (!node) return null;
|
||||
@@ -715,22 +778,23 @@ async function main() {
|
||||
const fits = !!box && box.top >= 0 && box.bottom <= box.vh
|
||||
&& box.left >= 0 && box.right <= box.vw;
|
||||
record(
|
||||
`the launcher fits a ${vp.label} with no clipping`,
|
||||
`step ${step} fits a ${vp.label} with no clipping`,
|
||||
fits,
|
||||
box ? `${box.left},${box.top} → ${box.right},${box.bottom} in ${box.vw}x${box.vh}${box.listScrolls ? ' (list scrolls)' : ''}` : 'absent',
|
||||
);
|
||||
record(`"Don't show this again" stays on screen at ${vp.width}x${vp.height}`,
|
||||
record(`step ${step} checkbox stays on screen at ${vp.width}x${vp.height}`,
|
||||
!!box?.checkboxOnScreen);
|
||||
|
||||
// Discoverability: if the list scrolls, the LAST tile must still peek
|
||||
// above the fold. A fold that lands exactly between tiles looks like a
|
||||
// complete list of four, and the fifth mission is simply never found.
|
||||
// complete list, and the last mission is simply never found.
|
||||
if (step === 2) {
|
||||
const peek = await page.evaluate((sel) => {
|
||||
const node = document.querySelector(sel);
|
||||
const list = node?.querySelector('.first-run-choices');
|
||||
if (!list) return null;
|
||||
list.scrollTop = 0;
|
||||
const tiles = [...list.querySelectorAll('[data-first-run-choice]')];
|
||||
const tiles = [...list.querySelectorAll('[data-first-run-start]')];
|
||||
const last = tiles[tiles.length - 1];
|
||||
if (!last) return null;
|
||||
const listBox = list.getBoundingClientRect();
|
||||
@@ -739,7 +803,7 @@ async function main() {
|
||||
return {
|
||||
scrolls: list.scrollHeight > list.clientHeight + 1,
|
||||
fraction: lastBox.height ? visible / lastBox.height : 0,
|
||||
label: last.dataset.firstRunChoice,
|
||||
label: last.dataset.firstRunStart,
|
||||
};
|
||||
}, LAUNCHER);
|
||||
record(
|
||||
@@ -755,7 +819,7 @@ async function main() {
|
||||
const reach = await page.evaluate(async (sel) => {
|
||||
const node = document.querySelector(sel);
|
||||
if (!node) return null;
|
||||
const targets = [...node.querySelectorAll('[data-first-run-choice], [data-first-run-suppress]')];
|
||||
const targets = [...node.querySelectorAll('[data-first-run-start], [data-first-run-suppress]')];
|
||||
const offscreen = [];
|
||||
for (const target of targets) {
|
||||
target.focus();
|
||||
@@ -764,7 +828,7 @@ async function main() {
|
||||
const host = node.getBoundingClientRect();
|
||||
if (document.activeElement !== target
|
||||
|| rect.bottom <= host.top || rect.top >= host.bottom) {
|
||||
offscreen.push(target.dataset.firstRunChoice || 'suppress-checkbox');
|
||||
offscreen.push(target.dataset.firstRunStart || 'suppress-checkbox');
|
||||
}
|
||||
}
|
||||
return { count: targets.length, offscreen };
|
||||
@@ -773,7 +837,7 @@ async function main() {
|
||||
// A hardcoded count silently turns into a failure the day the menu
|
||||
// changes, which is exactly what it did when a tile was removed.
|
||||
const expectedFocusable = await page.$$eval(
|
||||
'[data-first-run-choice]', (nodes) => nodes.length,
|
||||
'[data-first-run-start]', (nodes) => nodes.length,
|
||||
) + 1;
|
||||
record(
|
||||
`every tile and the checkbox are keyboard-reachable at ${vp.width}x${vp.height}`,
|
||||
@@ -782,6 +846,7 @@ async function main() {
|
||||
? `${reach.count}/${expectedFocusable} focusable${reach.offscreen.length ? `, unreachable: ${reach.offscreen.join(', ')}` : ''}`
|
||||
: 'absent',
|
||||
);
|
||||
}
|
||||
// The reachability probe above tabs to the last tile and scrolls the list
|
||||
// with it. Put it back to the top so the taste-pass shot shows what a
|
||||
// visitor actually opens on.
|
||||
@@ -791,7 +856,8 @@ async function main() {
|
||||
document.activeElement?.blur?.();
|
||||
}, LAUNCHER);
|
||||
await sleep(250);
|
||||
shots.push(await shoot(page, `launcher-${vp.name}`));
|
||||
shots.push(await shoot(page, `launcher-${vp.name}-step-${step}`));
|
||||
}
|
||||
}
|
||||
await page.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
|
||||
});
|
||||
|
||||
@@ -111,7 +111,7 @@ await page.waitForFunction(() => window.__godsEyeView?.viewer && window.__godsEy
|
||||
{ timeout: 150000 });
|
||||
await sleep(12000); // let the boot fly-to settle before pinning
|
||||
await page.evaluate(() => {
|
||||
document.querySelector('#first-run-launcher:not([hidden]) [data-first-run-choice="explore"]')?.click();
|
||||
document.querySelector('#first-run-launcher:not([hidden]) [data-first-run-dismiss]')?.click();
|
||||
});
|
||||
await sleep(600); // let the launcher dismissal finish before taking evidence
|
||||
|
||||
|
||||
@@ -314,17 +314,7 @@ try {
|
||||
}
|
||||
await page.evaluate(() => {
|
||||
document.documentElement.lang = 'en';
|
||||
document.documentElement.dataset.uiTheme = 'cyber';
|
||||
});
|
||||
const cyber = await page.$eval(
|
||||
'#scene-select',
|
||||
(node) => getComputedStyle(node).backgroundColor,
|
||||
);
|
||||
check(
|
||||
'Cyber keeps its native field theme',
|
||||
cyber === 'rgba(26, 35, 39, 0.96)',
|
||||
cyber,
|
||||
);
|
||||
await begin('heading');
|
||||
await page.evaluate(() => {
|
||||
const owner = window.__godsEyeView.styleManager._cctvControls;
|
||||
|
||||
+9
-11
@@ -845,7 +845,7 @@ async function main() {
|
||||
params: {},
|
||||
};
|
||||
let failureUsed = false;
|
||||
const entryLayerId = mode === 'flights' ? 'military-awareness' : 'rocket-launches';
|
||||
const entryLayerId = 'military-awareness';
|
||||
dataManager.setEnabled = async (layerId, shouldEnable) => {
|
||||
const failsIsolation = phase === 'isolation' && layerId === 'local-datacenters' && !shouldEnable;
|
||||
const failsActivation = phase === 'activation' && layerId === entryLayerId && shouldEnable;
|
||||
@@ -872,7 +872,6 @@ async function main() {
|
||||
priorLayerRestored: enabled.has('local-datacenters'),
|
||||
entryEnabled: enabled.has(entryLayerId),
|
||||
flightsButtonDisabled: document.getElementById('global-context-flights-btn').disabled,
|
||||
missionsButtonDisabled: document.getElementById('global-context-missions-btn').disabled,
|
||||
message: document.getElementById('toast').textContent,
|
||||
};
|
||||
};
|
||||
@@ -893,7 +892,7 @@ async function main() {
|
||||
}
|
||||
};
|
||||
const contextFailures = [];
|
||||
for (const mode of ['flights', 'space-missions']) {
|
||||
for (const mode of ['flights']) {
|
||||
for (const phase of ['isolation', 'activation']) {
|
||||
for (const outcome of ['false', 'reject']) {
|
||||
contextFailures.push(await runContextFailure(mode, phase, outcome));
|
||||
@@ -902,7 +901,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const directEntryFailures = [];
|
||||
for (const layerId of ['military-awareness', 'rocket-launches']) {
|
||||
for (const layerId of ['military-awareness']) {
|
||||
for (const outcome of ['false', 'reject']) {
|
||||
enabled.clear();
|
||||
enabled.add('local-datacenters');
|
||||
@@ -971,7 +970,7 @@ async function main() {
|
||||
styleManager._showToast = originalShowToast;
|
||||
|
||||
const directActivationFailures = [];
|
||||
for (const layerId of ['military-awareness', 'rocket-launches']) {
|
||||
for (const layerId of ['military-awareness']) {
|
||||
enabled.clear();
|
||||
styleManager._contextControls._contextMode = null;
|
||||
styleManager._contextControls._contextSessionSnapshot = {
|
||||
@@ -1001,7 +1000,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const directActivationRollbackFailures = [];
|
||||
for (const layerId of ['military-awareness', 'rocket-launches']) {
|
||||
for (const layerId of ['military-awareness']) {
|
||||
enabled.clear();
|
||||
styleManager._contextControls._contextMode = null;
|
||||
styleManager._contextControls._contextSessionSnapshot = {
|
||||
@@ -1211,7 +1210,7 @@ async function main() {
|
||||
check(
|
||||
'user-facing chip, real Context entry rollback, and installation Search failures settle safely',
|
||||
userFacingFailures.semanticFalseMessage === 'Radio could not stop cleanly'
|
||||
&& userFacingFailures.contextFailures.length === 8
|
||||
&& userFacingFailures.contextFailures.length === 4
|
||||
&& userFacingFailures.contextFailures.every((failure) => (
|
||||
failure.result === false
|
||||
&& failure.visibleMode === null
|
||||
@@ -1219,10 +1218,9 @@ async function main() {
|
||||
&& failure.priorLayerRestored
|
||||
&& !failure.entryEnabled
|
||||
&& !failure.flightsButtonDisabled
|
||||
&& !failure.missionsButtonDisabled
|
||||
&& failure.message.includes('QA transition failed')
|
||||
))
|
||||
&& userFacingFailures.directEntryFailures.length === 4
|
||||
&& userFacingFailures.directEntryFailures.length === 2
|
||||
&& userFacingFailures.directEntryFailures.every((failure) => (
|
||||
failure.reason.includes('could not start')
|
||||
&& failure.retryReason === null
|
||||
@@ -1233,14 +1231,14 @@ async function main() {
|
||||
&& failure.priorLayerRestored
|
||||
&& !failure.modeChanging
|
||||
))
|
||||
&& userFacingFailures.directActivationFailures.length === 2
|
||||
&& userFacingFailures.directActivationFailures.length === 1
|
||||
&& userFacingFailures.directActivationFailures.every((failure) => (
|
||||
failure.mode === null
|
||||
&& failure.snapshotCleared
|
||||
&& failure.priorLayerRestored
|
||||
&& failure.failedLayerDisabled
|
||||
))
|
||||
&& userFacingFailures.directActivationRollbackFailures.length === 2
|
||||
&& userFacingFailures.directActivationRollbackFailures.length === 1
|
||||
&& userFacingFailures.directActivationRollbackFailures.every((failure) => (
|
||||
failure.toastMessages.length === 1
|
||||
&& failure.toastMessages[0] === `${failure.layerId} could not start cleanly`
|
||||
|
||||
@@ -345,7 +345,7 @@ try {
|
||||
(await readScope()).feather === 2,
|
||||
);
|
||||
await page.click('#scope-toggle');
|
||||
for (const layout of ['minimal', 'cyber', 'tactical']) {
|
||||
for (const layout of ['minimal', 'tactical']) {
|
||||
await page.select('#hud-layout-select', layout);
|
||||
const state = await readScope();
|
||||
check(
|
||||
|
||||
@@ -276,35 +276,6 @@ try {
|
||||
.every((group) => group.scrollWidth <= group.clientWidth + 1),
|
||||
),
|
||||
);
|
||||
const cyber = await page.evaluate(() => {
|
||||
const root = document.documentElement;
|
||||
const previous = root.getAttribute('data-ui-theme');
|
||||
root.setAttribute('data-ui-theme', 'cyber');
|
||||
const selected = [
|
||||
...document.querySelectorAll('.gev-segment[aria-checked="true"]'),
|
||||
];
|
||||
// Check the final theme colors, independent of software-GL frame cadence.
|
||||
for (const button of selected)
|
||||
for (const animation of button.getAnimations()) animation.finish();
|
||||
const backgrounds = selected.map(
|
||||
(button) => getComputedStyle(button).backgroundColor,
|
||||
);
|
||||
const radii = [...document.querySelectorAll('.gev-segmented')].map(
|
||||
(group) => getComputedStyle(group).borderRadius,
|
||||
);
|
||||
const consistent =
|
||||
selected.length === 6 &&
|
||||
backgrounds.every((color) => color === backgrounds[0]) &&
|
||||
radii.every((radius) => radius === '1px');
|
||||
if (previous === null) root.removeAttribute('data-ui-theme');
|
||||
else root.setAttribute('data-ui-theme', previous);
|
||||
return { consistent, count: selected.length, backgrounds, radii };
|
||||
});
|
||||
check(
|
||||
'Cyber theme styles every selected segment consistently',
|
||||
cyber.consistent,
|
||||
JSON.stringify(cyber),
|
||||
);
|
||||
await page.evaluate(async () => {
|
||||
const { dataManager, styleManager } = window.__godsEyeView;
|
||||
await dataManager.setEnabled('recent-imagery', true);
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* B1 ingest : both layers ingest the synthetic planes
|
||||
* B2 billboards : every fleet billboard carries EXACTLY the expected
|
||||
* per-class glyph (image data-URI === aircraftIcon(klass),
|
||||
* imported from src) and per-class scale (flights:
|
||||
* CLASS_SCALE_2D; military: 0.7 × CLASS_SCALE_2D)
|
||||
* imported from src) and one scale for every class
|
||||
* (flights: 1; military: 0.7)
|
||||
* B3 models : with 3D on, fleet Cesium.Model.scale === the life-size
|
||||
* scale of the fleet model the aircraft's type or category
|
||||
* selects (aircraftModelSpec) per icao; tracked too
|
||||
@@ -33,7 +33,7 @@ import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import puppeteer from 'puppeteer';
|
||||
import { stubPlanespotters } from './qa-photo-stub.mjs';
|
||||
import { classifyAircraft, CLASS_SCALE_2D } from '../src/data/aircraftClass.js';
|
||||
import { classifyAircraft } from '../src/data/aircraftClass.js';
|
||||
import { aircraftModelSpec } from '../src/data/fleetModels.js';
|
||||
// Every aircraft draws its fleet model life size: its type's length over the
|
||||
// model's built length, chosen by type code (military) or category (flights).
|
||||
@@ -381,14 +381,14 @@ async function main() {
|
||||
for (const [id, klass] of expectedFlights) {
|
||||
const bb = bbById.get(id);
|
||||
const wantImg = aircraftIcon(klass);
|
||||
const wantScale = CLASS_SCALE_2D[klass] || 1;
|
||||
const wantScale = 1;
|
||||
if (!bb || bb.image !== wantImg) glyphBad.push(`${id}(${klass})${bb ? ':wrong-image' : ':missing'}`);
|
||||
if (bb && Math.abs(bb.scale - wantScale) > 1e-9) scaleBad.push(`${id}: ${bb.scale} != ${wantScale}`);
|
||||
}
|
||||
for (const [id, klass] of expectedMilitary) {
|
||||
const bb = bbById.get(id);
|
||||
const wantImg = aircraftIcon(klass);
|
||||
const wantScale = MIL_BILLBOARD_SCALE * (CLASS_SCALE_2D[klass] || 1);
|
||||
const wantScale = MIL_BILLBOARD_SCALE;
|
||||
if (!bb || bb.image !== wantImg) glyphBad.push(`${id}(${klass})${bb ? ':wrong-image' : ':missing'}`);
|
||||
if (bb && Math.abs(bb.scale - wantScale) > 1e-9) scaleBad.push(`${id}: ${bb.scale} != ${wantScale}`);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ try {
|
||||
result,
|
||||
);
|
||||
}
|
||||
for (const theme of ['tactical', 'cyber']) {
|
||||
for (const theme of ['tactical', 'minimal']) {
|
||||
await page.evaluate(
|
||||
(theme) => window.__godsEyeView.styleManager._setHudVariant(theme),
|
||||
theme,
|
||||
|
||||
@@ -231,9 +231,6 @@ async function boot(page, url) {
|
||||
await page.waitForFunction(() => Boolean(window.__godsEyeView?.dataManager), {
|
||||
timeout: 150_000,
|
||||
});
|
||||
await page.evaluate(() =>
|
||||
document.querySelector('.first-run-explore')?.click(),
|
||||
);
|
||||
await page.keyboard.press('Escape');
|
||||
await page.evaluate(() => {
|
||||
for (const el of document.querySelectorAll(
|
||||
|
||||
+17
-17
@@ -1980,16 +1980,19 @@ try {
|
||||
await wait(12_000);
|
||||
check('leaving Contacts restores Transit', await isOn());
|
||||
|
||||
// SPACE MISSIONS
|
||||
await page.evaluate(() =>
|
||||
window.__godsEyeView.dataManager.setEnabled('transit', false, {
|
||||
origin: 'user',
|
||||
}),
|
||||
);
|
||||
await wait(2_000);
|
||||
await page.click('#global-context-missions-btn');
|
||||
// SPACE MISSIONS: an ordinary layer. It neither refuses nor puts away
|
||||
// Transit, so a Transit switched on while it runs stays on after it ends.
|
||||
const setMissions = (enabled) =>
|
||||
page.evaluate(
|
||||
(on) =>
|
||||
window.__godsEyeView.dataManager.setEnabled('rocket-launches', on, {
|
||||
origin: 'user',
|
||||
}),
|
||||
enabled,
|
||||
);
|
||||
await setMissions(true);
|
||||
await wait(20_000);
|
||||
const blocked = await page.evaluate(async () => {
|
||||
const beside = await page.evaluate(async () => {
|
||||
const settled = await window.__godsEyeView.dataManager.setEnabled(
|
||||
'transit',
|
||||
true,
|
||||
@@ -2001,16 +2004,13 @@ try {
|
||||
};
|
||||
});
|
||||
check(
|
||||
'Space Missions refuses to enable Transit while it isolates replay data',
|
||||
blocked.enabled === false,
|
||||
JSON.stringify(blocked),
|
||||
'Transit can be switched on while Space Missions runs',
|
||||
beside.settled !== false && beside.enabled === true,
|
||||
JSON.stringify(beside),
|
||||
);
|
||||
await page.click('#global-context-missions-btn');
|
||||
await setMissions(false);
|
||||
await wait(12_000);
|
||||
check(
|
||||
'leaving Space Missions leaves Transit off, as it was on entry',
|
||||
(await isOn()) === false,
|
||||
);
|
||||
check('switching Space Missions off leaves Transit on', await isOn());
|
||||
|
||||
check(
|
||||
'no uncaught page errors',
|
||||
|
||||
@@ -1453,9 +1453,9 @@ async function main() {
|
||||
|
||||
// NOTE: we do NOT manually reposition the camera. Tracking follows the
|
||||
// plane with a calibrated viewFrom, so the follow camera lands
|
||||
// in the few-km band (altitude*1.1+2500, clamped 3–30 km) — far below the
|
||||
// MODEL_ALT_CEIL_M = 800 km ceiling, so _modelRegimeActive() is true and the
|
||||
// standalone tracked model renders. That's the exact path the invariants
|
||||
// in the few-km band (altitude*1.1+2500, clamped 3–30 km) — below the
|
||||
// MODEL_ALT_CEIL_M ceiling, so _modelRegimeActive() is true; the checks below
|
||||
// zoom in to within the 3 km model range so the standalone tracked model renders. That's the exact path the invariants
|
||||
// protect, so we exercise it rather than a synthetic setView.
|
||||
|
||||
// ============================================================
|
||||
@@ -1518,16 +1518,34 @@ async function main() {
|
||||
// is "tracked model not up yet", not a match.
|
||||
return bestD < 1000 * 1000 ? best : null;
|
||||
};
|
||||
// Models draw only within 3 km of the camera, and the follow camera
|
||||
// frames a cruising plane from farther out: zoom in on the followed
|
||||
// plane until it is within `metres`. Returns the distance reached.
|
||||
window.__qaFollowWithin = async function (metres) {
|
||||
const v = window.__godsEyeView.viewer;
|
||||
for (let i = 0; i < 20; i++) {
|
||||
const followed = window.__qaFollowed();
|
||||
const t = typeof followed?.displayPosition === 'function' ? followed.displayPosition() : null;
|
||||
if (!t) return null;
|
||||
const c = v.camera.positionWC;
|
||||
const d = Math.hypot(c.x - t.x, c.y - t.y, c.z - t.z);
|
||||
if (d <= metres) return d;
|
||||
v.camera.zoomIn(d - metres * 0.8);
|
||||
await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
|
||||
}
|
||||
return null;
|
||||
};
|
||||
});
|
||||
|
||||
// Track a synthetic commercial plane. Tracking follows it with a
|
||||
// viewFrom, so the follow camera lands in the few-km band and the standalone
|
||||
// 3D model renders (model regime active below the 800 km ceiling).
|
||||
// Track a synthetic commercial plane, then zoom the follow camera to
|
||||
// within 2 km of it: models draw only within 3 km, so the standalone 3D
|
||||
// model renders there.
|
||||
const trackedIcao = SYNTH.flights[0].icao;
|
||||
await evalPage((icao) => {
|
||||
window.__godsEyeView.dataManager.layers.get('flights').module.trackById(icao);
|
||||
}, trackedIcao);
|
||||
await sleep(1500); // let the follow camera settle + the GLB load kick off
|
||||
await sleep(1500); // let the follow camera settle
|
||||
await evalPage(() => window.__qaFollowWithin(2000));
|
||||
|
||||
// Wait until the tracked Cesium.Model primitive exists, is ready & shown.
|
||||
const modelUp = await page.waitForFunction((icao) => {
|
||||
@@ -1619,19 +1637,48 @@ async function main() {
|
||||
// The fixture planes repeat one position, so the icon holds and draws no
|
||||
// head. Fly the tracked one east for this check; the display runs 30 s
|
||||
// behind, so give it time to reach the moving reports.
|
||||
await evalPage((icao) => {
|
||||
await evalPage(async (icao) => {
|
||||
const { rendererOf } = await import(`${window.__gevQaSourceBase || '/src'}/render/rendererOf.js`);
|
||||
const app = window.__godsEyeView;
|
||||
const fl = app.dataManager.layers.get('flights').module;
|
||||
// Observe this selection's actual draw-port submissions: trails no
|
||||
// longer live in viewer.entities. Disabling destroys the reused trail
|
||||
// set, so this selection creates one the probe can identify.
|
||||
await app.dataManager.setEnabled('flights', false);
|
||||
const draw = rendererOf(app.viewer).draw;
|
||||
const createLines = draw.lines;
|
||||
let head = null;
|
||||
let trail = null;
|
||||
draw.lines = function (spec) {
|
||||
const set = createLines.call(this, spec);
|
||||
if (!spec.id.startsWith('trail:')) return set;
|
||||
draw.lines = createLines;
|
||||
trail = set;
|
||||
const upsert = set.upsert;
|
||||
set.upsert = function (items) {
|
||||
const result = upsert.call(this, items);
|
||||
for (const item of items)
|
||||
if (/^gev-trail:\d+:head$/.test(item.id)) head = item;
|
||||
return result;
|
||||
};
|
||||
const clear = set.clear;
|
||||
set.clear = function () { head = null; return clear.call(this); };
|
||||
const dispose = set.dispose;
|
||||
set.dispose = function () { head = null; trail = null; return dispose.call(this); };
|
||||
return set;
|
||||
};
|
||||
window.__qaTrailHead = () => trail?.show && head?.show !== false ? head?.positions : null;
|
||||
window.__qaRestoreTrailProbe = () => { draw.lines = createLines; };
|
||||
await app.dataManager.setEnabled('flights', true);
|
||||
if (!fl.trackById(icao)) throw new Error('trail fixture could not reselect its aircraft');
|
||||
const f = window.__SYNTH.flights.find((p) => p.icao === icao);
|
||||
f.moveFromMs = Date.now();
|
||||
}, trackedIcao);
|
||||
await sleep(55_000);
|
||||
const headSamples = await sampleFrames(page, 40, (icao) => {
|
||||
const viewer = window.__godsEyeView.viewer;
|
||||
const fl = window.__godsEyeView.dataManager.layers.get('flights').module;
|
||||
const ent = viewer.trackedEntity;
|
||||
const time = viewer.clock.currentTime;
|
||||
const head = viewer.entities.values.find((e) => String(e.id).startsWith('gev-trail:fl-head-'));
|
||||
const line = head?.polyline?.positions?.getValue(time);
|
||||
const drawn = ent?.position?.getValue(time);
|
||||
const line = window.__qaTrailHead();
|
||||
const drawn = window.__qaFollowed()?.position?.();
|
||||
if (!line?.length || !drawn) return null;
|
||||
const end = line[line.length - 1];
|
||||
const dist = (a, b) => Math.hypot(a.x - b.x, a.y - b.y, a.z - b.z);
|
||||
@@ -1677,10 +1724,8 @@ async function main() {
|
||||
for (let i = 0; i < 8; i++) {
|
||||
await sleep(600);
|
||||
betweenFrames.push(await evalPage((icao) => {
|
||||
const viewer = window.__godsEyeView.viewer;
|
||||
const head = viewer.entities.values.find((e) => String(e.id).startsWith('gev-trail:fl-head-'));
|
||||
const line = head?.polyline?.positions?.getValue(viewer.clock.currentTime);
|
||||
const drawn = viewer.trackedEntity?.position?.getValue(viewer.clock.currentTime);
|
||||
const line = window.__qaTrailHead();
|
||||
const drawn = window.__qaFollowed()?.position?.();
|
||||
if (!line?.length || !drawn) return null;
|
||||
const end = line[line.length - 1];
|
||||
return Math.hypot(end.x - drawn.x, end.y - drawn.y, end.z - drawn.z);
|
||||
@@ -1694,10 +1739,11 @@ async function main() {
|
||||
f.lon += (f.vel * (Date.now() - f.moveFromMs)) / 1000
|
||||
/ (111320 * Math.cos((f.lat * Math.PI) / 180));
|
||||
delete f.moveFromMs;
|
||||
window.__qaRestoreTrailProbe();
|
||||
}, trackedIcao);
|
||||
const headUsable = headSamples.values.filter((v) => v != null);
|
||||
if (headUsable.length < 10) {
|
||||
skip('trail head: ends at the drawn icon on every frame',
|
||||
record('trail head: ends at the drawn icon on every frame', false,
|
||||
`only ${headUsable.length} frames with a drawn head (timedOut=${headSamples.timedOut})`);
|
||||
} else {
|
||||
const worst = Math.max(...headUsable.map((v) => v.end));
|
||||
@@ -1845,7 +1891,8 @@ async function main() {
|
||||
await evalPage((icao) => {
|
||||
window.__godsEyeView.dataManager.layers.get('flights').module.trackById(icao);
|
||||
}, h1Icao);
|
||||
await sleep(1500); // follow camera settles; tracked GLB load kicks off
|
||||
await sleep(1500); // follow camera settles
|
||||
await evalPage(() => window.__qaFollowWithin(2000)); // within the 3 km model range
|
||||
|
||||
// (i) The tracked standalone model must expose its pick id (= the icao).
|
||||
const h1ModelUp = await page.waitForFunction((icao) => {
|
||||
@@ -2498,10 +2545,11 @@ async function main() {
|
||||
const milBB = findBB('bbb177');
|
||||
if (!flBB || !milBB) return { error: `ground billboards missing (fl=${!!flBB} mil=${!!milBB})` };
|
||||
const radius = (pos) => Math.hypot(pos.x, pos.y, pos.z);
|
||||
// Park the camera 8 km radially above the flights plane (both in view nadir-ish).
|
||||
// Park the camera 2 km radially above the flights plane (both in view
|
||||
// nadir-ish, both within the 3 km model range).
|
||||
const p = flBB.position;
|
||||
const r = Math.hypot(p.x, p.y, p.z);
|
||||
const k = (r + 8000) / r;
|
||||
const k = (r + 2000) / r;
|
||||
v.camera.cancelFlight();
|
||||
v.camera.setView({
|
||||
destination: { x: p.x * k, y: p.y * k, z: p.z * k },
|
||||
@@ -3279,8 +3327,8 @@ async function main() {
|
||||
// these pins with it rather than stranding them on stale numbers.
|
||||
const reg = await import(`${window.__gevQaSourceBase || '/src'}/layers/flights/policy.js`);
|
||||
window.__dfRegime = {
|
||||
enter: reg.MODEL_PROX_ADD_M,
|
||||
exit: reg.MODEL_PROX_KEEP_M,
|
||||
enter: reg.MODEL_ADD_M,
|
||||
exit: reg.MODEL_KEEP_M,
|
||||
};
|
||||
// Zooming while following is safe: the tracked-camera framer positions
|
||||
// the camera ONCE per selection and is deliberately read-only on normal
|
||||
@@ -3661,6 +3709,9 @@ async function main() {
|
||||
} while (Date.now() < fleetClampDeadline
|
||||
&& (!Number.isFinite(fleetH) || fleetH < seeded + 1));
|
||||
if (!fl.trackById('aaa097')) return { error: 'trackById(aaa097) failed' };
|
||||
// The tracked contact obeys the same 3D toggle as the fleet. Arm it
|
||||
// before testing the cold-ground gate and the warm model handoff.
|
||||
fl.setParams({ models3d: true });
|
||||
await window.__dfSettle(1500);
|
||||
// Read the tracked entity's rendered height plus the floor under it and
|
||||
// the sensor value the data APIs report, at whatever regime the camera
|
||||
@@ -3750,6 +3801,7 @@ async function main() {
|
||||
};
|
||||
const trackedEntity = window.__qaFollowed();
|
||||
const trackedModel = findOwnModel();
|
||||
if (!trackedModel) return { error: 'tracked model absent before exit' };
|
||||
const achievedOut = await window.__dfZoomAbove(window.__dfRegime.exit + 5000);
|
||||
const zoomedOut = await window.__dfObserveTrackedExit({
|
||||
scene: v.scene, trackedEntity, trackedModel, getTrackedModel: findOwnModel,
|
||||
@@ -3888,10 +3940,8 @@ async function main() {
|
||||
// the tracked billboard becomes the visual again. Gating the clamp on
|
||||
// model EXISTENCE put the burial straight back in exactly that state.
|
||||
//
|
||||
// This scenario also pins the toggle contract itself. The DISPLAY-rail
|
||||
// "3D" toggle stays OFF for the whole block on purpose: it governs the
|
||||
// FLEET's draw-call budget only, and the tracked contact must still take
|
||||
// its model on zoom without the operator arming anything.
|
||||
// The tracked contact obeys the shared 3D toggle. Keep it enabled
|
||||
// while zoom alone hands the visual between model and billboard.
|
||||
const dfRetained = await evalPage(async () => {
|
||||
const v = window.__godsEyeView.viewer;
|
||||
const Cesium = await import('/node_modules/cesium/Build/Cesium/index.js');
|
||||
@@ -3904,13 +3954,13 @@ async function main() {
|
||||
// and there would otherwise hand an open skin to the seeded scenarios
|
||||
// that follow; closing an already-closed skin is inert.
|
||||
try {
|
||||
// Toggle OFF throughout — the tracked model must not need it.
|
||||
fl.setParams({ models3d: false });
|
||||
const toggleOff = fl.getParams().models3d === false;
|
||||
// Arm the shared toggle so the zoom regime can retain a hidden model.
|
||||
fl.setParams({ models3d: true });
|
||||
const toggleOn = fl.getParams().models3d === true;
|
||||
if (!fl.trackById('aaa097')) return { error: 'trackById(aaa097) failed' };
|
||||
await window.__dfSettle(600);
|
||||
// Below the ENTER ceiling (trackById re-frames to the close follow
|
||||
// range): the tracked model arrives on zoom alone, toggle still off.
|
||||
// range): the tracked model arrives on zoom alone, 3D enabled.
|
||||
const belowH = await window.__dfZoomBelow(window.__dfRegime.enter - 20000);
|
||||
const withModel = await window.__dfAwaitTrackedModel('aaa097', 20000);
|
||||
// Same split as the regime scenario: a browser with no usable GLB
|
||||
@@ -3960,7 +4010,7 @@ async function main() {
|
||||
const ent2 = window.__qaFollowed()?.position?.();
|
||||
const c2 = ent2 ? window.__dfCarto(ent2) : null;
|
||||
const out = {
|
||||
toggleOff,
|
||||
toggleOn,
|
||||
enter: window.__dfRegime.enter,
|
||||
exit: window.__dfRegime.exit,
|
||||
belowH,
|
||||
@@ -3976,7 +4026,7 @@ async function main() {
|
||||
// Hand the camera back to the CLOSE follow range before releasing. The
|
||||
// LOADING scenario below needs BOTH an active tracked regime and a
|
||||
// fleet model for this contact, and the fleet only admits models within
|
||||
// MODEL_PROX_ADD_M of the camera — parking just inside the enter
|
||||
// MODEL_ADD_M of the camera — parking just inside the enter
|
||||
// ceiling satisfies the regime but sits outside that add radius, which
|
||||
// silently starved the fleet half into a skip.
|
||||
await window.__dfZoomBelow(belowH + 500);
|
||||
@@ -3995,23 +4045,19 @@ async function main() {
|
||||
record('display-floor/T7: while the tracked MODEL is the visual, the clamp stands aside',
|
||||
!dfRetained.error && dfRetained.modelsRenderingBelow > 0,
|
||||
dfRetained.error
|
||||
|| `${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering at ${(dfRetained.belowH / 1000).toFixed(0)} km with the 3D toggle OFF; entity at ${Number(dfRetained.withModelH).toFixed(1)} m (ground-snap owns it)`);
|
||||
|| `${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering at ${(dfRetained.belowH / 1000).toFixed(0)} km with the 3D toggle ON; entity at ${Number(dfRetained.withModelH).toFixed(1)} m (ground-snap owns it)`);
|
||||
|
||||
// The toggle contract after auto-3D (2026-08-20): the DISPLAY-rail "3D"
|
||||
// switch owns the FLEET only. The tracked contact's model is default-on
|
||||
// and decided purely by camera distance, so with the toggle OFF it is
|
||||
// SHOWN below the enter ceiling and handed back above the exit ceiling —
|
||||
// and handed back by HIDING, not destroying, which is the retained state
|
||||
// the floor pin below depends on.
|
||||
record('display-floor/regime: the 3D toggle governs the FLEET only — the tracked model follows the zoom',
|
||||
!dfRetained.error && dfRetained.toggleOff === true
|
||||
// With 3D enabled, zooming out hides rather than destroys the
|
||||
// tracked model: the retained state the floor check depends on.
|
||||
record('display-floor/regime: with 3D enabled the tracked model follows the zoom',
|
||||
!dfRetained.error && dfRetained.toggleOn === true
|
||||
&& dfRetained.modelsRenderingBelow > 0
|
||||
&& dfRetained.belowH < dfRetained.enter
|
||||
&& dfRetained.shownModelsAbove === 0
|
||||
&& dfRetained.hiddenModelsAbove > 0
|
||||
&& dfRetained.aboveH > dfRetained.exit,
|
||||
dfRetained.error
|
||||
|| `toggle OFF throughout: at ${(dfRetained.belowH / 1000).toFixed(0)} km (< ${(dfRetained.enter / 1000).toFixed(0)} km enter) ${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering; at ${(dfRetained.aboveH / 1000).toFixed(0)} km (> ${(dfRetained.exit / 1000).toFixed(1)} km exit) ${dfRetained.shownModelsAbove} shown / ${dfRetained.hiddenModelsAbove} retained-hidden`);
|
||||
|| `toggle ON throughout: at ${(dfRetained.belowH / 1000).toFixed(0)} km (< ${(dfRetained.enter / 1000).toFixed(0)} km enter) ${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering; at ${(dfRetained.aboveH / 1000).toFixed(0)} km (> ${(dfRetained.exit / 1000).toFixed(1)} km exit) ${dfRetained.shownModelsAbove} shown / ${dfRetained.hiddenModelsAbove} retained-hidden`);
|
||||
|
||||
record('display-floor: a retained-but-hidden tracked model does NOT suppress the floor',
|
||||
Number.isFinite(dfRetained.afterSeedH)
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* The files of the Wikidata places detail pack
|
||||
* (`src/data/local_data/wikidata_places/`), from its rows. Used by
|
||||
* `scripts/build-wikidata-cities.mjs --tiles`; kept apart from the query so
|
||||
* the tiling can be checked offline against the shipped pack.
|
||||
*
|
||||
* Rows are `[name, lat, lon, population, country, wikidata]`. Each goes into
|
||||
* the 5 x 5 degree tile named by its south-west corner (`30_-100` covers 30
|
||||
* to 35 N, 100 to 95 W). Rows keep the order they are given in, largest
|
||||
* first; tiles without a row get no file.
|
||||
*/
|
||||
|
||||
import { foldName } from '../src/data/wikidataCities.js';
|
||||
import { greatCircleKm } from '../src/geoDistance.js';
|
||||
|
||||
export const TILE_DEGREES = 5;
|
||||
/** How near two rows of one name in one country are taken as one, in km. */
|
||||
export const TWIN_KM = 3;
|
||||
|
||||
/**
|
||||
* The rows the cities pack does not already hold. An item with several
|
||||
* stated populations can fall in both packs (one figure under the cut-off,
|
||||
* another over it); the cities pack keeps it, so the detail tiles never name
|
||||
* a place twice.
|
||||
* @param {Array<Array>} rows Detail rows, `[name, lat, lon, population, country, wikidata]`.
|
||||
* @param {Iterable<string>} cityIds Wikidata ids in the cities pack.
|
||||
*/
|
||||
export function withoutCities(rows, cityIds) {
|
||||
const cities = new Set(cityIds);
|
||||
return rows.filter((row) => !cities.has(row[5]));
|
||||
}
|
||||
|
||||
/** The tile a point falls in, named by its south-west corner. */
|
||||
export function tileKey(lat, lon) {
|
||||
const corner = (value) => Math.floor(value / TILE_DEGREES) * TILE_DEGREES;
|
||||
// As the lookups read them: latitude 90 is in the top row of tiles, and
|
||||
// longitude 180 is longitude -180.
|
||||
const top = 90 - TILE_DEGREES;
|
||||
return `${Math.min(top, corner(lat))}_${corner((((lon % 360) + 540) % 360) - 180)}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Every file of the pack, by file name.
|
||||
* @param {Array<Array>} rows Largest first.
|
||||
* @param {object} meta The build's `source`, `license`, `built`,
|
||||
* `minPopulation`, `maxPopulation` and `columns`.
|
||||
* @returns {Map<string, string>}
|
||||
*/
|
||||
export function placeTileFiles(rows, meta) {
|
||||
const tiles = new Map();
|
||||
for (const row of rows) {
|
||||
const key = tileKey(row[1], row[2]);
|
||||
if (!tiles.has(key)) tiles.set(key, []);
|
||||
tiles.get(key).push(row);
|
||||
}
|
||||
// In locale order, as the shipped pack was written.
|
||||
const keys = [...tiles.keys()].sort((a, b) => a.localeCompare(b, 'en'));
|
||||
const files = new Map();
|
||||
for (const key of keys)
|
||||
files.set(`${key}.json`, `${JSON.stringify({ rows: tiles.get(key) })}\n`);
|
||||
const index = {
|
||||
meta: {
|
||||
source: meta.source,
|
||||
license: meta.license,
|
||||
built: meta.built,
|
||||
minPopulation: meta.minPopulation,
|
||||
maxPopulation: meta.maxPopulation,
|
||||
count: rows.length,
|
||||
columns: meta.columns,
|
||||
tileDegrees: TILE_DEGREES,
|
||||
tiles: keys.length,
|
||||
},
|
||||
tiles: Object.fromEntries(keys.map((key) => [key, tiles.get(key).length])),
|
||||
};
|
||||
files.set('index.json', `${JSON.stringify(index)}\n`);
|
||||
files.set(
|
||||
'files.js',
|
||||
[
|
||||
'// Generated by scripts/build-wikidata-cities.mjs --tiles; do not edit.',
|
||||
"export const INDEX_URL = () => new URL('./index.json', import.meta.url);",
|
||||
'export const TILE_URLS = {',
|
||||
...keys.map(
|
||||
(key) => ` '${key}': () => new URL('./${key}.json', import.meta.url),`,
|
||||
),
|
||||
'};',
|
||||
'',
|
||||
].join('\n'),
|
||||
);
|
||||
return files;
|
||||
}
|
||||
|
||||
/**
|
||||
* A pack file's new text, keeping the earlier build's `meta.built` when
|
||||
* nothing else in the file changed, so rebuilding unchanged data leaves the
|
||||
* file as it was. A file that does not hold all of its pack's data (the
|
||||
* places index) is passed through this only when the rest of the pack is
|
||||
* unchanged too.
|
||||
* @param {string} text The new file, JSON with a `meta.built` stamp.
|
||||
* @param {string | undefined} earlier The file as it is now, if there is one.
|
||||
*/
|
||||
export function keepBuiltIfUnchanged(text, earlier) {
|
||||
if (!earlier) return text;
|
||||
let before;
|
||||
try {
|
||||
before = JSON.parse(earlier);
|
||||
} catch {
|
||||
return text;
|
||||
}
|
||||
const after = JSON.parse(text);
|
||||
if (typeof before?.meta?.built !== 'string' || !after.meta) return text;
|
||||
const unstamped = (value) =>
|
||||
JSON.stringify({ ...value, meta: { ...value.meta, built: null } });
|
||||
if (unstamped(before) !== unstamped(after)) return text;
|
||||
return `${JSON.stringify({ ...after, meta: { ...after.meta, built: before.meta.built } })}\n`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Keeps the earlier build's `meta.built` in the places pack's index when the
|
||||
* rebuild changed nothing: every tile and `files.js` the same text, no tile
|
||||
* of the earlier build left out, and nothing else in the index changed. The
|
||||
* index holds only row counts, so it alone cannot tell.
|
||||
* @param {Map<string, string>} files The new pack, as placeTileFiles gives it; its index is replaced in place.
|
||||
* @param {Map<string, string>} earlier The pack's files on disk now, by name.
|
||||
*/
|
||||
export function keepPackBuiltIfUnchanged(files, earlier) {
|
||||
for (const name of earlier.keys())
|
||||
if (name !== 'index.json' && !files.has(name)) return files;
|
||||
for (const [name, text] of files)
|
||||
if (name !== 'index.json' && earlier.get(name) !== text) return files;
|
||||
files.set(
|
||||
'index.json',
|
||||
keepBuiltIfUnchanged(files.get('index.json'), earlier.get('index.json')),
|
||||
);
|
||||
return files;
|
||||
}
|
||||
|
||||
const kmBetween = (a, b) =>
|
||||
greatCircleKm({ lat: a[1], lon: a[2] }, { lat: b[1], lon: b[2] });
|
||||
|
||||
/**
|
||||
* The rows without a second listing of one place: a row whose name (folded,
|
||||
* as lookups compare names) and country match a row already kept within
|
||||
* TWIN_KM is left out, so the larger of the two, given first, stays.
|
||||
* Namesakes across a border both stay.
|
||||
* @param {Array<Array>} rows Largest first.
|
||||
*/
|
||||
export function withoutNearTwins(rows) {
|
||||
// Cells of 0.05 degrees (about 5 km of latitude), searched with their
|
||||
// neighbours. A cell narrows toward the poles, so as many longitude cells
|
||||
// are searched as TWIN_KM spans there, wrapping at the antimeridian.
|
||||
const CELLS = 20;
|
||||
const AROUND = 360 * CELLS;
|
||||
const kept = new Map();
|
||||
return rows.filter((row) => {
|
||||
const name = foldName(row[0]);
|
||||
const la = Math.floor(row[1] * CELLS);
|
||||
const lo = Math.floor(row[2] * CELLS);
|
||||
const cos = Math.cos(
|
||||
(Math.min(89.9, Math.abs(row[1]) + 0.1) * Math.PI) / 180,
|
||||
);
|
||||
const span = Math.min(
|
||||
AROUND / 2,
|
||||
Math.ceil((TWIN_KM / (111.32 * cos)) * CELLS) + 1,
|
||||
);
|
||||
for (let i = -1; i <= 1; i++)
|
||||
for (let j = -span; j <= span; j++)
|
||||
for (const other of kept.get(
|
||||
`${la + i}_${(((lo + j) % AROUND) + AROUND) % AROUND}`,
|
||||
) || [])
|
||||
if (
|
||||
other.name === name &&
|
||||
other.row[4] === row[4] &&
|
||||
kmBetween(other.row, row) <= TWIN_KM
|
||||
)
|
||||
return false;
|
||||
const key = `${la}_${((lo % AROUND) + AROUND) % AROUND}`;
|
||||
if (!kept.has(key)) kept.set(key, []);
|
||||
kept.get(key).push({ name, row });
|
||||
return true;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user