Merge main into fix/earthquake-click-details

Resolves conflicts with main: a world focus target's own range past its
framed radius replaces the kind's range (#1832), so a quake asks for its
own range only past M6 and the earthquake framing stays its floor; FIRMS
keeps main's marker stand-in under the card-on-top rule; launches keep
main's label click and also read the card on top through the pick
registry.
This commit is contained in:
Sameh Khamis committed 2026-11-18 18:58:07 -08:00
commit e87aa5190d
1337 files changed
+38638 -9950

No files matched your search

+66 -6
View File
@@ -20,13 +20,29 @@
* 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 {
placeTileFiles,
withoutCities,
withoutNearTwins,
} from './wikidataPlaceTiles.mjs';
const ENDPOINT = 'https://query.wikidata.org/sparql';
const USER_AGENT =
@@ -37,10 +53,20 @@ 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',
);
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const qid = (uri) => uri.slice(uri.lastIndexOf('/') + 1);
@@ -222,7 +248,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 +460,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 +476,40 @@ 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,
});
// Tiles from an earlier build that this one has no rows for go.
for (const name of await readdir(outDir))
if (/^-?\d+_-?\d+\.json$/.test(name) && !files.has(name))
await rm(path.join(outDir, name));
for (const [name, text] of files)
await writeFile(path.join(outDir, name), text);
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`);
console.log(`Wrote ${rows.length} places to ${path.relative(root, file)}`);
+19 -1
View 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",
@@ -526,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",
@@ -620,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",
@@ -868,6 +877,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",
@@ -1480,7 +1490,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",
@@ -1588,6 +1598,14 @@
"src/data/wikidataCities.js",
"src/data/wikidataCities.test.mjs",
"scripts/build-wikidata-cities.mjs",
"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/bikeshare/selection.test.mjs",
"src/layers/satellites/interaction.test.mjs",
"src/layers/alpr/presentation.test.mjs"
+151 -12
View File
@@ -3,17 +3,21 @@
// npm run i18n check every catalog and find unmarked UI text
// npm run i18n -- --prune also drop entries the code no longer uses
// npm run i18n -- --missing ru print what ru lacks, as JSON to translate
// npm run i18n -- --zh-hant rewrite zh-Hant from zh-CN (see toZhHant)
//
// A translation left as the English fails unless src/i18n/same-as-english.json
// lists it.
// lists it. zh-Hant is not translated: it is generated from zh-CN, and the
// check fails when it differs.
//
// Messages are the English literals passed to t(), tn() and msg() in src/,
// plus the markup opted in with data-i18n* in index.html and the Vue views.
// It also lists UI text that is not marked at all (see findUnmarked).
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { execFileSync } from 'node:child_process';
import { createRequire } from 'node:module';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { isDeepStrictEqual } from 'node:util';
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const LOCALES_DIR = path.join(ROOT, 'src/i18n/locales');
@@ -510,10 +514,11 @@ export function readCatalog(locale) {
return JSON.parse(readFileSync(catalogPath(locale), 'utf8'));
}
/** Sorted: git lists untracked files first, and main needs zh-CN before zh-Hant. */
export function shippedLocales() {
return trackedFiles('src/i18n/locales/*.json').map((file) =>
path.basename(file, '.json'),
);
return trackedFiles('src/i18n/locales/*.json')
.map((file) => path.basename(file, '.json'))
.sort();
}
/** Messages a locale keeps exactly as in English, on purpose. */
@@ -532,7 +537,9 @@ const blank = (value) => value.trim() === '';
const hasLetters = (value) => /\p{L}{2}/u.test(value.replace(/\{[^}]*\}/g, ''));
const STILL_ENGLISH = (text, locale) =>
`"${text}" is still English: translate it, or list it under "${locale}" in src/i18n/same-as-english.json`;
locale === ZH_HANT
? `"${text}" is still English: translate it in ${ZH_HANT_SOURCE} and run ${ZH_HANT_COMMAND}, or list it under "${ZH_HANT}" in src/i18n/same-as-english.json as under "${ZH_HANT_SOURCE}"`
: `"${text}" is still English: translate it, or list it under "${locale}" in src/i18n/same-as-english.json`;
/**
* Compare one catalog with the extracted messages.
@@ -619,16 +626,138 @@ export function missingTemplate(locale, catalog, messages) {
return out;
}
// zh-Hant is zh-CN in Traditional characters (docs/translations/zh-Hant.md):
// the same wording, only the script differs. OpenCC s2tw (opencc-js, cn → tw)
// converts characters only; s2twp would also swap in Taiwan vocabulary
// (影片, 伺服器, 載入), which the catalog does not use.
const ZH_HANT = 'zh-Hant';
const ZH_HANT_SOURCE = 'zh-CN';
const ZH_HANT_COMMAND = 'npm run i18n -- --zh-hant';
// Characters s2tw picks wrongly in this text, replaced after the conversion.
// A pair with a third item applies only to entries whose English key matches it.
const ZH_HANT_CORRECTIONS = [
['年曆史', '年歷史'],
['下遊', '下游'],
// 併道 is merging lanes; elsewhere 並 (and) stays before 道路, 道謝 and the like.
['並道', '併道', /\bmerge\b/i],
['發佈', '發布'],
['公佈', '公布'],
['宣佈', '宣布'],
['控制檯', '控制台'],
// 個 after a count ({n} 个中, of {n}), not the literary 箇中.
['箇中', '個中'],
// 周 as a week: the time-lapse speed in weeks per second.
[' 周/秒', ' 週/秒'],
];
let s2tw;
// Loaded on first use, so extracting messages needs no node_modules
// (stale-index.test.mjs); main reports a missing package as a zh-Hant error.
function converter() {
try {
s2tw ??= createRequire(import.meta.url)('opencc-js/cn2t').Converter({
from: 'cn',
to: 'tw',
});
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') throw error;
throw new Error('opencc-js is not installed: run npm ci', { cause: error });
}
return s2tw;
}
export function toZhHant(text, key = '') {
return ZH_HANT_CORRECTIONS.reduce(
(out, [wrong, right, keys]) =>
!keys || keys.test(key) ? out.replaceAll(wrong, right) : out,
converter()(text),
);
}
/** The zh-Hant catalog for a zh-CN catalog: the same keys in the same order. */
export function zhHantCatalog(zhCN) {
const convert = (entry, text) => {
if (typeof entry === 'string') return toZhHant(entry, text);
if (entry && typeof entry === 'object')
return Object.fromEntries(
Object.entries(entry).map(([category, form]) => [
category,
convert(form, text),
]),
);
return entry;
};
return Object.fromEntries(
Object.entries(zhCN).map(([text, entry]) => [text, convert(entry, text)]),
);
}
/**
* Where a zh-Hant catalog is not the conversion of the zh-CN one.
* @param {Set<string>} [reported] Keys already reported missing from zh-Hant.
* @returns {string[]} One error per entry, naming its key.
*/
export function checkZhHant(zhCN, zhHant, reported = new Set()) {
const expected = zhHantCatalog(zhCN);
const fix = `zh-Hant is generated: edit ${ZH_HANT_SOURCE}, then run ${ZH_HANT_COMMAND}`;
const errors = [];
for (const [text, entry] of Object.entries(expected)) {
if (!Object.hasOwn(zhHant, text)) {
if (!reported.has(text))
errors.push(`"${text}" is in ${ZH_HANT_SOURCE} but not here. ${fix}`);
} else if (!isDeepStrictEqual(zhHant[text], entry))
errors.push(
`"${text}" is ${JSON.stringify(zhHant[text])}, not ${ZH_HANT_SOURCE} converted (${JSON.stringify(entry)}). ${fix}`,
);
}
for (const text of Object.keys(zhHant)) {
if (!Object.hasOwn(expected, text))
errors.push(`"${text}" is not in ${ZH_HANT_SOURCE}. ${fix}`);
}
const order = Object.keys(expected);
const keys = Object.keys(zhHant);
if (!errors.length && keys.length === order.length) {
const at = order.findIndex((text, i) => keys[i] !== text);
if (at >= 0)
errors.push(
`entries leave the ${ZH_HANT_SOURCE} order at "${order[at]}": run ${ZH_HANT_COMMAND}`,
);
}
return errors;
}
const serialize = (catalog) => `${JSON.stringify(catalog, null, 2)}\n`;
export function writeZhHant() {
const catalog = zhHantCatalog(readCatalog(ZH_HANT_SOURCE));
writeFileSync(catalogPath(ZH_HANT), serialize(catalog));
return Object.keys(catalog).length;
}
function main(args) {
const messages = extractMessages();
const missingFor = args.includes('--missing')
? args[args.indexOf('--missing') + 1]
: null;
if (missingFor?.toLowerCase() === ZH_HANT.toLowerCase()) {
console.error(
`${ZH_HANT} is generated, not translated: add the entries to ${ZH_HANT_SOURCE} (npm run i18n -- --missing ${ZH_HANT_SOURCE}), then run ${ZH_HANT_COMMAND}`,
);
return 1;
}
if (missingFor) {
const out = missingTemplate(missingFor, readCatalog(missingFor), messages);
console.log(JSON.stringify(out, null, 2));
return 0;
}
if (args.includes('--zh-hant')) {
const count = writeZhHant();
console.log(
`${ZH_HANT}: wrote ${count} entries converted from ${ZH_HANT_SOURCE}`,
);
}
let failed = false;
for (const locale of shippedLocales()) {
let catalog = readCatalog(locale);
@@ -637,10 +766,7 @@ function main(args) {
catalog = Object.fromEntries(
Object.entries(catalog).filter(([text]) => messages.has(text)),
);
writeFileSync(
catalogPath(locale),
`${JSON.stringify(catalog, null, 2)}\n`,
);
writeFileSync(catalogPath(locale), serialize(catalog));
console.log(`${locale}: pruned ${stale.length} unused entries`);
} else if (stale.length) {
failed = true;
@@ -649,11 +775,24 @@ function main(args) {
);
for (const text of stale) console.log(` ${JSON.stringify(text)}`);
}
// shippedLocales() is sorted, so --prune has already pruned zh-CN.
const zhCN = locale === ZH_HANT ? readCatalog(ZH_HANT_SOURCE) : null;
if (zhCN) {
try {
errors.push(...checkZhHant(zhCN, catalog, new Set(missing)));
} catch (error) {
if (error.cause?.code !== 'MODULE_NOT_FOUND') throw error;
errors.push(error.message);
}
}
if (missing.length) {
failed = true;
console.log(
`${locale}: ${missing.length} missing (npm run i18n -- --missing ${locale}):`,
);
const fill = !zhCN
? `npm run i18n -- --missing ${locale}`
: missing.every((text) => Object.hasOwn(zhCN, text))
? `run ${ZH_HANT_COMMAND}`
: `add them to ${ZH_HANT_SOURCE}, then ${ZH_HANT_COMMAND}`;
console.log(`${locale}: ${missing.length} missing (${fill}):`);
for (const text of missing)
console.log(` ${JSON.stringify(text)} ${messages.get(text).where}`);
}
+231 -11
View File
@@ -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",
@@ -285,7 +288,26 @@
"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"
],
"external": ["vue", "pinia", "vue-i18n"]
},
@@ -421,7 +443,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 +838,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",
@@ -1122,7 +1147,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 +1176,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 +1212,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 +1370,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 +1434,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 +1451,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 +1580,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",
@@ -1646,7 +1674,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 +1762,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 +1902,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 +2052,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 +2236,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 +2437,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 +2496,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",
@@ -2617,6 +2663,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",
@@ -2715,6 +2762,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",
@@ -2806,6 +2854,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",
@@ -2831,6 +2880,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",
@@ -2906,6 +2956,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",
@@ -3083,7 +3134,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"]
},
@@ -3134,6 +3186,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",
@@ -3323,6 +3376,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",
@@ -3416,6 +3470,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",
@@ -3648,6 +3703,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",
@@ -3851,6 +3907,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",
@@ -4062,6 +4119,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",
@@ -4077,10 +4137,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",
@@ -4478,6 +4541,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",
@@ -4691,7 +4755,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",
@@ -4710,6 +4773,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",
@@ -5272,6 +5336,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",
@@ -5464,20 +5529,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",
@@ -5755,6 +5826,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",
@@ -6312,6 +6384,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",
@@ -6471,6 +6544,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",
@@ -6632,7 +6706,6 @@
"ui-panel-chrome": {
"exports": ["./ui/panel-chrome"],
"modules": [
"src/ui/displayPanelScroll.js",
"src/ui/radioPanelPlacement.js",
"src/panelStackLayout.js",
"src/ui/leftPanelRail.js",
@@ -6681,6 +6754,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"
@@ -7041,6 +7115,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"],
@@ -7098,10 +7286,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",
@@ -7251,8 +7442,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",
@@ -7640,6 +7834,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",
@@ -8028,6 +8223,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": [
@@ -8054,6 +8271,7 @@
"./render/vectorBase",
"./render/iconSegment",
"./render/recession",
"./render/modelParts",
"./render/windStreamlines",
"./geo/screenCluster"
],
@@ -8076,6 +8294,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",
@@ -8104,7 +8323,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
View File
@@ -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;
+6 -6
View File
@@ -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',
+22 -23
View File
@@ -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,14 +444,14 @@ 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',
+108 -42
View File
@@ -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 });
});
+1 -1
View File
@@ -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
-10
View File
@@ -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
View File
@@ -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`
+1 -1
View File
@@ -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(
-29
View File
@@ -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);
+5 -5
View File
@@ -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}`);
}
+1 -1
View File
@@ -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,
-3
View File
@@ -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
View File
@@ -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',
+33 -13
View File
@@ -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) => {
@@ -1873,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) => {
@@ -2526,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 },
@@ -3307,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
@@ -4006,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);
+136
View File
@@ -0,0 +1,136 @@
/**
* 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;
}
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;
});
}