mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 18:22:25 +00:00
Merge origin/main into byrdit/cctv-visible-only-fetch
This commit is contained in:
commit
d19ae89630
445 files changed
+27359
-9232
No files matched your search
@@ -39,6 +39,8 @@ import { mkdir, readdir, readFile, rm, writeFile } from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import {
|
||||
keepBuiltIfUnchanged,
|
||||
keepPackBuiltIfUnchanged,
|
||||
placeTileFiles,
|
||||
withoutCities,
|
||||
withoutNearTwins,
|
||||
@@ -68,6 +70,8 @@ const outDir = path.join(
|
||||
: 'src/data/local_data/wikidata_cities',
|
||||
);
|
||||
|
||||
/** A file's text, or undefined when there is none yet. */
|
||||
const readIfThere = (file) => readFile(file, 'utf8').catch(() => undefined);
|
||||
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
const qid = (uri) => uri.slice(uri.lastIndexOf('/') + 1);
|
||||
|
||||
@@ -499,17 +503,30 @@ if (tilesMode) {
|
||||
count: tileRows.length,
|
||||
maxPopulation,
|
||||
});
|
||||
// Tiles from an earlier build that this one has no rows for go.
|
||||
// The new files are all written before tiles from an earlier build that
|
||||
// this one has no rows for go, so a build that stops part way never leaves
|
||||
// an index naming a removed tile.
|
||||
const earlier = new Map();
|
||||
for (const name of await readdir(outDir))
|
||||
if (/^-?\d+_-?\d+\.json$|^index\.json$|^files\.js$/.test(name))
|
||||
earlier.set(name, await readFile(path.join(outDir, name), 'utf8'));
|
||||
keepPackBuiltIfUnchanged(files, earlier);
|
||||
for (const [name, text] of files)
|
||||
await writeFile(path.join(outDir, name), text);
|
||||
for (const name of await readdir(outDir))
|
||||
if (/^-?\d+_-?\d+\.json$/.test(name) && !files.has(name))
|
||||
await rm(path.join(outDir, name));
|
||||
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`);
|
||||
await writeFile(
|
||||
file,
|
||||
keepBuiltIfUnchanged(
|
||||
`${JSON.stringify({ meta, rows })}\n`,
|
||||
await readIfThere(file),
|
||||
),
|
||||
);
|
||||
console.log(`Wrote ${rows.length} places to ${path.relative(root, file)}`);
|
||||
@@ -227,6 +227,7 @@
|
||||
"src/ui/panelMeasurement.js",
|
||||
"src/ui/panelRailGeometry.js",
|
||||
"src/ui/panelRails.test.mjs",
|
||||
"src/ui/hudSonarStyle.test.mjs",
|
||||
"src/panelStackLayout.js",
|
||||
"src/ui/applicationShortcuts.js",
|
||||
"src/ui/styleParameters.js",
|
||||
@@ -296,6 +297,9 @@
|
||||
"src/ui/contextControls.js",
|
||||
"src/ui/contextControls.test.mjs",
|
||||
"src/ui/contextLayerChanges.js",
|
||||
"src/ui/spaceMissionsControls.js",
|
||||
"src/ui/spaceMissionsControls.test.mjs",
|
||||
"src/ui/stores/spaceMissions.js",
|
||||
"src/ui/contextPresentation.js",
|
||||
"src/ui/contextSession.js",
|
||||
"src/ui/contextSubscriptions.js",
|
||||
@@ -437,6 +441,12 @@
|
||||
"src/layers/earthquakes/model.js",
|
||||
"src/layers/earthquakes/source.js",
|
||||
"src/layers/earthquakes/ownership.test.mjs",
|
||||
"src/layers/earthquakes/selection.test.mjs",
|
||||
"src/layers/submarineCables/interaction.test.mjs",
|
||||
"src/ui/entityContextBridge.test.mjs",
|
||||
"src/layers/launches/clickYield.test.mjs",
|
||||
"src/app/layers/earthquakeRipples.js",
|
||||
"src/app/layers/earthquakeRipples.test.mjs",
|
||||
"src/layers/perimeters/index.js",
|
||||
"src/layers/perimeters/records.js",
|
||||
"src/layers/perimeters/source.js",
|
||||
@@ -520,6 +530,10 @@
|
||||
"src/layers/launches/source.test.mjs",
|
||||
"src/layers/launches/ingestion.test.mjs",
|
||||
"src/layers/launches/failedEntry.test.mjs",
|
||||
"src/layers/launches/labelClick.test.mjs",
|
||||
"src/layers/launches/missionCycler.test.mjs",
|
||||
"src/layers/launches/satelliteIntents.js",
|
||||
"src/layers/launches/satelliteIntents.test.mjs",
|
||||
"src/layers/installations/lifecycle.js",
|
||||
"src/layers/installations/viewport.js",
|
||||
"src/layers/installations/controls.js",
|
||||
@@ -652,6 +666,7 @@
|
||||
"src/layers/alpr/model.js",
|
||||
"src/layers/alpr/policy.js",
|
||||
"src/layers/alpr/presentation.js",
|
||||
"src/layers/alpr/presentation.test.mjs",
|
||||
"src/layers/alpr/visuals.js",
|
||||
"src/layers/alpr/overlay.js",
|
||||
"src/layers/alpr/overlay.test.mjs",
|
||||
@@ -1313,6 +1328,29 @@
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiBadge.test.mjs",
|
||||
"src/ui/kit/UiEmpty.vue",
|
||||
"src/ui/kit/kitStyles.test.mjs",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/kit/UiCloseButton.test.mjs",
|
||||
"src/ui/kit/closeButtons.test.mjs",
|
||||
"src/ui/styles/close-button.css",
|
||||
"src/ui/kit/UiSearchField.vue",
|
||||
"src/ui/kit/UiSearchField.test.mjs",
|
||||
"src/ui/styles/search-field.css",
|
||||
"src/ui/kit/UiCheckbox.vue",
|
||||
"src/ui/kit/UiCheckbox.test.mjs",
|
||||
"src/ui/kit/checkboxes.test.mjs",
|
||||
"src/ui/styles/checkbox.css",
|
||||
"src/ui/kit/UiDialog.vue",
|
||||
"src/ui/kit/UiDialog.test.mjs",
|
||||
"src/ui/kit/dialogs.test.mjs",
|
||||
"src/ui/kit/layerFinderControls.test.mjs",
|
||||
"src/ui/kit/entityCardControls.test.mjs",
|
||||
"src/ui/kit/visualControls.test.mjs",
|
||||
"src/ui/kit/welcomeControls.test.mjs",
|
||||
"src/ui/kit/omnibarControls.test.mjs",
|
||||
"src/ui/kit/storiesControls.test.mjs",
|
||||
"src/ui/styles/chip.css",
|
||||
"src/ui/styles/empty-state.css",
|
||||
"src/ui/rail/RailChips.vue",
|
||||
"src/ui/displayPanelActions.test.mjs",
|
||||
"src/testSupport/vueDom.mjs",
|
||||
@@ -1476,7 +1514,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",
|
||||
@@ -1550,7 +1588,11 @@
|
||||
"dev/stub-app/main.js",
|
||||
"scripts/qa-stub-boot.mjs",
|
||||
"src/ui/creditsView.js",
|
||||
"src/ui/creditLineHeight.js",
|
||||
"src/ui/creditLineHeight.test.mjs",
|
||||
"src/ui/creditsView.test.mjs",
|
||||
"src/ui/credits/CreditsView.vue",
|
||||
"src/ui/credits/CreditItem.vue",
|
||||
"src/cockpitSubjectProviders.js",
|
||||
"src/cockpitSubjectProviders.test.mjs",
|
||||
"src/cockpitProgress.js",
|
||||
@@ -1584,9 +1626,18 @@
|
||||
"src/data/wikidataCities.js",
|
||||
"src/data/wikidataCities.test.mjs",
|
||||
"scripts/build-wikidata-cities.mjs",
|
||||
"src/search/bip39Words.js",
|
||||
"src/search/placeSuggestions.test.mjs",
|
||||
"scripts/wikidataPlaceTiles.mjs",
|
||||
"src/tooling/wikidataPlaceTiles.test.mjs",
|
||||
"src/ui/omnibarIntent.test.mjs",
|
||||
"src/ui/omnibarRows.test.mjs"
|
||||
"src/ui/omnibarRows.test.mjs",
|
||||
"src/ui/omnibarGuide.test.mjs",
|
||||
"src/ui/styles/omnibar-dock.css",
|
||||
"src/ui/styles/guide.css",
|
||||
"src/ui/commandDock.test.mjs",
|
||||
"src/layers/firms/selection.test.mjs",
|
||||
"src/layers/vessels/selection.test.mjs",
|
||||
"src/layers/bikeshare/selection.test.mjs",
|
||||
"src/layers/satellites/interaction.test.mjs"
|
||||
]
|
||||
@@ -130,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",
|
||||
@@ -163,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",
|
||||
@@ -239,6 +241,10 @@
|
||||
"src/ui/kit/UiSelect.js",
|
||||
"src/ui/kit/UiEmpty.vue",
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/kit/UiSearchField.vue",
|
||||
"src/ui/kit/UiCheckbox.vue",
|
||||
"src/ui/kit/UiDialog.vue",
|
||||
"src/ui/stores/globeActions.js",
|
||||
"src/ui/views/panels/GlobeActions.vue",
|
||||
"src/ui/views/panels/RenderFailure.vue",
|
||||
@@ -289,7 +295,25 @@
|
||||
"src/render/modelParts.js",
|
||||
"src/ui/views/panels/AircraftModelHero.vue",
|
||||
"src/data/retryableLoad.js",
|
||||
"src/data/local_data/wikidata_places/files.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/ui/views/panels/OmnibarGuide.vue",
|
||||
"src/cityPois.js",
|
||||
"src/search/photonSetting.js",
|
||||
"src/sources/requestDeadline.js",
|
||||
"src/ui/omnibarEnter.js",
|
||||
"src/ui/omnibarIntent.js",
|
||||
"src/data/placeNames.js",
|
||||
"src/search/plusCode.js",
|
||||
"src/keylessGeocoder.js",
|
||||
"src/ui/omnibarRows.js",
|
||||
"src/search/gridReference.js",
|
||||
"src/search/coordinateParser.js",
|
||||
"src/search/placeSuggestions.js",
|
||||
"src/search/bip39Words.js"
|
||||
],
|
||||
"external": ["vue", "pinia", "vue-i18n"]
|
||||
},
|
||||
@@ -820,7 +844,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",
|
||||
@@ -996,6 +1019,8 @@
|
||||
"src/ui/kit/UiSelect.js",
|
||||
"src/ui/kit/UiButton.vue",
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/kit/UiIcon.vue",
|
||||
"src/ui/rail/fieldValue.js",
|
||||
"src/ui/kit/UiSlider.js",
|
||||
"src/ui/kit/UiSegmented.vue"
|
||||
@@ -1073,6 +1098,11 @@
|
||||
"src/ui/cctvVideo.js",
|
||||
"src/ui/cctvPresentation.js",
|
||||
"src/ui/quebecCctvOverlay.js",
|
||||
"src/ui/views/panels/QuebecCctvOverlay.vue",
|
||||
"src/ui/kit/UiButton.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/kit/UiIcon.vue",
|
||||
"src/ui/rail/classToggle.js",
|
||||
"src/i18n/index.js",
|
||||
"src/i18n/locale.js",
|
||||
"src/i18n/locales/ar.json",
|
||||
@@ -1196,7 +1226,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",
|
||||
@@ -1420,7 +1449,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",
|
||||
@@ -1438,6 +1466,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",
|
||||
@@ -1566,6 +1595,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",
|
||||
@@ -1586,6 +1616,7 @@
|
||||
"src/ui/kit/UiSlider.js",
|
||||
"src/ui/kit/UiButton.vue",
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/stores/globeActions.js",
|
||||
"src/ui/stores/recording.js",
|
||||
"src/ui/i18n.js",
|
||||
@@ -1612,6 +1643,7 @@
|
||||
"src/layers/wildlifeSightings/photoText.js",
|
||||
"src/data/iconOrientation.js",
|
||||
"src/ui/quebecCctvOverlay.js",
|
||||
"src/ui/views/panels/QuebecCctvOverlay.vue",
|
||||
"src/time/worldClock.js",
|
||||
"src/cockpitSubjects.js",
|
||||
"src/cockpitRadar.js",
|
||||
@@ -1659,7 +1691,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",
|
||||
@@ -2574,7 +2607,8 @@
|
||||
"src/layers/earthquakes/model.js",
|
||||
"src/layers/earthquakes/source.js",
|
||||
"src/layers/earthquakes/records.js",
|
||||
"src/time/worldClock.js"
|
||||
"src/time/worldClock.js",
|
||||
"src/data/trackingClickGesture.js"
|
||||
],
|
||||
"external": ["cesium"]
|
||||
},
|
||||
@@ -2863,6 +2897,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",
|
||||
@@ -4172,6 +4207,7 @@
|
||||
"src/app/layers/bikeshare.js",
|
||||
"src/app/layers/cctv.js",
|
||||
"src/app/layers/cyclones.js",
|
||||
"src/app/layers/earthquakeRipples.js",
|
||||
"src/app/layers/earthquakes.js",
|
||||
"src/app/layers/firms.js",
|
||||
"src/app/layers/flights.js",
|
||||
@@ -4522,6 +4558,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",
|
||||
@@ -4736,7 +4773,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",
|
||||
@@ -4755,6 +4791,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",
|
||||
@@ -5317,6 +5354,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",
|
||||
@@ -5349,6 +5387,8 @@
|
||||
"src/ui/kit/UiButton.vue",
|
||||
"src/ui/kit/UiEmpty.vue",
|
||||
"src/ui/kit/UiBadge.vue",
|
||||
"src/ui/kit/UiCloseButton.vue",
|
||||
"src/ui/kit/UiCheckbox.vue",
|
||||
"src/ui/stores/globeActions.js",
|
||||
"src/ui/stores/recording.js",
|
||||
"src/ui/i18n.js",
|
||||
@@ -5430,6 +5470,7 @@
|
||||
"src/layers/wildlifeSightings/iconCollection.js",
|
||||
"src/layers/wildlifeSightings/view.js",
|
||||
"src/ui/quebecCctvOverlay.js",
|
||||
"src/ui/views/panels/QuebecCctvOverlay.vue",
|
||||
"src/time/viewerClock.js",
|
||||
"src/time/worldClock.js",
|
||||
"src/cockpitSubjects.js",
|
||||
@@ -5457,7 +5498,10 @@
|
||||
"src/render/applicationHooks.js",
|
||||
"src/maps/globeEngine.js",
|
||||
"src/render/cesium/viewers.js",
|
||||
"src/ui/creditLineHeight.js",
|
||||
"src/ui/creditsView.js",
|
||||
"src/ui/credits/CreditsView.vue",
|
||||
"src/ui/credits/CreditItem.vue",
|
||||
"src/data/planespottersPhoto.js",
|
||||
"src/maps/keylessTerrain.js",
|
||||
"src/render/cesium/vectorBase.js",
|
||||
@@ -5586,6 +5630,7 @@
|
||||
"src/app/layers/bikeshare.js",
|
||||
"src/app/layers/cctv.js",
|
||||
"src/app/layers/cyclones.js",
|
||||
"src/app/layers/earthquakeRipples.js",
|
||||
"src/app/layers/earthquakes.js",
|
||||
"src/app/layers/firms.js",
|
||||
"src/app/layers/flights.js",
|
||||
@@ -5805,6 +5850,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",
|
||||
@@ -6684,7 +6730,6 @@
|
||||
"ui-panel-chrome": {
|
||||
"exports": ["./ui/panel-chrome"],
|
||||
"modules": [
|
||||
"src/ui/displayPanelScroll.js",
|
||||
"src/ui/radioPanelPlacement.js",
|
||||
"src/panelStackLayout.js",
|
||||
"src/ui/leftPanelRail.js",
|
||||
|
||||
+108
-382
@@ -193,41 +193,74 @@ try {
|
||||
});
|
||||
const contactMissionHandoff = await page.evaluate(async () => {
|
||||
const { styleManager, dataManager } = window.__godsEyeView;
|
||||
// Launch Library is not contacted: the layer's own work is stubbed so the
|
||||
// check covers only how Space Missions sits beside Context.
|
||||
const stubMissions = (rocketEntry) => {
|
||||
const original = {
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
};
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.init = async () => true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => true;
|
||||
rocketEntry.module.disable = async () => true;
|
||||
return () => {
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
};
|
||||
};
|
||||
const originalShowToast = styleManager._showToast;
|
||||
const toasts = [];
|
||||
styleManager._showToast = (message) => { toasts.push(String(message)); };
|
||||
const restoreMissions = stubMissions(dataManager.layers.get('rocket-launches'));
|
||||
try {
|
||||
if (styleManager._contextControls._contextMode) await styleManager._contextControls._selectContextMode(null);
|
||||
const contactsResult = await styleManager._contextControls._selectContextMode('flights');
|
||||
const missionResult = await styleManager._contextControls._selectContextMode('space-missions');
|
||||
const switched = {
|
||||
const missionResult = await dataManager.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
const together = {
|
||||
contactsResult,
|
||||
missionResult,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
missionsEnabled: dataManager.isEnabled('rocket-launches'),
|
||||
toasts: [...toasts],
|
||||
};
|
||||
const missionOff = await dataManager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
const modeAfterMissions = styleManager._contextControls._contextMode;
|
||||
const exitResult = await styleManager._contextControls._selectContextMode(null);
|
||||
return {
|
||||
...switched,
|
||||
...together,
|
||||
missionOff,
|
||||
modeAfterMissions,
|
||||
exitResult,
|
||||
modeAfterExit: styleManager._contextControls._contextMode,
|
||||
missionsOffAfterExit: !dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
};
|
||||
} finally {
|
||||
restoreMissions();
|
||||
styleManager._showToast = originalShowToast;
|
||||
}
|
||||
});
|
||||
check(
|
||||
'Contacts hands off to Space Missions on the first request without a failure toast',
|
||||
'Space Missions runs beside Contacts, and switching it off leaves Contacts on',
|
||||
contactMissionHandoff.contactsResult === true
|
||||
&& contactMissionHandoff.missionResult === true
|
||||
&& contactMissionHandoff.mode === 'space-missions'
|
||||
&& contactMissionHandoff.mode === 'flights'
|
||||
&& contactMissionHandoff.missionsEnabled
|
||||
&& contactMissionHandoff.toasts?.length === 0
|
||||
&& contactMissionHandoff.missionOff === true
|
||||
&& contactMissionHandoff.modeAfterMissions === 'flights'
|
||||
&& contactMissionHandoff.exitResult === true
|
||||
&& contactMissionHandoff.modeAfterExit === null
|
||||
&& contactMissionHandoff.missionsOffAfterExit,
|
||||
&& contactMissionHandoff.modeAfterExit === null,
|
||||
JSON.stringify(contactMissionHandoff),
|
||||
);
|
||||
const cancelledMissionEntry = await page.evaluate(async () => {
|
||||
@@ -330,7 +363,7 @@ try {
|
||||
}
|
||||
});
|
||||
check(
|
||||
'cancelled direct Space Missions entry restores its exact isolated sibling state',
|
||||
'a cancelled Space Missions start leaves its sibling layer on and opens no Context session',
|
||||
cancelledMissionEntry.exercised
|
||||
&& cancelledMissionEntry.transitionResult === false
|
||||
&& !cancelledMissionEntry.timedOut
|
||||
@@ -341,214 +374,45 @@ try {
|
||||
JSON.stringify(cancelledMissionEntry),
|
||||
);
|
||||
check(
|
||||
'successful Space Missions cancellation rollback stays silent',
|
||||
'a cancelled Space Missions start stays silent',
|
||||
cancelledMissionEntry.exercised && cancelledMissionEntry.toasts?.length === 0,
|
||||
JSON.stringify(cancelledMissionEntry.toasts || []),
|
||||
);
|
||||
const replacementMissionEntry = await page.evaluate(async () => {
|
||||
const styleManager = window.__godsEyeView.styleManager;
|
||||
const dataManager = window.__godsEyeView.dataManager;
|
||||
const rocketEntry = dataManager.layers.get('rocket-launches');
|
||||
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
|
||||
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
|
||||
}
|
||||
const siblingId = 'qa-cockpit-replacement-sibling';
|
||||
window.__gevQaRegisterLayer(dataManager, {
|
||||
id: siblingId,
|
||||
name: 'QA replacement sibling',
|
||||
icon: 'science',
|
||||
source: 'QA',
|
||||
updateInterval: -1,
|
||||
async init() { return true; },
|
||||
async enable() { return true; },
|
||||
async update() { return true; },
|
||||
async disable() { return true; },
|
||||
async destroy() {},
|
||||
getStats() { return { count: 1, status: 'live' }; },
|
||||
});
|
||||
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
|
||||
const original = {
|
||||
siblingInitialized: dataManager.layers.get(siblingId)?.initialized,
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
showToast: styleManager._showToast,
|
||||
};
|
||||
let firstUpdate = true;
|
||||
let releaseUpdate;
|
||||
let markUpdateStarted;
|
||||
const updateStarted = new Promise((resolve) => { markUpdateStarted = resolve; });
|
||||
const updateGate = new Promise((resolve) => { releaseUpdate = resolve; });
|
||||
const toasts = [];
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => {
|
||||
if (!firstUpdate) return true;
|
||||
firstUpdate = false;
|
||||
markUpdateStarted();
|
||||
await updateGate;
|
||||
return true;
|
||||
};
|
||||
rocketEntry.module.disable = async () => true;
|
||||
styleManager._showToast = (message) => { toasts.push(String(message)); };
|
||||
try {
|
||||
const entry = styleManager._contextControls._selectContextMode('space-missions');
|
||||
await updateStarted;
|
||||
const replacement = dataManager.setEnabled('rocket-launches', true, { origin: 'programmatic' });
|
||||
releaseUpdate();
|
||||
const [entryResult, replacementResult] = await Promise.all([entry, replacement]);
|
||||
const committed = {
|
||||
entryResult,
|
||||
replacementResult,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingIsolated: !dataManager.isEffectivelyEnabled(siblingId),
|
||||
missionEnabled: dataManager.isEnabled('rocket-launches'),
|
||||
missionEffective: dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
toasts: [...toasts],
|
||||
};
|
||||
const exitResult = await styleManager._contextControls._selectContextMode(null);
|
||||
return {
|
||||
exercised: true,
|
||||
...committed,
|
||||
exitResult,
|
||||
siblingRestored: dataManager.isEnabled(siblingId),
|
||||
missionRestoredOff: !dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
};
|
||||
} finally {
|
||||
styleManager._showToast = original.showToast;
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
|
||||
await window.__gevQaUnregisterLayer(dataManager, siblingId);
|
||||
}
|
||||
});
|
||||
check(
|
||||
'right-rail Space Missions adopts a newer authoritative ON without stale restoration',
|
||||
replacementMissionEntry.exercised
|
||||
&& replacementMissionEntry.entryResult === true
|
||||
&& replacementMissionEntry.replacementResult === true
|
||||
&& replacementMissionEntry.mode === 'space-missions'
|
||||
&& replacementMissionEntry.entering === null
|
||||
&& replacementMissionEntry.snapshotRetained
|
||||
&& replacementMissionEntry.siblingIsolated
|
||||
&& replacementMissionEntry.missionEnabled
|
||||
&& replacementMissionEntry.missionEffective
|
||||
&& replacementMissionEntry.toasts?.length === 0
|
||||
&& replacementMissionEntry.exitResult === true
|
||||
&& replacementMissionEntry.siblingRestored
|
||||
&& replacementMissionEntry.missionRestoredOff,
|
||||
JSON.stringify(replacementMissionEntry),
|
||||
);
|
||||
const supersededMissionEntry = await page.evaluate(async () => {
|
||||
const styleManager = window.__godsEyeView.styleManager;
|
||||
const dataManager = window.__godsEyeView.dataManager;
|
||||
const rocketEntry = dataManager.layers.get('rocket-launches');
|
||||
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
|
||||
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
|
||||
}
|
||||
const siblingId = 'qa-cockpit-superseded-sibling';
|
||||
window.__gevQaRegisterLayer(dataManager, {
|
||||
id: siblingId,
|
||||
name: 'QA superseded sibling',
|
||||
icon: 'science',
|
||||
source: 'QA',
|
||||
updateInterval: -1,
|
||||
async init() { return true; },
|
||||
async enable() { return true; },
|
||||
async update() { return true; },
|
||||
async disable() { return true; },
|
||||
async destroy() {},
|
||||
getStats() { return { count: 1, status: 'live' }; },
|
||||
});
|
||||
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
|
||||
const original = {
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
showToast: styleManager._showToast,
|
||||
};
|
||||
let releaseUpdate;
|
||||
let markUpdateStarted;
|
||||
const updateStarted = new Promise((resolve) => { markUpdateStarted = resolve; });
|
||||
const updateGate = new Promise((resolve) => { releaseUpdate = resolve; });
|
||||
const toasts = [];
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => {
|
||||
markUpdateStarted();
|
||||
await updateGate;
|
||||
return true;
|
||||
};
|
||||
rocketEntry.module.disable = async () => true;
|
||||
styleManager._showToast = (message) => { toasts.push(String(message)); };
|
||||
try {
|
||||
const entry = styleManager._runUserFacingContextAction(
|
||||
(notificationToken) => styleManager._contextControls._selectContextMode(
|
||||
'space-missions',
|
||||
{ notificationToken },
|
||||
),
|
||||
'Space Missions could not complete the requested transition; try again',
|
||||
);
|
||||
await updateStarted;
|
||||
const supersedingOff = dataManager.setEnabled('rocket-launches', false, {
|
||||
origin: 'programmatic',
|
||||
});
|
||||
releaseUpdate();
|
||||
const [entryResult, offResult] = await Promise.all([entry, supersedingOff]);
|
||||
return {
|
||||
exercised: true,
|
||||
entryResult,
|
||||
offResult,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingRestored: dataManager.isEnabled(siblingId),
|
||||
missionEffective: dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
toasts,
|
||||
};
|
||||
} finally {
|
||||
styleManager._showToast = original.showToast;
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
|
||||
await window.__gevQaUnregisterLayer(dataManager, siblingId);
|
||||
}
|
||||
});
|
||||
check(
|
||||
'right-rail Space Missions superseded by OFF restores exactly without a failure toast',
|
||||
supersededMissionEntry.exercised
|
||||
&& supersededMissionEntry.entryResult === null
|
||||
&& supersededMissionEntry.mode === null
|
||||
&& supersededMissionEntry.entering === null
|
||||
&& !supersededMissionEntry.snapshotRetained
|
||||
&& supersededMissionEntry.siblingRestored
|
||||
&& !supersededMissionEntry.missionEffective
|
||||
&& supersededMissionEntry.toasts?.length === 0,
|
||||
JSON.stringify(supersededMissionEntry),
|
||||
);
|
||||
const voiceMissionEntry = await page.evaluate(async () => {
|
||||
const ordinaryMissionLayer = await page.evaluate(async () => {
|
||||
const { dataManager, styleManager } = window.__godsEyeView;
|
||||
const siblingId = '__qa_voice_context_sibling__';
|
||||
const rocketEntry = dataManager.layers.get('rocket-launches');
|
||||
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
|
||||
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
|
||||
}
|
||||
// Launch Library is not contacted: the layer's own work is stubbed so the
|
||||
// check covers only how Space Missions sits beside Context.
|
||||
const stubMissions = (rocketEntry) => {
|
||||
const original = {
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
};
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.init = async () => true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => true;
|
||||
rocketEntry.module.disable = async () => true;
|
||||
return () => {
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
};
|
||||
};
|
||||
const siblingId = '__qa_space_missions_sibling__';
|
||||
window.__gevQaRegisterLayer(dataManager, {
|
||||
id: siblingId,
|
||||
name: 'QA voice Context sibling',
|
||||
name: 'QA Space Missions sibling',
|
||||
icon: 'science',
|
||||
source: 'QA',
|
||||
updateInterval: -1,
|
||||
@@ -559,94 +423,48 @@ try {
|
||||
async destroy() {},
|
||||
getStats() { return { count: 1, status: 'live' }; },
|
||||
});
|
||||
const original = {
|
||||
initialized: rocketEntry.initialized,
|
||||
lifecycleState: rocketEntry.lifecycleState,
|
||||
init: rocketEntry.module.init,
|
||||
enable: rocketEntry.module.enable,
|
||||
update: rocketEntry.module.update,
|
||||
disable: rocketEntry.module.disable,
|
||||
};
|
||||
const siblingLayerEntry = dataManager.layers.get(siblingId);
|
||||
siblingLayerEntry.initialized = true;
|
||||
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
|
||||
rocketEntry.initialized = true;
|
||||
rocketEntry.module.init = async () => true;
|
||||
rocketEntry.module.enable = async () => true;
|
||||
rocketEntry.module.update = async () => true;
|
||||
rocketEntry.module.disable = async () => true;
|
||||
const restoreMissions = stubMissions(rocketEntry);
|
||||
try {
|
||||
const voiceOn = await dataManager.setEnabled('rocket-launches', true, { origin: 'voice' });
|
||||
await new Promise((resolve) => setTimeout(resolve, 80));
|
||||
const voiceState = {
|
||||
voiceOn,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingIsolated: !dataManager.isEffectivelyEnabled(siblingId),
|
||||
};
|
||||
const snapshotBeforeOff = [...(styleManager._contextControls._contextSessionSnapshot?.enabledLayerIds || [])];
|
||||
const voiceOff = await dataManager.setEnabled('rocket-launches', false, { origin: 'voice' });
|
||||
const reactionCountAfterOff = styleManager._contextControls._contextLayerReactionPromises.size;
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
const restoredSiblingEntry = dataManager.layers.get(siblingId);
|
||||
const voiceExit = {
|
||||
voiceOff,
|
||||
snapshotBeforeOff,
|
||||
reactionCountAfterOff,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingRestored: dataManager.isEffectivelyEnabled(siblingId),
|
||||
siblingEnabled: restoredSiblingEntry?.enabled,
|
||||
siblingLifecycle: restoredSiblingEntry?.lifecycleState,
|
||||
restoreActive: Boolean(styleManager._contextControls._contextRestoreState),
|
||||
};
|
||||
|
||||
await dataManager.setEnabled('rocket-launches', true, { origin: 'programmatic' });
|
||||
await new Promise((resolve) => setTimeout(resolve, 40));
|
||||
const internalState = {
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
entering: styleManager._contextControls._contextModeEntering,
|
||||
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
missionEnabled: dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
};
|
||||
await dataManager.setEnabled('rocket-launches', false, { origin: 'programmatic' });
|
||||
return { exercised: true, voiceState, voiceExit, internalState };
|
||||
const results = {};
|
||||
for (const origin of ['user', 'voice', 'programmatic']) {
|
||||
const on = await dataManager.setEnabled('rocket-launches', true, { origin });
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
const during = {
|
||||
on,
|
||||
mode: styleManager._contextControls._contextMode,
|
||||
snapshot: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
siblingOn: dataManager.isEffectivelyEnabled(siblingId),
|
||||
};
|
||||
const off = await dataManager.setEnabled('rocket-launches', false, { origin });
|
||||
await styleManager._waitForContextLayerSettlement();
|
||||
results[origin] = {
|
||||
...during,
|
||||
off,
|
||||
siblingOnAfter: dataManager.isEffectivelyEnabled(siblingId),
|
||||
snapshotAfter: Boolean(styleManager._contextControls._contextSessionSnapshot),
|
||||
};
|
||||
}
|
||||
return { exercised: true, results };
|
||||
} finally {
|
||||
rocketEntry.module.init = original.init;
|
||||
rocketEntry.module.enable = original.enable;
|
||||
rocketEntry.module.update = original.update;
|
||||
rocketEntry.module.disable = original.disable;
|
||||
rocketEntry.initialized = original.initialized;
|
||||
rocketEntry.lifecycleState = original.lifecycleState;
|
||||
restoreMissions();
|
||||
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
|
||||
siblingLayerEntry.initialized = original.siblingInitialized;
|
||||
await window.__gevQaUnregisterLayer(dataManager, siblingId);
|
||||
}
|
||||
});
|
||||
check(
|
||||
'voice Space Missions uses the same Context snapshot and exact-restore transaction as UI entry',
|
||||
voiceMissionEntry.exercised
|
||||
&& voiceMissionEntry.voiceState?.voiceOn
|
||||
&& voiceMissionEntry.voiceState.mode === 'space-missions'
|
||||
&& voiceMissionEntry.voiceState.entering === null
|
||||
&& voiceMissionEntry.voiceState.snapshotRetained
|
||||
&& voiceMissionEntry.voiceState.siblingIsolated
|
||||
&& voiceMissionEntry.voiceExit?.voiceOff
|
||||
&& voiceMissionEntry.voiceExit.mode === null
|
||||
&& voiceMissionEntry.voiceExit.entering === null
|
||||
&& !voiceMissionEntry.voiceExit.snapshotRetained
|
||||
&& voiceMissionEntry.voiceExit.siblingRestored,
|
||||
JSON.stringify(voiceMissionEntry),
|
||||
);
|
||||
check(
|
||||
'internal programmatic Space Missions activation does not create a user Context session',
|
||||
voiceMissionEntry.internalState?.missionEnabled
|
||||
&& voiceMissionEntry.internalState.mode === null
|
||||
&& voiceMissionEntry.internalState.entering === null
|
||||
&& !voiceMissionEntry.internalState.snapshotRetained,
|
||||
JSON.stringify(voiceMissionEntry),
|
||||
'Space Missions is an ordinary layer: no Context session, no isolation, from any origin',
|
||||
ordinaryMissionLayer.exercised
|
||||
&& Object.values(ordinaryMissionLayer.results || {}).length === 3
|
||||
&& Object.values(ordinaryMissionLayer.results).every((entry) =>
|
||||
entry.on === true
|
||||
&& entry.mode === null
|
||||
&& !entry.snapshot
|
||||
&& entry.siblingOn
|
||||
&& entry.off === true
|
||||
&& entry.siblingOnAfter
|
||||
&& !entry.snapshotAfter),
|
||||
JSON.stringify(ordinaryMissionLayer),
|
||||
);
|
||||
await page.evaluate(() => window.__godsEyeView.dataManager.setEnabled(
|
||||
'flights',
|
||||
@@ -1998,98 +1816,6 @@ try {
|
||||
}),
|
||||
);
|
||||
|
||||
// Cyber relocates its collapsed briefing header into the expanded utility
|
||||
// lane. Exercise actual height changes without reload and measure both cards.
|
||||
await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
manager._setHudVariant('cyber');
|
||||
manager.hud.setMode('on');
|
||||
manager._setCockpitDisclosure('display', false);
|
||||
manager._setCockpitDisclosure('radio', true);
|
||||
});
|
||||
const cyberRadioOrder = await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
manager.cockpitView.syncSignalLayout();
|
||||
const display = document
|
||||
.getElementById('cockpit-display-toggle-btn')
|
||||
.closest('.cockpit-utility-control');
|
||||
const radio = document
|
||||
.getElementById('cockpit-radio-toggle-btn')
|
||||
.closest('.cockpit-utility-control');
|
||||
const displayRect = display.getBoundingClientRect();
|
||||
const radioRect = radio.getBoundingClientRect();
|
||||
return {
|
||||
display: displayRect.toJSON(),
|
||||
radio: radioRect.toJSON(),
|
||||
displayExpanded: display.classList.contains('is-expanded'),
|
||||
radioExpanded: radio.classList.contains('is-expanded'),
|
||||
gap: radioRect.top - displayRect.bottom,
|
||||
};
|
||||
});
|
||||
check(
|
||||
'Cyber expanding Radio preserves the authored Display-then-Radio order',
|
||||
!cyberRadioOrder.displayExpanded
|
||||
&& cyberRadioOrder.radioExpanded
|
||||
&& cyberRadioOrder.display.height > 0
|
||||
&& cyberRadioOrder.radio.height > 0
|
||||
&& cyberRadioOrder.gap >= 7,
|
||||
JSON.stringify(cyberRadioOrder),
|
||||
);
|
||||
await page.screenshot({ path: path.join(shotsDir, 'cyber-radio-order.png') });
|
||||
await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
manager._setCockpitDisclosure('radio', false);
|
||||
manager._setCockpitDisclosure('display', true);
|
||||
});
|
||||
const cyberStyleStates = await page.evaluate(() => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
const states = [];
|
||||
for (const style of ['normal', 'surveillance', 'thermal', 'retro']) {
|
||||
document.querySelector(`.style-btn[data-style="${style}"]`).click();
|
||||
states.push({
|
||||
requestedStyle: style,
|
||||
activeStyle: manager.activeStyle,
|
||||
hud: manager.hud.getVariant(),
|
||||
theme: document.documentElement.dataset.uiTheme,
|
||||
selector: document.getElementById('hud-layout-select').value,
|
||||
savedHud: manager.getVisualState().hud.variant,
|
||||
});
|
||||
}
|
||||
return states;
|
||||
});
|
||||
check('Cockpit visual-style controls retain Cyber HUD, selector, shell and saved layout',
|
||||
cyberStyleStates.every(state => state.activeStyle === state.requestedStyle
|
||||
&& state.hud === 'cyber' && state.theme === 'cyber'
|
||||
&& state.selector === 'cyber' && state.savedHud === 'cyber'),
|
||||
JSON.stringify(cyberStyleStates));
|
||||
for (const height of [987, 720, 640, 900]) {
|
||||
await page.setViewport({ width: 1440, height, deviceScaleFactor: 1 });
|
||||
await new Promise((resolve) => setTimeout(resolve, 400));
|
||||
const geometry = await page.evaluate(() => {
|
||||
const signal = document.getElementById('cockpit-signal-stream');
|
||||
const utility = document.getElementById('cockpit-utility-controls');
|
||||
const expanded = utility.querySelector('.cockpit-utility-control.is-expanded');
|
||||
const s = signal.getBoundingClientRect();
|
||||
const u = expanded.getBoundingClientRect();
|
||||
const toggle = document.getElementById('cockpit-signal-toggle');
|
||||
const t = toggle.getBoundingClientRect();
|
||||
const hit = document.elementFromPoint(t.x + t.width / 2, t.y + t.height / 2);
|
||||
return { height: innerHeight, theme: document.documentElement.dataset.uiTheme,
|
||||
collapsed: signal.dataset.collapsed, signal: s.toJSON(), utility: u.toJSON(),
|
||||
reachable: Boolean(hit && toggle.contains(hit)),
|
||||
contained: u.bottom <= s.top - 7 && s.bottom < innerHeight,
|
||||
};
|
||||
});
|
||||
check(`Cyber collapsed Live Signals remains visible and reachable after resize to ${height}px`,
|
||||
geometry.theme === 'cyber' && geometry.collapsed === 'true'
|
||||
&& geometry.signal.width > 0 && geometry.signal.height > 0
|
||||
&& geometry.reachable && geometry.contained, JSON.stringify(geometry));
|
||||
if (height === 640 || height === 900) {
|
||||
await page.screenshot({ path: path.join(shotsDir, `cyber-resize-${height}.png`) });
|
||||
}
|
||||
}
|
||||
await page.evaluate(() => window.__godsEyeView.styleManager._setHudVariant('tactical'));
|
||||
|
||||
const signalTransition = await page.evaluate(async () => {
|
||||
const manager = window.__godsEyeView.styleManager;
|
||||
const cockpit = manager.cockpitView;
|
||||
|
||||
@@ -276,21 +276,21 @@ const MUTATIONS = [
|
||||
},
|
||||
{
|
||||
defect: 'the tile stops promising the fires it actually turns on',
|
||||
file: 'html',
|
||||
file: 'module',
|
||||
from: " 'Live earthquakes and active fires, from USGS and NASA',",
|
||||
to: " 'Live earthquakes worldwide, straight from USGS',",
|
||||
},
|
||||
{
|
||||
defect: 'the owner-authored first-run line is quietly rewritten',
|
||||
defect: 'the maintainer-authored first-run line is quietly rewritten',
|
||||
file: 'html',
|
||||
from: 'It feels like a forbidden cockpit—then you realize the sources are public and the data is real.',
|
||||
to: "It feels like a forbidden cockpit. It isn't — every feed is public, and every contact is live.",
|
||||
to: 'A live 3D globe of public data. Pick a view to begin.',
|
||||
},
|
||||
{
|
||||
defect: 'the ledgered global-chip defect loses its pointer to the real fix',
|
||||
file: 'module',
|
||||
from: ' // means a KEY REQUIRED terminal state in src/loadingFeedback.js, a state',
|
||||
to: ' // (note removed)',
|
||||
from: ' // ends KEY REQUIRED (src/loadingFeedback.js), and the quakes half of the',
|
||||
to: ' // ends KEY REQUIRED, and the quakes half of the',
|
||||
},
|
||||
{
|
||||
defect: 'the globe missions never pull the camera out',
|
||||
@@ -307,14 +307,14 @@ const MUTATIONS = [
|
||||
{
|
||||
defect: 'a cancelled globe flight fails the whole mission',
|
||||
file: 'module',
|
||||
from: ' .catch(() => null);',
|
||||
to: ' .catch(() => { throw new Error("flight failed"); });',
|
||||
from: ' .catch(() => null)\n : null;',
|
||||
to: ' .catch(() => { throw new Error("flight failed"); })\n : null;',
|
||||
},
|
||||
{
|
||||
defect: 'Explore manually quietly runs a mission instead of nothing',
|
||||
file: 'module',
|
||||
from: "if (mission.kind === 'none') return { ok: true, choice };",
|
||||
to: "if (mission.kind === 'none') return { ok: true, choice, ran: await setContextMode('contacts') };",
|
||||
to: "if (mission.kind === 'none') return { ok: true, choice, ran: await setLayerEnabled('rocket-launches') };",
|
||||
},
|
||||
{
|
||||
defect: 'an unknown choice is treated as a success',
|
||||
@@ -348,15 +348,14 @@ const MUTATIONS = [
|
||||
{
|
||||
defect: 'a mission persists a 3D-models choice nobody made',
|
||||
file: 'module',
|
||||
from: ' const result = await styleManager.setContextMode(mode);',
|
||||
to: ' styleManager._setModels3dEnabled?.(true);\n const result = await styleManager.setContextMode(mode);',
|
||||
from: " setLayerEnabled: (layerId) =>\n dataManager.setEnabled(layerId, true, { origin: 'user' }),",
|
||||
to: " setLayerEnabled: (layerId) => {\n styleManager._setModels3dEnabled?.(true);\n return dataManager.setEnabled(layerId, true, { origin: 'user' });\n },",
|
||||
},
|
||||
{
|
||||
defect:
|
||||
'the Context panel is left collapsed, hiding the mode that just started',
|
||||
defect: 'a mission writes panel chrome nobody chose',
|
||||
file: 'module',
|
||||
from: " styleManager.setPanelCollapsed?.('global-context-panel', false, {\n explicit: true,\n });",
|
||||
to: ' // panel reveal removed',
|
||||
from: ' flyToGlobe: () => styleManager.resetToGlobeView(),',
|
||||
to: " flyToGlobe: () => {\n styleManager.setPanelCollapsed?.('global-context-panel', false, { explicit: true });\n return styleManager.resetToGlobeView();\n },",
|
||||
},
|
||||
{
|
||||
defect:
|
||||
@@ -371,8 +370,8 @@ const MUTATIONS = [
|
||||
defect:
|
||||
'disabling the focused tile drops the keyboard to <body> mid-flight',
|
||||
file: 'html',
|
||||
from: ':aria-disabled="launcher?.busy ?? undefined" @click="controls?.choose(\'contacts\')"',
|
||||
to: ':disabled="launcher?.busy === \'true\'" @click="controls?.choose(\'contacts\')"',
|
||||
from: ':aria-disabled="String(settling || launcher?.busy === \'true\')" @click="onPrimary"',
|
||||
to: ':disabled="launcher?.busy === \'true\'" @click="onPrimary"',
|
||||
},
|
||||
{
|
||||
defect: 'Tab escapes into an app the visitor has not seen yet',
|
||||
@@ -421,8 +420,8 @@ const MUTATIONS = [
|
||||
defect:
|
||||
'the card loses its viewport cap and clips on a short landscape phone',
|
||||
file: 'css',
|
||||
from: ' max-height: calc(100dvh - 1.5rem);',
|
||||
to: ' /* cap removed */',
|
||||
from: ' body.mobile-shell #first-run-launcher {\n bottom: 5.8rem;\n max-height: calc(100vh - 6.55rem);\n max-height: calc(100dvh - 6.55rem);\n }',
|
||||
to: ' body.mobile-shell #first-run-launcher {\n bottom: 5.8rem;\n /* cap removed */\n }',
|
||||
},
|
||||
{
|
||||
defect:
|
||||
@@ -437,7 +436,7 @@ const MUTATIONS = [
|
||||
// those instead and prove nothing about this feature.
|
||||
defect: "the launcher's reduced-motion opt-out is dropped",
|
||||
file: 'css',
|
||||
from: ' #first-run-launcher,\n .first-run-choices button,\n .first-run-arrow {\n transition: none;\n }\n /* Scrolling a tile into view must not animate either. */\n .first-run-choices {\n scroll-behavior: auto;\n }',
|
||||
from: ' #first-run-launcher,\n .first-run-backdrop,\n .first-run-back,\n .first-run-missions button,\n .first-run-link-card,\n .first-run-link-button,\n .first-run-enter {\n transition: none;\n }\n /* Scrolling a tile into view must not animate either. */\n .first-run-choices {\n scroll-behavior: auto;\n }',
|
||||
to: ' .first-run-nothing {\n transition: none;\n }',
|
||||
},
|
||||
|
||||
@@ -445,20 +444,20 @@ const MUTATIONS = [
|
||||
{
|
||||
defect: 'a mission tile is dropped from the menu',
|
||||
file: 'html',
|
||||
from: ' <button type="button" data-first-run-choice="space-missions"',
|
||||
to: ' <button type="button" data-first-run-choice-disabled="space-missions"',
|
||||
from: ' <UiButton data-first-run-start="space-missions"',
|
||||
to: ' <UiButton 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: '<UiButton data-first-run-start="environmental"',
|
||||
to: '<UiButton data-first-run-start="zzz-environmental"',
|
||||
},
|
||||
{
|
||||
defect: 'the "don\'t show again" checkbox is removed',
|
||||
defect: 'the "don\'t show again" checkbox loses its hook',
|
||||
file: 'html',
|
||||
from: '<input type="checkbox" data-first-run-suppress @change="onSuppress" />',
|
||||
to: '<span data-first-run-suppress-removed></span>',
|
||||
from: '<UiCheckbox class="first-run-suppress" :input-attrs="suppressBoxAttrs" @change="onSuppress">',
|
||||
to: '<UiCheckbox class="first-run-suppress" @change="onSuppress">',
|
||||
},
|
||||
{
|
||||
defect: 'the status line stops being a polite live region',
|
||||
|
||||
+108
-42
@@ -33,7 +33,7 @@ const TEETH = args.includes('--teeth');
|
||||
const HEADFUL = args.includes('--headful');
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const SHOT_DIR = path.join(ROOT, 'qa-shots', 'firstrun');
|
||||
const SHOT_DIR = process.env.QA_OUTPUT_DIR || path.join(ROOT, 'qa-shots', 'firstrun');
|
||||
|
||||
const CHROME_CANDIDATES = [
|
||||
process.env.PUPPETEER_EXECUTABLE_PATH,
|
||||
@@ -109,7 +109,7 @@ const appState = (page) => page.evaluate(() => {
|
||||
const gev = window.__godsEyeView || {};
|
||||
const sm = gev.styleManager;
|
||||
const dm = gev.dataManager;
|
||||
const carto = sm?.viewer?.camera?.positionCartographic;
|
||||
const carto = gev.viewer?.camera?.positionCartographic;
|
||||
const layers = {};
|
||||
const counts = {};
|
||||
const all = dm?.getAll?.() || [];
|
||||
@@ -170,8 +170,22 @@ async function watchLoadingChip(page) {
|
||||
|
||||
const readLoadingChip = (page) => page.evaluate(() => window.__chipSeen || []);
|
||||
|
||||
async function nextStep(page, readySelector) {
|
||||
await page.click('[data-first-run-next]');
|
||||
await page.waitForSelector(readySelector, { visible: true });
|
||||
await page.waitForFunction(() => {
|
||||
const steps = [...document.querySelectorAll('#first-run-launcher .first-run-step')];
|
||||
return steps.length === 1
|
||||
&& !/first-run-step-(forward|back)-(enter|leave)-/.test(steps[0].className)
|
||||
&& document.querySelector('[data-first-run-primary]')?.getAttribute('aria-disabled') !== 'true';
|
||||
});
|
||||
}
|
||||
|
||||
async function pick(page, choice, { timeout = 40000, settle = [] } = {}) {
|
||||
await page.click(`[data-first-run-choice="${choice}"]`);
|
||||
await nextStep(page, '[data-first-run-start]');
|
||||
await page.click(`[data-first-run-start="${choice}"]`);
|
||||
await nextStep(page, '[data-first-run-choice]');
|
||||
await page.click('[data-first-run-choice]');
|
||||
await page.waitForFunction(
|
||||
(sel) => !document.querySelector(sel) || !document.querySelector(sel).classList.contains('visible'),
|
||||
{ timeout },
|
||||
@@ -190,8 +204,8 @@ async function pick(page, choice, { timeout = 40000, settle = [] } = {}) {
|
||||
/** Every section the run is expected to reach; the teeth verdict requires all. */
|
||||
const EXPECTED_SECTIONS = [
|
||||
'show-policy', 'esc-arbitration',
|
||||
'mission-environmental', 'mission-contacts', 'mission-space', 'mission-explore',
|
||||
'viewports', 'console',
|
||||
'mission-environmental', 'mission-space', 'mission-explore',
|
||||
'stories-card', 'viewports', 'console',
|
||||
];
|
||||
|
||||
/*
|
||||
@@ -482,8 +496,8 @@ async function main() {
|
||||
record('a fresh session gets the launcher', freshVisible);
|
||||
if (freshVisible) shots.push(await shoot(page, 'launcher-desktop'));
|
||||
|
||||
const focused = await page.evaluate(() => document.activeElement?.dataset?.firstRunChoice ?? null);
|
||||
record('focus lands on the first mission tile', focused === 'contacts', `activeElement=${focused}`);
|
||||
const focused = await page.evaluate(() => document.activeElement?.hasAttribute('data-first-run-next') ?? false);
|
||||
record('focus lands on Next', focused === true, `activeElement=${focused}`);
|
||||
|
||||
// The card is a flex column (so its list can scroll on short viewports),
|
||||
// and an author `display` on this id outranks the UA's `[hidden]` rule.
|
||||
@@ -500,10 +514,11 @@ async function main() {
|
||||
record('the hidden attribute still hides the flex card', hiddenHonored === 'none',
|
||||
`computed display while hidden = ${hiddenHonored}`);
|
||||
|
||||
const tiles = await page.$$eval('[data-first-run-choice]', (nodes) => nodes.map((n) => n.dataset.firstRunChoice));
|
||||
await nextStep(page, '[data-first-run-start]');
|
||||
const tiles = await page.$$eval('[data-first-run-start]', (nodes) => nodes.map((n) => n.dataset.firstRunStart));
|
||||
record(
|
||||
'four tiles in the owner\'s order',
|
||||
JSON.stringify(tiles) === JSON.stringify(['contacts', 'space-missions', 'environmental', 'explore']),
|
||||
'three tiles in the owner\'s order',
|
||||
JSON.stringify(tiles) === JSON.stringify(['space-missions', 'environmental', 'explore']),
|
||||
tiles.join(' · '),
|
||||
);
|
||||
|
||||
@@ -558,7 +573,7 @@ async function main() {
|
||||
|
||||
// ── Mission outcomes ────────────────────────────────────────────────────
|
||||
// One section PER MISSION: a throw in one (a tile that never rendered under
|
||||
// --teeth, say) must not take the other four down with it, or the teeth
|
||||
// --teeth, say) must not take the other two down with it, or the teeth
|
||||
// tally reports "reached" for assertions that never ran.
|
||||
let state;
|
||||
let before;
|
||||
@@ -642,47 +657,93 @@ async function main() {
|
||||
shots.push(await shoot(page, 'mission-environmental'));
|
||||
});
|
||||
|
||||
await section('mission-contacts', async () => {
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
await pick(page, 'contacts');
|
||||
state = await appState(page);
|
||||
record('LIVE CONTACTS activates the Contacts context mode', state.contextMode === 'flights',
|
||||
`contextMode=${state.contextMode}`);
|
||||
const panelOpen = await page.evaluate(() => {
|
||||
const panel = document.getElementById('global-context-panel');
|
||||
return !!panel && !panel.classList.contains('collapsed');
|
||||
});
|
||||
record('LIVE CONTACTS reveals the Context panel', panelOpen);
|
||||
record('LIVE CONTACTS still leaves the detection override untouched',
|
||||
state.detectionOverridden === false, `_detectionUserOverridden=${state.detectionOverridden}`);
|
||||
shots.push(await shoot(page, 'mission-contacts'));
|
||||
});
|
||||
|
||||
await section('mission-space', async () => {
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
await pick(page, 'space-missions');
|
||||
state = await appState(page);
|
||||
record('SPACE MISSIONS activates its context mode', state.contextMode === 'space-missions',
|
||||
`contextMode=${state.contextMode}`);
|
||||
const missions = await page.evaluate(() => {
|
||||
const panel = document.getElementById('space-missions-panel');
|
||||
return {
|
||||
layerOn: window.__godsEyeView.dataManager.isEffectivelyEnabled('rocket-launches'),
|
||||
panelOpen: !!panel && !panel.hidden && !panel.classList.contains('collapsed'),
|
||||
};
|
||||
});
|
||||
record('SPACE MISSIONS switches its layer on without a Context mode',
|
||||
missions.layerOn && state.contextMode == null,
|
||||
`layerOn=${missions.layerOn} contextMode=${state.contextMode}`);
|
||||
record('SPACE MISSIONS opens its own panel', missions.panelOpen,
|
||||
`panelOpen=${missions.panelOpen}`);
|
||||
record('SPACE MISSIONS still leaves the detection override untouched',
|
||||
state.detectionOverridden === false, `_detectionUserOverridden=${state.detectionOverridden}`);
|
||||
shots.push(await shoot(page, 'mission-space-missions'));
|
||||
});
|
||||
|
||||
await section('mission-explore', async () => {
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
// Start below the mission overview so an accidental overview flight is observable.
|
||||
await page.evaluate(() => {
|
||||
const camera = window.__godsEyeView.viewer.camera;
|
||||
camera.cancelFlight();
|
||||
camera.setView({ destination: camera.position.constructor.fromDegrees(-97.7431, 30.2672, 100000) });
|
||||
});
|
||||
const beforeExplore = await appState(page);
|
||||
await pick(page, 'explore');
|
||||
state = await appState(page);
|
||||
record('EXPLORE MANUALLY enables no layer and no context mode',
|
||||
Object.values(state.layers).every((on) => !on) && state.contextMode === null,
|
||||
Object.entries(state.layers).filter(([, on]) => on).map(([id]) => id).join(', ') || 'nothing enabled');
|
||||
// The real claim is that Explore issues no camera command of its own: the
|
||||
// arrival fly-in owns the camera and must still be heading down, not out.
|
||||
record('EXPLORE MANUALLY never commandeers the camera',
|
||||
(state.heightKm ?? 0) < 12000 && (state.heightKm ?? 1e9) <= (beforeExplore.heightKm ?? 1e9),
|
||||
`${beforeExplore.heightKm} → ${state.heightKm} km (globe would be 18000)`);
|
||||
beforeExplore.heightKm === 100 && state.heightKm === beforeExplore.heightKm,
|
||||
`${beforeExplore.heightKm} → ${state.heightKm} km (expected 100 → 100 km)`);
|
||||
shots.push(await shoot(page, 'mission-explore'));
|
||||
});
|
||||
|
||||
await section('stories-card', async () => {
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
const backdrop = await page.evaluate(() => {
|
||||
const el = document.querySelector('.first-run-backdrop');
|
||||
if (!el) return null;
|
||||
const style = getComputedStyle(el);
|
||||
return {
|
||||
filter: style.backdropFilter || style.webkitBackdropFilter || 'none',
|
||||
background: style.backgroundColor,
|
||||
pointerEvents: style.pointerEvents,
|
||||
};
|
||||
});
|
||||
record('the welcome backdrop tints the globe without blurring it',
|
||||
!!backdrop && backdrop.filter === 'none' && backdrop.background !== 'rgba(0, 0, 0, 0)'
|
||||
&& backdrop.pointerEvents === 'none',
|
||||
JSON.stringify(backdrop));
|
||||
await nextStep(page, '[data-first-run-start]');
|
||||
await nextStep(page, '[data-first-run-choice]');
|
||||
const button = await page.evaluate(() => {
|
||||
const el = document.querySelector('#first-run-launcher [data-first-run-stories]');
|
||||
return el ? { tag: el.tagName, href: el.getAttribute('href'), target: el.getAttribute('target') } : null;
|
||||
});
|
||||
record('the GEV Stories card offers an in-app BROWSE STORIES button',
|
||||
button?.tag === 'BUTTON' && button.href === null && button.target === null,
|
||||
JSON.stringify(button));
|
||||
const pagesBefore = (await browser.pages()).length;
|
||||
await page.click('#first-run-launcher [data-first-run-stories]');
|
||||
const opened = await page.waitForFunction(
|
||||
() => document.body.classList.contains('stories-mode')
|
||||
&& !!document.querySelector('#gev-stories .app'),
|
||||
{ timeout: 30000 },
|
||||
).then(() => true, () => false);
|
||||
const after = await page.evaluate((sel) => ({
|
||||
launcherVisible: !!document.querySelector(sel)?.classList.contains('visible'),
|
||||
session: sessionStorage.getItem('gev:first-run-mission-session:v1'),
|
||||
query: location.search,
|
||||
}), LAUNCHER);
|
||||
record('BROWSE STORIES opens Stories Explore in this tab',
|
||||
opened && (await browser.pages()).length === pagesBefore,
|
||||
`stories-mode=${opened}, query=${after.query}`);
|
||||
record('BROWSE STORIES closes the welcome card for the session',
|
||||
!after.launcherVisible && after.session !== null,
|
||||
`visible=${after.launcherVisible}, session=${after.session}`);
|
||||
shots.push(await shoot(page, 'stories-card-explore'));
|
||||
});
|
||||
|
||||
// ── Viewports ───────────────────────────────────────────────────────────
|
||||
await section('viewports', async () => {
|
||||
// Portrait phone, LANDSCAPE phone (the short viewport that clipped the card
|
||||
@@ -695,6 +756,8 @@ async function main() {
|
||||
for (const vp of VIEWPORTS) {
|
||||
await page.setViewport({ width: vp.width, height: vp.height, deviceScaleFactor: vp.dpr });
|
||||
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
|
||||
for (let step = 1; step <= 3; step++) {
|
||||
if (step > 1) await nextStep(page, step === 2 ? '[data-first-run-start]' : '[data-first-run-choice]');
|
||||
const box = await page.evaluate((sel) => {
|
||||
const node = document.querySelector(sel);
|
||||
if (!node) return null;
|
||||
@@ -715,22 +778,23 @@ async function main() {
|
||||
const fits = !!box && box.top >= 0 && box.bottom <= box.vh
|
||||
&& box.left >= 0 && box.right <= box.vw;
|
||||
record(
|
||||
`the launcher fits a ${vp.label} with no clipping`,
|
||||
`step ${step} fits a ${vp.label} with no clipping`,
|
||||
fits,
|
||||
box ? `${box.left},${box.top} → ${box.right},${box.bottom} in ${box.vw}x${box.vh}${box.listScrolls ? ' (list scrolls)' : ''}` : 'absent',
|
||||
);
|
||||
record(`"Don't show this again" stays on screen at ${vp.width}x${vp.height}`,
|
||||
record(`step ${step} checkbox stays on screen at ${vp.width}x${vp.height}`,
|
||||
!!box?.checkboxOnScreen);
|
||||
|
||||
// Discoverability: if the list scrolls, the LAST tile must still peek
|
||||
// above the fold. A fold that lands exactly between tiles looks like a
|
||||
// complete list of four, and the fifth mission is simply never found.
|
||||
// complete list, and the last mission is simply never found.
|
||||
if (step === 2) {
|
||||
const peek = await page.evaluate((sel) => {
|
||||
const node = document.querySelector(sel);
|
||||
const list = node?.querySelector('.first-run-choices');
|
||||
if (!list) return null;
|
||||
list.scrollTop = 0;
|
||||
const tiles = [...list.querySelectorAll('[data-first-run-choice]')];
|
||||
const tiles = [...list.querySelectorAll('[data-first-run-start]')];
|
||||
const last = tiles[tiles.length - 1];
|
||||
if (!last) return null;
|
||||
const listBox = list.getBoundingClientRect();
|
||||
@@ -739,7 +803,7 @@ async function main() {
|
||||
return {
|
||||
scrolls: list.scrollHeight > list.clientHeight + 1,
|
||||
fraction: lastBox.height ? visible / lastBox.height : 0,
|
||||
label: last.dataset.firstRunChoice,
|
||||
label: last.dataset.firstRunStart,
|
||||
};
|
||||
}, LAUNCHER);
|
||||
record(
|
||||
@@ -755,7 +819,7 @@ async function main() {
|
||||
const reach = await page.evaluate(async (sel) => {
|
||||
const node = document.querySelector(sel);
|
||||
if (!node) return null;
|
||||
const targets = [...node.querySelectorAll('[data-first-run-choice], [data-first-run-suppress]')];
|
||||
const targets = [...node.querySelectorAll('[data-first-run-start], [data-first-run-suppress]')];
|
||||
const offscreen = [];
|
||||
for (const target of targets) {
|
||||
target.focus();
|
||||
@@ -764,7 +828,7 @@ async function main() {
|
||||
const host = node.getBoundingClientRect();
|
||||
if (document.activeElement !== target
|
||||
|| rect.bottom <= host.top || rect.top >= host.bottom) {
|
||||
offscreen.push(target.dataset.firstRunChoice || 'suppress-checkbox');
|
||||
offscreen.push(target.dataset.firstRunStart || 'suppress-checkbox');
|
||||
}
|
||||
}
|
||||
return { count: targets.length, offscreen };
|
||||
@@ -773,7 +837,7 @@ async function main() {
|
||||
// A hardcoded count silently turns into a failure the day the menu
|
||||
// changes, which is exactly what it did when a tile was removed.
|
||||
const expectedFocusable = await page.$$eval(
|
||||
'[data-first-run-choice]', (nodes) => nodes.length,
|
||||
'[data-first-run-start]', (nodes) => nodes.length,
|
||||
) + 1;
|
||||
record(
|
||||
`every tile and the checkbox are keyboard-reachable at ${vp.width}x${vp.height}`,
|
||||
@@ -782,6 +846,7 @@ async function main() {
|
||||
? `${reach.count}/${expectedFocusable} focusable${reach.offscreen.length ? `, unreachable: ${reach.offscreen.join(', ')}` : ''}`
|
||||
: 'absent',
|
||||
);
|
||||
}
|
||||
// The reachability probe above tabs to the last tile and scrolls the list
|
||||
// with it. Put it back to the top so the taste-pass shot shows what a
|
||||
// visitor actually opens on.
|
||||
@@ -791,7 +856,8 @@ async function main() {
|
||||
document.activeElement?.blur?.();
|
||||
}, LAUNCHER);
|
||||
await sleep(250);
|
||||
shots.push(await shoot(page, `launcher-${vp.name}`));
|
||||
shots.push(await shoot(page, `launcher-${vp.name}-step-${step}`));
|
||||
}
|
||||
}
|
||||
await page.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
|
||||
});
|
||||
|
||||
@@ -111,7 +111,7 @@ await page.waitForFunction(() => window.__godsEyeView?.viewer && window.__godsEy
|
||||
{ timeout: 150000 });
|
||||
await sleep(12000); // let the boot fly-to settle before pinning
|
||||
await page.evaluate(() => {
|
||||
document.querySelector('#first-run-launcher:not([hidden]) [data-first-run-choice="explore"]')?.click();
|
||||
document.querySelector('#first-run-launcher:not([hidden]) [data-first-run-dismiss]')?.click();
|
||||
});
|
||||
await sleep(600); // let the launcher dismissal finish before taking evidence
|
||||
|
||||
|
||||
@@ -314,17 +314,7 @@ try {
|
||||
}
|
||||
await page.evaluate(() => {
|
||||
document.documentElement.lang = 'en';
|
||||
document.documentElement.dataset.uiTheme = 'cyber';
|
||||
});
|
||||
const cyber = await page.$eval(
|
||||
'#scene-select',
|
||||
(node) => getComputedStyle(node).backgroundColor,
|
||||
);
|
||||
check(
|
||||
'Cyber keeps its native field theme',
|
||||
cyber === 'rgba(26, 35, 39, 0.96)',
|
||||
cyber,
|
||||
);
|
||||
await begin('heading');
|
||||
await page.evaluate(() => {
|
||||
const owner = window.__godsEyeView.styleManager._cctvControls;
|
||||
|
||||
+9
-11
@@ -845,7 +845,7 @@ async function main() {
|
||||
params: {},
|
||||
};
|
||||
let failureUsed = false;
|
||||
const entryLayerId = mode === 'flights' ? 'military-awareness' : 'rocket-launches';
|
||||
const entryLayerId = 'military-awareness';
|
||||
dataManager.setEnabled = async (layerId, shouldEnable) => {
|
||||
const failsIsolation = phase === 'isolation' && layerId === 'local-datacenters' && !shouldEnable;
|
||||
const failsActivation = phase === 'activation' && layerId === entryLayerId && shouldEnable;
|
||||
@@ -872,7 +872,6 @@ async function main() {
|
||||
priorLayerRestored: enabled.has('local-datacenters'),
|
||||
entryEnabled: enabled.has(entryLayerId),
|
||||
flightsButtonDisabled: document.getElementById('global-context-flights-btn').disabled,
|
||||
missionsButtonDisabled: document.getElementById('global-context-missions-btn').disabled,
|
||||
message: document.getElementById('toast').textContent,
|
||||
};
|
||||
};
|
||||
@@ -893,7 +892,7 @@ async function main() {
|
||||
}
|
||||
};
|
||||
const contextFailures = [];
|
||||
for (const mode of ['flights', 'space-missions']) {
|
||||
for (const mode of ['flights']) {
|
||||
for (const phase of ['isolation', 'activation']) {
|
||||
for (const outcome of ['false', 'reject']) {
|
||||
contextFailures.push(await runContextFailure(mode, phase, outcome));
|
||||
@@ -902,7 +901,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const directEntryFailures = [];
|
||||
for (const layerId of ['military-awareness', 'rocket-launches']) {
|
||||
for (const layerId of ['military-awareness']) {
|
||||
for (const outcome of ['false', 'reject']) {
|
||||
enabled.clear();
|
||||
enabled.add('local-datacenters');
|
||||
@@ -971,7 +970,7 @@ async function main() {
|
||||
styleManager._showToast = originalShowToast;
|
||||
|
||||
const directActivationFailures = [];
|
||||
for (const layerId of ['military-awareness', 'rocket-launches']) {
|
||||
for (const layerId of ['military-awareness']) {
|
||||
enabled.clear();
|
||||
styleManager._contextControls._contextMode = null;
|
||||
styleManager._contextControls._contextSessionSnapshot = {
|
||||
@@ -1001,7 +1000,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const directActivationRollbackFailures = [];
|
||||
for (const layerId of ['military-awareness', 'rocket-launches']) {
|
||||
for (const layerId of ['military-awareness']) {
|
||||
enabled.clear();
|
||||
styleManager._contextControls._contextMode = null;
|
||||
styleManager._contextControls._contextSessionSnapshot = {
|
||||
@@ -1211,7 +1210,7 @@ async function main() {
|
||||
check(
|
||||
'user-facing chip, real Context entry rollback, and installation Search failures settle safely',
|
||||
userFacingFailures.semanticFalseMessage === 'Radio could not stop cleanly'
|
||||
&& userFacingFailures.contextFailures.length === 8
|
||||
&& userFacingFailures.contextFailures.length === 4
|
||||
&& userFacingFailures.contextFailures.every((failure) => (
|
||||
failure.result === false
|
||||
&& failure.visibleMode === null
|
||||
@@ -1219,10 +1218,9 @@ async function main() {
|
||||
&& failure.priorLayerRestored
|
||||
&& !failure.entryEnabled
|
||||
&& !failure.flightsButtonDisabled
|
||||
&& !failure.missionsButtonDisabled
|
||||
&& failure.message.includes('QA transition failed')
|
||||
))
|
||||
&& userFacingFailures.directEntryFailures.length === 4
|
||||
&& userFacingFailures.directEntryFailures.length === 2
|
||||
&& userFacingFailures.directEntryFailures.every((failure) => (
|
||||
failure.reason.includes('could not start')
|
||||
&& failure.retryReason === null
|
||||
@@ -1233,14 +1231,14 @@ async function main() {
|
||||
&& failure.priorLayerRestored
|
||||
&& !failure.modeChanging
|
||||
))
|
||||
&& userFacingFailures.directActivationFailures.length === 2
|
||||
&& userFacingFailures.directActivationFailures.length === 1
|
||||
&& userFacingFailures.directActivationFailures.every((failure) => (
|
||||
failure.mode === null
|
||||
&& failure.snapshotCleared
|
||||
&& failure.priorLayerRestored
|
||||
&& failure.failedLayerDisabled
|
||||
))
|
||||
&& userFacingFailures.directActivationRollbackFailures.length === 2
|
||||
&& userFacingFailures.directActivationRollbackFailures.length === 1
|
||||
&& userFacingFailures.directActivationRollbackFailures.every((failure) => (
|
||||
failure.toastMessages.length === 1
|
||||
&& failure.toastMessages[0] === `${failure.layerId} could not start cleanly`
|
||||
|
||||
@@ -345,7 +345,7 @@ try {
|
||||
(await readScope()).feather === 2,
|
||||
);
|
||||
await page.click('#scope-toggle');
|
||||
for (const layout of ['minimal', 'cyber', 'tactical']) {
|
||||
for (const layout of ['minimal', 'tactical']) {
|
||||
await page.select('#hud-layout-select', layout);
|
||||
const state = await readScope();
|
||||
check(
|
||||
|
||||
@@ -276,35 +276,6 @@ try {
|
||||
.every((group) => group.scrollWidth <= group.clientWidth + 1),
|
||||
),
|
||||
);
|
||||
const cyber = await page.evaluate(() => {
|
||||
const root = document.documentElement;
|
||||
const previous = root.getAttribute('data-ui-theme');
|
||||
root.setAttribute('data-ui-theme', 'cyber');
|
||||
const selected = [
|
||||
...document.querySelectorAll('.gev-segment[aria-checked="true"]'),
|
||||
];
|
||||
// Check the final theme colors, independent of software-GL frame cadence.
|
||||
for (const button of selected)
|
||||
for (const animation of button.getAnimations()) animation.finish();
|
||||
const backgrounds = selected.map(
|
||||
(button) => getComputedStyle(button).backgroundColor,
|
||||
);
|
||||
const radii = [...document.querySelectorAll('.gev-segmented')].map(
|
||||
(group) => getComputedStyle(group).borderRadius,
|
||||
);
|
||||
const consistent =
|
||||
selected.length === 6 &&
|
||||
backgrounds.every((color) => color === backgrounds[0]) &&
|
||||
radii.every((radius) => radius === '1px');
|
||||
if (previous === null) root.removeAttribute('data-ui-theme');
|
||||
else root.setAttribute('data-ui-theme', previous);
|
||||
return { consistent, count: selected.length, backgrounds, radii };
|
||||
});
|
||||
check(
|
||||
'Cyber theme styles every selected segment consistently',
|
||||
cyber.consistent,
|
||||
JSON.stringify(cyber),
|
||||
);
|
||||
await page.evaluate(async () => {
|
||||
const { dataManager, styleManager } = window.__godsEyeView;
|
||||
await dataManager.setEnabled('recent-imagery', true);
|
||||
|
||||
@@ -194,7 +194,7 @@ try {
|
||||
result,
|
||||
);
|
||||
}
|
||||
for (const theme of ['tactical', 'cyber']) {
|
||||
for (const theme of ['tactical', 'minimal']) {
|
||||
await page.evaluate(
|
||||
(theme) => window.__godsEyeView.styleManager._setHudVariant(theme),
|
||||
theme,
|
||||
|
||||
@@ -231,9 +231,6 @@ async function boot(page, url) {
|
||||
await page.waitForFunction(() => Boolean(window.__godsEyeView?.dataManager), {
|
||||
timeout: 150_000,
|
||||
});
|
||||
await page.evaluate(() =>
|
||||
document.querySelector('.first-run-explore')?.click(),
|
||||
);
|
||||
await page.keyboard.press('Escape');
|
||||
await page.evaluate(() => {
|
||||
for (const el of document.querySelectorAll(
|
||||
|
||||
+17
-17
@@ -1980,16 +1980,19 @@ try {
|
||||
await wait(12_000);
|
||||
check('leaving Contacts restores Transit', await isOn());
|
||||
|
||||
// SPACE MISSIONS
|
||||
await page.evaluate(() =>
|
||||
window.__godsEyeView.dataManager.setEnabled('transit', false, {
|
||||
origin: 'user',
|
||||
}),
|
||||
);
|
||||
await wait(2_000);
|
||||
await page.click('#global-context-missions-btn');
|
||||
// SPACE MISSIONS: an ordinary layer. It neither refuses nor puts away
|
||||
// Transit, so a Transit switched on while it runs stays on after it ends.
|
||||
const setMissions = (enabled) =>
|
||||
page.evaluate(
|
||||
(on) =>
|
||||
window.__godsEyeView.dataManager.setEnabled('rocket-launches', on, {
|
||||
origin: 'user',
|
||||
}),
|
||||
enabled,
|
||||
);
|
||||
await setMissions(true);
|
||||
await wait(20_000);
|
||||
const blocked = await page.evaluate(async () => {
|
||||
const beside = await page.evaluate(async () => {
|
||||
const settled = await window.__godsEyeView.dataManager.setEnabled(
|
||||
'transit',
|
||||
true,
|
||||
@@ -2001,16 +2004,13 @@ try {
|
||||
};
|
||||
});
|
||||
check(
|
||||
'Space Missions refuses to enable Transit while it isolates replay data',
|
||||
blocked.enabled === false,
|
||||
JSON.stringify(blocked),
|
||||
'Transit can be switched on while Space Missions runs',
|
||||
beside.settled !== false && beside.enabled === true,
|
||||
JSON.stringify(beside),
|
||||
);
|
||||
await page.click('#global-context-missions-btn');
|
||||
await setMissions(false);
|
||||
await wait(12_000);
|
||||
check(
|
||||
'leaving Space Missions leaves Transit off, as it was on entry',
|
||||
(await isOn()) === false,
|
||||
);
|
||||
check('switching Space Missions off leaves Transit on', await isOn());
|
||||
|
||||
check(
|
||||
'no uncaught page errors',
|
||||
|
||||
@@ -1637,19 +1637,48 @@ async function main() {
|
||||
// The fixture planes repeat one position, so the icon holds and draws no
|
||||
// head. Fly the tracked one east for this check; the display runs 30 s
|
||||
// behind, so give it time to reach the moving reports.
|
||||
await evalPage((icao) => {
|
||||
await evalPage(async (icao) => {
|
||||
const { rendererOf } = await import(`${window.__gevQaSourceBase || '/src'}/render/rendererOf.js`);
|
||||
const app = window.__godsEyeView;
|
||||
const fl = app.dataManager.layers.get('flights').module;
|
||||
// Observe this selection's actual draw-port submissions: trails no
|
||||
// longer live in viewer.entities. Disabling destroys the reused trail
|
||||
// set, so this selection creates one the probe can identify.
|
||||
await app.dataManager.setEnabled('flights', false);
|
||||
const draw = rendererOf(app.viewer).draw;
|
||||
const createLines = draw.lines;
|
||||
let head = null;
|
||||
let trail = null;
|
||||
draw.lines = function (spec) {
|
||||
const set = createLines.call(this, spec);
|
||||
if (!spec.id.startsWith('trail:')) return set;
|
||||
draw.lines = createLines;
|
||||
trail = set;
|
||||
const upsert = set.upsert;
|
||||
set.upsert = function (items) {
|
||||
const result = upsert.call(this, items);
|
||||
for (const item of items)
|
||||
if (/^gev-trail:\d+:head$/.test(item.id)) head = item;
|
||||
return result;
|
||||
};
|
||||
const clear = set.clear;
|
||||
set.clear = function () { head = null; return clear.call(this); };
|
||||
const dispose = set.dispose;
|
||||
set.dispose = function () { head = null; trail = null; return dispose.call(this); };
|
||||
return set;
|
||||
};
|
||||
window.__qaTrailHead = () => trail?.show && head?.show !== false ? head?.positions : null;
|
||||
window.__qaRestoreTrailProbe = () => { draw.lines = createLines; };
|
||||
await app.dataManager.setEnabled('flights', true);
|
||||
if (!fl.trackById(icao)) throw new Error('trail fixture could not reselect its aircraft');
|
||||
const f = window.__SYNTH.flights.find((p) => p.icao === icao);
|
||||
f.moveFromMs = Date.now();
|
||||
}, trackedIcao);
|
||||
await sleep(55_000);
|
||||
const headSamples = await sampleFrames(page, 40, (icao) => {
|
||||
const viewer = window.__godsEyeView.viewer;
|
||||
const fl = window.__godsEyeView.dataManager.layers.get('flights').module;
|
||||
const ent = viewer.trackedEntity;
|
||||
const time = viewer.clock.currentTime;
|
||||
const head = viewer.entities.values.find((e) => String(e.id).startsWith('gev-trail:fl-head-'));
|
||||
const line = head?.polyline?.positions?.getValue(time);
|
||||
const drawn = ent?.position?.getValue(time);
|
||||
const line = window.__qaTrailHead();
|
||||
const drawn = window.__qaFollowed()?.position?.();
|
||||
if (!line?.length || !drawn) return null;
|
||||
const end = line[line.length - 1];
|
||||
const dist = (a, b) => Math.hypot(a.x - b.x, a.y - b.y, a.z - b.z);
|
||||
@@ -1695,10 +1724,8 @@ async function main() {
|
||||
for (let i = 0; i < 8; i++) {
|
||||
await sleep(600);
|
||||
betweenFrames.push(await evalPage((icao) => {
|
||||
const viewer = window.__godsEyeView.viewer;
|
||||
const head = viewer.entities.values.find((e) => String(e.id).startsWith('gev-trail:fl-head-'));
|
||||
const line = head?.polyline?.positions?.getValue(viewer.clock.currentTime);
|
||||
const drawn = viewer.trackedEntity?.position?.getValue(viewer.clock.currentTime);
|
||||
const line = window.__qaTrailHead();
|
||||
const drawn = window.__qaFollowed()?.position?.();
|
||||
if (!line?.length || !drawn) return null;
|
||||
const end = line[line.length - 1];
|
||||
return Math.hypot(end.x - drawn.x, end.y - drawn.y, end.z - drawn.z);
|
||||
@@ -1712,10 +1739,11 @@ async function main() {
|
||||
f.lon += (f.vel * (Date.now() - f.moveFromMs)) / 1000
|
||||
/ (111320 * Math.cos((f.lat * Math.PI) / 180));
|
||||
delete f.moveFromMs;
|
||||
window.__qaRestoreTrailProbe();
|
||||
}, trackedIcao);
|
||||
const headUsable = headSamples.values.filter((v) => v != null);
|
||||
if (headUsable.length < 10) {
|
||||
skip('trail head: ends at the drawn icon on every frame',
|
||||
record('trail head: ends at the drawn icon on every frame', false,
|
||||
`only ${headUsable.length} frames with a drawn head (timedOut=${headSamples.timedOut})`);
|
||||
} else {
|
||||
const worst = Math.max(...headUsable.map((v) => v.end));
|
||||
@@ -3681,6 +3709,9 @@ async function main() {
|
||||
} while (Date.now() < fleetClampDeadline
|
||||
&& (!Number.isFinite(fleetH) || fleetH < seeded + 1));
|
||||
if (!fl.trackById('aaa097')) return { error: 'trackById(aaa097) failed' };
|
||||
// The tracked contact obeys the same 3D toggle as the fleet. Arm it
|
||||
// before testing the cold-ground gate and the warm model handoff.
|
||||
fl.setParams({ models3d: true });
|
||||
await window.__dfSettle(1500);
|
||||
// Read the tracked entity's rendered height plus the floor under it and
|
||||
// the sensor value the data APIs report, at whatever regime the camera
|
||||
@@ -3770,6 +3801,7 @@ async function main() {
|
||||
};
|
||||
const trackedEntity = window.__qaFollowed();
|
||||
const trackedModel = findOwnModel();
|
||||
if (!trackedModel) return { error: 'tracked model absent before exit' };
|
||||
const achievedOut = await window.__dfZoomAbove(window.__dfRegime.exit + 5000);
|
||||
const zoomedOut = await window.__dfObserveTrackedExit({
|
||||
scene: v.scene, trackedEntity, trackedModel, getTrackedModel: findOwnModel,
|
||||
@@ -3908,10 +3940,8 @@ async function main() {
|
||||
// the tracked billboard becomes the visual again. Gating the clamp on
|
||||
// model EXISTENCE put the burial straight back in exactly that state.
|
||||
//
|
||||
// This scenario also pins the toggle contract itself. The DISPLAY-rail
|
||||
// "3D" toggle stays OFF for the whole block on purpose: it governs the
|
||||
// FLEET's draw-call budget only, and the tracked contact must still take
|
||||
// its model on zoom without the operator arming anything.
|
||||
// The tracked contact obeys the shared 3D toggle. Keep it enabled
|
||||
// while zoom alone hands the visual between model and billboard.
|
||||
const dfRetained = await evalPage(async () => {
|
||||
const v = window.__godsEyeView.viewer;
|
||||
const Cesium = await import('/node_modules/cesium/Build/Cesium/index.js');
|
||||
@@ -3924,13 +3954,13 @@ async function main() {
|
||||
// and there would otherwise hand an open skin to the seeded scenarios
|
||||
// that follow; closing an already-closed skin is inert.
|
||||
try {
|
||||
// Toggle OFF throughout — the tracked model must not need it.
|
||||
fl.setParams({ models3d: false });
|
||||
const toggleOff = fl.getParams().models3d === false;
|
||||
// Arm the shared toggle so the zoom regime can retain a hidden model.
|
||||
fl.setParams({ models3d: true });
|
||||
const toggleOn = fl.getParams().models3d === true;
|
||||
if (!fl.trackById('aaa097')) return { error: 'trackById(aaa097) failed' };
|
||||
await window.__dfSettle(600);
|
||||
// Below the ENTER ceiling (trackById re-frames to the close follow
|
||||
// range): the tracked model arrives on zoom alone, toggle still off.
|
||||
// range): the tracked model arrives on zoom alone, 3D enabled.
|
||||
const belowH = await window.__dfZoomBelow(window.__dfRegime.enter - 20000);
|
||||
const withModel = await window.__dfAwaitTrackedModel('aaa097', 20000);
|
||||
// Same split as the regime scenario: a browser with no usable GLB
|
||||
@@ -3980,7 +4010,7 @@ async function main() {
|
||||
const ent2 = window.__qaFollowed()?.position?.();
|
||||
const c2 = ent2 ? window.__dfCarto(ent2) : null;
|
||||
const out = {
|
||||
toggleOff,
|
||||
toggleOn,
|
||||
enter: window.__dfRegime.enter,
|
||||
exit: window.__dfRegime.exit,
|
||||
belowH,
|
||||
@@ -4015,23 +4045,19 @@ async function main() {
|
||||
record('display-floor/T7: while the tracked MODEL is the visual, the clamp stands aside',
|
||||
!dfRetained.error && dfRetained.modelsRenderingBelow > 0,
|
||||
dfRetained.error
|
||||
|| `${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering at ${(dfRetained.belowH / 1000).toFixed(0)} km with the 3D toggle OFF; entity at ${Number(dfRetained.withModelH).toFixed(1)} m (ground-snap owns it)`);
|
||||
|| `${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering at ${(dfRetained.belowH / 1000).toFixed(0)} km with the 3D toggle ON; entity at ${Number(dfRetained.withModelH).toFixed(1)} m (ground-snap owns it)`);
|
||||
|
||||
// The toggle contract after auto-3D (2026-08-20): the DISPLAY-rail "3D"
|
||||
// switch owns the FLEET only. The tracked contact's model is default-on
|
||||
// and decided purely by camera distance, so with the toggle OFF it is
|
||||
// SHOWN below the enter ceiling and handed back above the exit ceiling —
|
||||
// and handed back by HIDING, not destroying, which is the retained state
|
||||
// the floor pin below depends on.
|
||||
record('display-floor/regime: the 3D toggle governs the FLEET only — the tracked model follows the zoom',
|
||||
!dfRetained.error && dfRetained.toggleOff === true
|
||||
// With 3D enabled, zooming out hides rather than destroys the
|
||||
// tracked model: the retained state the floor check depends on.
|
||||
record('display-floor/regime: with 3D enabled the tracked model follows the zoom',
|
||||
!dfRetained.error && dfRetained.toggleOn === true
|
||||
&& dfRetained.modelsRenderingBelow > 0
|
||||
&& dfRetained.belowH < dfRetained.enter
|
||||
&& dfRetained.shownModelsAbove === 0
|
||||
&& dfRetained.hiddenModelsAbove > 0
|
||||
&& dfRetained.aboveH > dfRetained.exit,
|
||||
dfRetained.error
|
||||
|| `toggle OFF throughout: at ${(dfRetained.belowH / 1000).toFixed(0)} km (< ${(dfRetained.enter / 1000).toFixed(0)} km enter) ${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering; at ${(dfRetained.aboveH / 1000).toFixed(0)} km (> ${(dfRetained.exit / 1000).toFixed(1)} km exit) ${dfRetained.shownModelsAbove} shown / ${dfRetained.hiddenModelsAbove} retained-hidden`);
|
||||
|| `toggle ON throughout: at ${(dfRetained.belowH / 1000).toFixed(0)} km (< ${(dfRetained.enter / 1000).toFixed(0)} km enter) ${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering; at ${(dfRetained.aboveH / 1000).toFixed(0)} km (> ${(dfRetained.exit / 1000).toFixed(1)} km exit) ${dfRetained.shownModelsAbove} shown / ${dfRetained.hiddenModelsAbove} retained-hidden`);
|
||||
|
||||
record('display-floor: a retained-but-hidden tracked model does NOT suppress the floor',
|
||||
Number.isFinite(dfRetained.afterSeedH)
|
||||
|
||||
@@ -89,6 +89,51 @@ export function placeTileFiles(rows, meta) {
|
||||
return files;
|
||||
}
|
||||
|
||||
/**
|
||||
* A pack file's new text, keeping the earlier build's `meta.built` when
|
||||
* nothing else in the file changed, so rebuilding unchanged data leaves the
|
||||
* file as it was. A file that does not hold all of its pack's data (the
|
||||
* places index) is passed through this only when the rest of the pack is
|
||||
* unchanged too.
|
||||
* @param {string} text The new file, JSON with a `meta.built` stamp.
|
||||
* @param {string | undefined} earlier The file as it is now, if there is one.
|
||||
*/
|
||||
export function keepBuiltIfUnchanged(text, earlier) {
|
||||
if (!earlier) return text;
|
||||
let before;
|
||||
try {
|
||||
before = JSON.parse(earlier);
|
||||
} catch {
|
||||
return text;
|
||||
}
|
||||
const after = JSON.parse(text);
|
||||
if (typeof before?.meta?.built !== 'string' || !after.meta) return text;
|
||||
const unstamped = (value) =>
|
||||
JSON.stringify({ ...value, meta: { ...value.meta, built: null } });
|
||||
if (unstamped(before) !== unstamped(after)) return text;
|
||||
return `${JSON.stringify({ ...after, meta: { ...after.meta, built: before.meta.built } })}\n`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Keeps the earlier build's `meta.built` in the places pack's index when the
|
||||
* rebuild changed nothing: every tile and `files.js` the same text, no tile
|
||||
* of the earlier build left out, and nothing else in the index changed. The
|
||||
* index holds only row counts, so it alone cannot tell.
|
||||
* @param {Map<string, string>} files The new pack, as placeTileFiles gives it; its index is replaced in place.
|
||||
* @param {Map<string, string>} earlier The pack's files on disk now, by name.
|
||||
*/
|
||||
export function keepPackBuiltIfUnchanged(files, earlier) {
|
||||
for (const name of earlier.keys())
|
||||
if (name !== 'index.json' && !files.has(name)) return files;
|
||||
for (const [name, text] of files)
|
||||
if (name !== 'index.json' && earlier.get(name) !== text) return files;
|
||||
files.set(
|
||||
'index.json',
|
||||
keepBuiltIfUnchanged(files.get('index.json'), earlier.get('index.json')),
|
||||
);
|
||||
return files;
|
||||
}
|
||||
|
||||
const kmBetween = (a, b) =>
|
||||
greatCircleKm({ lat: a[1], lon: a[2] }, { lat: b[1], lon: b[2] });
|
||||
|
||||
|
||||
Reference in new issue
Block a user