Merge branch 'main' into feat/blender-camera-interchange-submit

This commit is contained in:
German Khokhlov authored and GitHub committed 2026-11-20 16:53:45 +04:00
commit 5b1c1ede29
374 files changed
+30189 -1769

No files matched your search

File diff suppressed because it is too large. Load diff
+54 -1
View File
@@ -157,6 +157,7 @@
"server/providers/cctv/groundHeights.js",
"server/providers/cctv/catalog.js",
"server/providers/cctv/lithuania.js",
"server/providers/cctv/catalogPair.js",
"src/data/cctvLithuania.test.mjs",
"server/providers/cctv/taiwan.js",
"src/data/cctvTaiwan.test.mjs",
@@ -649,6 +650,9 @@
"src/layers/cctv/health.js",
"src/data/cctv.js",
"src/data/cctvCatalogCap.test.mjs",
"src/data/cctvCellCounts.test.mjs",
"src/data/cctvViewPass.test.mjs",
"src/data/cctvViewThinning.test.mjs",
"src/data/cctvDisplayCode.test.mjs",
"src/data/cctvFootprint.js",
"src/data/cctvGroundHeights.test.mjs",
@@ -667,12 +671,17 @@
"src/data/cctvTxdotSource.test.mjs",
"src/layers/cctv/source.test.mjs",
"src/layers/cctv/frames.test.mjs",
"src/layers/cctv/countMarkers.test.mjs",
"src/layers/cctv/count_click_overlay.test.mjs",
"src/layers/cctv/count_click_framing.test.mjs",
"src/layers/cctv/ground.test.mjs",
"src/layers/cctv/rendering.test.mjs",
"src/data/alprCameras.js",
"src/data/alprCameras.test.mjs",
"src/data/dataCredits.test.mjs",
"src/layers/alpr/index.js",
"src/layers/alpr/model.js",
"src/layers/alpr/modelSpecs.test.mjs",
"src/layers/alpr/policy.js",
"src/layers/alpr/presentation.js",
"src/layers/alpr/presentation.test.mjs",
@@ -1157,6 +1166,8 @@
"src/layers/streetLevel/providers/panoramax/decode.js",
"src/layers/streetLevel/providers/panoramax/viewer.js",
"src/layers/streetLevel/photoViewer.js",
"src/layers/streetLevel/photoViewers.js",
"src/layers/streetLevel/photoViewers.test.mjs",
"src/layers/streetLevel/limiter.js",
"src/layers/streetLevel/imageSize.js",
"src/layers/streetLevel/tileCache.js",
@@ -1299,6 +1310,7 @@
"src/render/cesium/zoomOutGuard.test.mjs",
"src/app/controls.test.mjs",
"scripts/qa-zoom-out-guard.mjs",
"scripts/qa-zoom-under-icon.mjs",
"src/hudSummaryGate.test.mjs",
"src/hudSummaryLine.test.mjs",
"src/testSupport/stubMgrs.mjs",
@@ -1341,6 +1353,7 @@
"src/ui/kit/UiCloseButton.vue",
"src/ui/kit/UiCloseButton.test.mjs",
"src/ui/kit/closeButtons.test.mjs",
"src/ui/kit/viewControls.test.mjs",
"src/ui/styles/close-button.css",
"src/ui/kit/UiSearchField.vue",
"src/ui/kit/UiSearchField.test.mjs",
@@ -1358,6 +1371,16 @@
"src/ui/kit/welcomeControls.test.mjs",
"src/ui/kit/omnibarControls.test.mjs",
"src/ui/kit/storiesControls.test.mjs",
"src/ui/kit/chatVoiceControls.test.mjs",
"src/ui/kit/cockpitControls.test.mjs",
"src/ui/kit/smallSurfacesControls.test.mjs",
"src/ui/kit/commandDockControls.test.mjs",
"src/ui/kit/streetLevelPhotoControls.test.mjs",
"src/ui/stores/streetLevelPhoto.js",
"src/ui/kit/bhoteKoshiControls.test.mjs",
"src/ui/bhoteKoshi/BhoteKoshiMediaCards.vue",
"src/ui/kit/missionsRadioControls.test.mjs",
"src/ui/kit/drawControls.test.mjs",
"src/ui/styles/chip.css",
"src/ui/styles/empty-state.css",
"src/ui/rail/RailChips.vue",
@@ -1433,6 +1456,7 @@
"src/data/firmsIntensity.test.mjs",
"src/ui/layerPanel/RowSwitch.vue",
"src/ui/layerPanel/RowRange.vue",
"src/ui/layerPanel/rowRange.test.mjs",
"src/ui/layerPanel/RowSlider.vue",
"src/sources/phaseTiming.test.mjs",
"scripts/build-census-places.mjs",
@@ -1648,5 +1672,34 @@
"src/layers/firms/selection.test.mjs",
"src/layers/vessels/selection.test.mjs",
"src/layers/bikeshare/selection.test.mjs",
"src/layers/satellites/interaction.test.mjs"
"src/layers/satellites/interaction.test.mjs",
"server/providers/space/issTelemetry.test.mjs",
"src/data/liveStreams.test.mjs",
"src/data/youtubeLivePlayer.test.mjs",
"src/data/youtubeApi.test.mjs",
"src/layers/installations/labelBoxClick.test.mjs",
"src/layers/satellites/cockpitSubject.test.mjs",
"src/layers/satellites/issArticulation.test.mjs",
"src/layers/satellites/issCommand.test.mjs",
"src/layers/satellites/issModel.test.mjs",
"src/layers/satellites/issMounts.test.mjs",
"src/layers/satellites/issTelemetry.test.mjs",
"src/layers/satellites/offCesium.test.mjs",
"src/layers/satellites/stationModel.test.mjs",
"src/layers/satellites/stationModels.test.mjs",
"src/layers/satellites/stationPanel.test.mjs",
"src/layers/satellites/stationResume.test.mjs",
"src/layers/satellites/tiangongArticulation.test.mjs",
"src/layers/satellites/tiangongModel.test.mjs",
"src/layers/satellites/tiangongMounts.test.mjs",
"src/layers/satellites/tiangongStation.test.mjs",
"src/render/cesium/draw.test.mjs",
"src/ui/cockpitBriefing.test.mjs",
"src/ui/cockpitOrbitalFocus.test.mjs",
"src/ui/cockpitOrbitalView.test.mjs",
"src/ui/liveControls.test.mjs",
"src/ui/livePanel.test.mjs",
"src/ui/stationPanel.test.mjs",
"src/ui/styles/live.css",
"src/ui/styles/station.css"
]
+2
View File
@@ -649,6 +649,8 @@ const ZH_HANT_CORRECTIONS = [
['箇中', '個中'],
// 周 as a week: the time-lapse speed in weeks per second.
[' 周/秒', ' 週/秒'],
// 后 as "behind" after a module name (问天, 梦天), not 天后 (empress).
['天后側', '天後側'],
];
let s2tw;
+101 -7
View File
@@ -211,7 +211,9 @@
"src/ui/stores/windInspection.js",
"src/ui/views/panels/WindInspectionMarker.vue",
"src/ui/stores/missionReplay.js",
"src/ui/stores/streetLevelPhoto.js",
"src/ui/views/panels/MissionReplayOverlay.vue",
"src/ui/views/panels/StreetLevelPhotoViewer.vue",
"src/ui/stores/bhoteKoshiPanel.js",
"src/ui/views/panels/BhoteKoshiPanel.vue",
"src/ui/stores/celestialRing.js",
@@ -313,7 +315,13 @@
"src/search/gridReference.js",
"src/search/coordinateParser.js",
"src/search/placeSuggestions.js",
"src/search/bip39Words.js"
"src/search/bip39Words.js",
"src/ui/stores/station.js",
"src/ui/views/panels/StationPanel.vue",
"src/ui/stores/live.js",
"src/ui/views/panels/LivePanel.vue",
"src/ui/views/panels/CockpitLivePage.vue",
"src/ui/liveScreen.js"
],
"external": ["vue", "pinia", "vue-i18n"]
},
@@ -563,6 +571,7 @@
"server/providers/cctv/groundHeights.js",
"server/providers/cctv/catalog.js",
"server/providers/cctv/lithuania.js",
"server/providers/cctv/catalogPair.js",
"server/providers/cctv/taiwan.js",
"server/providers/cctv/quebec.js",
"server/providers/cctv/ottawa.js",
@@ -581,7 +590,9 @@
"src/data/cctvFootprint.js",
"src/sources/cctvTypes.js",
"src/sources/httpBody.js",
"src/i18n/marker.js"
"src/i18n/marker.js",
"server/providers/common/rate-limit.js",
"src/sources/rateLimit.js"
],
"external": []
},
@@ -1289,7 +1300,9 @@
"src/render/cesium/zoomOutGuard.js",
"src/render/cesium/sceneOcclusionProbe.js",
"src/render/occlusion/depthProbe.js",
"src/data/detectionOcclusion.js"
"src/data/detectionOcclusion.js",
"src/layers/satellites/issMounts.js",
"src/layers/satellites/tiangongMounts.js"
],
"external": ["cesium", "kdbush"]
},
@@ -1604,6 +1617,7 @@
"src/ui/stores/status.js",
"src/ui/toast.js",
"src/ui/stores/missionReplay.js",
"src/ui/stores/streetLevelPhoto.js",
"src/ui/stores/celestialRing.js",
"src/ui/stores/worldOverlayActions.js",
"src/ui/stores/awarenessDirection.js",
@@ -1687,10 +1701,19 @@
"src/data/aircraftEmergency.js",
"src/ui/stores/entityCard.js",
"src/ui/entityContextBridge.js",
"src/data/locate.js",
"src/data/trackingClickGesture.js",
"src/ui/stores/sceneSharing.js",
"src/maps/attribution.js",
"src/data/dataCredits.js"
"src/data/dataCredits.js",
"src/layers/satellites/issMounts.js",
"src/layers/satellites/tiangongMounts.js",
"src/ui/stores/station.js",
"src/ui/stores/live.js",
"src/data/liveStreams.js",
"src/data/youtubeApi.js",
"src/data/youtubeLivePlayer.js",
"src/ui/liveControls.js"
],
"external": [
"cesium",
@@ -1963,6 +1986,7 @@
"src/layers/flights/policy.js",
"src/render/color.js",
"src/layers/flights/queries.js",
"src/data/locate.js",
"src/render/cesium/camera.js",
"src/render/cesium/frame.js",
"src/render/cesium/query.js",
@@ -2114,6 +2138,7 @@
"src/layers/military/policy.js",
"src/render/color.js",
"src/layers/military/queries.js",
"src/data/locate.js",
"src/render/cesium/camera.js",
"src/render/cesium/frame.js",
"src/render/cesium/query.js",
@@ -2281,6 +2306,7 @@
"src/layers/vessels/lifecycle.js",
"src/layers/vessels/policy.js",
"src/layers/vessels/queries.js",
"src/data/locate.js",
"src/geo/vector.js",
"src/layers/vessels/rendering.js",
"src/render/camera/poseSignature.js",
@@ -2852,7 +2878,21 @@
"src/render/cesium/zoomOutGuard.js",
"src/render/cesium/sceneOcclusionProbe.js",
"src/render/occlusion/depthProbe.js",
"src/data/detectionOcclusion.js"
"src/data/detectionOcclusion.js",
"src/layers/satellites/issModel.js",
"src/layers/satellites/issTelemetry.js",
"src/layers/satellites/issMounts.js",
"src/layers/satellites/tiangongMounts.js",
"src/layers/satellites/issArticulation.js",
"src/layers/satellites/issCommand.js",
"src/layers/satellites/stationPanel.js",
"src/layers/satellites/issStation.js",
"src/layers/satellites/stationModels.js",
"src/layers/satellites/stationModel.js",
"src/layers/satellites/tiangongModel.js",
"src/layers/satellites/tiangongStation.js",
"src/layers/satellites/tiangongJoints.js",
"src/layers/satellites/tiangongArticulation.js"
],
"external": ["cesium", "satellite.js", "kdbush"]
},
@@ -3351,6 +3391,9 @@
"src/data/cctvCards.js",
"src/data/cctvGizmo.js",
"src/data/cctvLod.js",
"src/data/cameraFraming.js",
"src/data/cctvCellCounts.js",
"src/layers/cctv/countMarkers.js",
"src/data/cctvViewshed.js",
"src/data/iconOrientation.js",
"src/data/screenRotation.js",
@@ -3556,6 +3599,7 @@
"src/layers/streetLevel/providers/panoramax/decode.js",
"src/layers/streetLevel/providers/panoramax/viewer.js",
"src/layers/streetLevel/photoViewer.js",
"src/layers/streetLevel/photoViewers.js",
"src/layers/streetLevel/limiter.js",
"src/layers/streetLevel/imageSize.js",
"src/layers/streetLevel/tileCache.js",
@@ -3641,6 +3685,8 @@
"src/render/cesium/common.js",
"src/render/cesium/internals.js",
"src/layers/alpr/visuals.js",
"src/layers/alpr/modelSpecs.js",
"src/layers/cctv/modelSpecs.js",
"src/layers/alpr/overlay.js",
"src/layers/alpr/markerState.js",
"src/layers/alpr/source.js",
@@ -4181,6 +4227,7 @@
"src/render/cesium/heights.js",
"src/ui/imagerySplit.js",
"src/data/bhoteKoshiEmbeddedMedia.js",
"src/ui/bhoteKoshi/BhoteKoshiMediaCards.vue",
"src/data/bhoteKoshiLocator.js",
"src/data/bhoteKoshiIncidentPlaces.js",
"src/data/bhoteKoshiFloodPath.js",
@@ -4313,6 +4360,8 @@
"src/data/cctvFootprint.js",
"src/data/cctvGizmo.js",
"src/data/cctvLod.js",
"src/data/cctvCellCounts.js",
"src/layers/cctv/countMarkers.js",
"src/data/cctvViewshed.js",
"src/data/cockpitAirLod.js",
"src/data/cockpitContactDot.js",
@@ -4439,6 +4488,7 @@
"src/layers/alpr/policy.js",
"src/layers/alpr/presentation.js",
"src/layers/alpr/visuals.js",
"src/layers/alpr/modelSpecs.js",
"src/layers/alpr/overlay.js",
"src/layers/alpr/markerState.js",
"src/layers/alpr/source.js",
@@ -5150,6 +5200,7 @@
"src/layers/streetLevel/providers/panoramax/decode.js",
"src/layers/streetLevel/providers/panoramax/viewer.js",
"src/layers/streetLevel/photoViewer.js",
"src/layers/streetLevel/photoViewers.js",
"src/layers/streetLevel/limiter.js",
"src/layers/streetLevel/imageSize.js",
"src/layers/streetLevel/tileCache.js",
@@ -5368,6 +5419,7 @@
"src/ui/stores/windInspection.js",
"src/layers/wind/inspectionMarker.js",
"src/ui/stores/missionReplay.js",
"src/ui/stores/streetLevelPhoto.js",
"src/ui/stores/bhoteKoshiPanel.js",
"src/ui/stores/celestialRing.js",
"src/ui/stores/screenAnnotations.js",
@@ -5521,7 +5573,28 @@
"src/data/entityContext.js",
"src/ui/stores/entityCard.js",
"src/ui/entityContextBridge.js",
"src/render/cesium/cardPreviews.js"
"src/data/locate.js",
"src/render/cesium/cardPreviews.js",
"src/layers/satellites/issModel.js",
"src/layers/satellites/issTelemetry.js",
"src/layers/satellites/issMounts.js",
"src/layers/satellites/tiangongMounts.js",
"src/layers/satellites/issArticulation.js",
"src/layers/satellites/issCommand.js",
"src/ui/stores/live.js",
"src/ui/stores/station.js",
"src/data/liveStreams.js",
"src/layers/satellites/stationPanel.js",
"src/layers/satellites/issStation.js",
"src/data/youtubeApi.js",
"src/data/youtubeLivePlayer.js",
"src/ui/liveControls.js",
"src/layers/satellites/stationModels.js",
"src/layers/satellites/stationModel.js",
"src/layers/satellites/tiangongStation.js",
"src/layers/satellites/tiangongModel.js",
"src/layers/satellites/tiangongJoints.js",
"src/layers/satellites/tiangongArticulation.js"
],
"external": [
"hls.js",
@@ -5583,6 +5656,7 @@
"src/ui/imagerySplit.js",
"src/maps/imageryComparison.js",
"src/data/bhoteKoshiEmbeddedMedia.js",
"src/ui/bhoteKoshi/BhoteKoshiMediaCards.vue",
"src/data/bhoteKoshiLocator.js",
"src/render/cesium/camera.js",
"src/render/cesium/frame.js",
@@ -5654,6 +5728,8 @@
"src/data/cctvFootprint.js",
"src/data/cctvGizmo.js",
"src/data/cctvLod.js",
"src/data/cctvCellCounts.js",
"src/layers/cctv/countMarkers.js",
"src/data/cctvViewshed.js",
"src/data/cockpitAirLod.js",
"src/data/cockpitContactDot.js",
@@ -5728,6 +5804,7 @@
"src/layers/alpr/policy.js",
"src/layers/alpr/presentation.js",
"src/layers/alpr/visuals.js",
"src/layers/alpr/modelSpecs.js",
"src/layers/alpr/overlay.js",
"src/layers/alpr/markerState.js",
"src/layers/alpr/source.js",
@@ -5959,6 +6036,7 @@
"src/layers/vessels/lifecycle.js",
"src/layers/vessels/policy.js",
"src/layers/vessels/queries.js",
"src/data/locate.js",
"src/layers/vessels/rendering.js",
"src/render/motion/iconBook.js",
"src/layers/vessels/iconBook.js",
@@ -6213,6 +6291,7 @@
"src/layers/streetLevel/providers/panoramax/decode.js",
"src/layers/streetLevel/providers/panoramax/viewer.js",
"src/layers/streetLevel/photoViewer.js",
"src/layers/streetLevel/photoViewers.js",
"src/layers/streetLevel/limiter.js",
"src/layers/streetLevel/imageSize.js",
"src/layers/streetLevel/tileCache.js",
@@ -6356,7 +6435,22 @@
"src/data/placementProvider.js",
"src/data/courseFromFixes.js",
"src/time/frameWait.js",
"src/maps/attribution.js"
"src/maps/attribution.js",
"src/layers/satellites/issModel.js",
"src/layers/satellites/issTelemetry.js",
"src/layers/satellites/issMounts.js",
"src/layers/satellites/tiangongMounts.js",
"src/layers/satellites/issArticulation.js",
"src/layers/satellites/issCommand.js",
"src/data/youtubeApi.js",
"src/layers/satellites/stationPanel.js",
"src/layers/satellites/issStation.js",
"src/layers/satellites/stationModels.js",
"src/layers/satellites/stationModel.js",
"src/layers/satellites/tiangongStation.js",
"src/layers/satellites/tiangongJoints.js",
"src/layers/satellites/tiangongArticulation.js",
"src/layers/satellites/tiangongModel.js"
],
"external": [
"hls.js",
+37
View File
@@ -1790,6 +1790,43 @@ async function main() {
gizmoStates.map((s, i) => `${GIZMO_PARTS[i]}=${s}`).join(' '),
);
// Frame the actual gizmo for the drag fixture. Default autofocus can leave
// its shaft below the 10px interaction threshold; that distant view is not
// the drag-usability scenario this regression exercises. The gizmo is drawn
// through the renderer ports, so its arrow is read from the layer's drawn
// state (plain {x,y,z} points), not from viewer.entities.
const dragFraming = await page.evaluate(async () => {
const viewer = window.__godsEyeView.viewer;
const mod = window.__godsEyeView.dataManager.layers.get('cctv').module;
const arrow = () =>
mod._cctvDrawnForTest().gizmo['cctv-gizmo-move-east']?.positions;
if (!arrow()?.length) return null;
const Cartesian3 = viewer.camera.positionWC.constructor;
const measure = () => {
const pts = arrow();
if (!pts?.length) return { shaftPx: null, rangeM: null };
const a = viewer.scene.cartesianToCanvasCoordinates(pts[0]);
const b = viewer.scene.cartesianToCanvasCoordinates(pts[pts.length - 1]);
return {
shaftPx: a && b ? Math.hypot(b.x - a.x, b.y - a.y) : null,
rangeM: Cartesian3.distance(viewer.camera.positionWC, pts[0]),
};
};
const before = measure();
const target = Cartesian3.clone(arrow()[0]);
viewer.camera.cancelFlight();
viewer.camera.lookAt(target, new Cartesian3(0, -200, 180));
viewer.camera.lookAtTransform(viewer.camera.transform.constructor.IDENTITY);
viewer.scene.requestRender();
const frames = await window.__qaRenderFrames(3, 10000);
return { before, after: measure(), frames };
});
record(
'drag fixture frames the east arrow above the 10px grab threshold',
dragFraming?.after?.shaftPx >= 10,
JSON.stringify(dragFraming),
);
// Synthetic CDP drag on the EAST arrow — the owner's field-test
// regression. Sample effective elevation after every mouse move: it must
// stay frozen until release, with no transient sampleHeight calls.
+148
View File
@@ -2050,6 +2050,151 @@ try {
JSON.stringify(narrowViewActions),
);
// A fresh profile has not seen the Stories announcement: Cockpit keeps
// it unread and off the phone row until it closes.
const storiesPopupDisplay = () => {
const popup = document.getElementById('hPop');
return popup ? getComputedStyle(popup).display : null;
};
const storiesPopupInCockpit = await page.evaluate(storiesPopupDisplay);
check('the unread Stories announcement waits while Cockpit is open',
storiesPopupInCockpit === 'none', String(storiesPopupInCockpit));
// Windows too short for the centred row keep it above Reset/Exit.
for (const [width, height] of [[360, 370], [320, 360], [568, 188], [667, 190]]) {
await page.setViewport({ width, height, deviceScaleFactor: 1 });
const glyphHits = await page.evaluate(async () => {
const manager = window.__godsEyeView.styleManager;
manager._setCockpitDisclosure('display', false);
manager._setCockpitDisclosure('radio', false);
await new Promise(requestAnimationFrame);
await new Promise(requestAnimationFrame);
return [...document.querySelectorAll(
'#cockpit-utility-controls .cockpit-utility-glyph',
)].map((glyph) => {
const box = glyph.getBoundingClientRect();
const target = document.elementFromPoint(
box.left + box.width / 2,
box.top + box.height / 2,
);
return target && glyph.contains(target) ? 'ok' : target?.closest('[id]')?.id || null;
});
});
check(
`${width}×${height} Cockpit Display/Radio glyph centres reach their own launchers`,
glyphHits.length === 2 && glyphHits.every((hit) => hit === 'ok'),
JSON.stringify(glyphHits),
);
}
// The phone row's place in each room: centred on Reset/Exit, on screen,
// tappable, and clear of what that room has space to clear.
for (const [width, height, room] of [
[360, 740, 'portrait'],
[720, 360, 'landscape'],
[667, 240, 'short'],
[390, 844, 'portrait'],
]) {
await page.setViewport({ width, height, deviceScaleFactor: 1 });
const phoneRow = await page.evaluate(async () => {
const manager = window.__godsEyeView.styleManager;
manager._setCockpitDisclosure('display', false);
manager._setCockpitDisclosure('radio', false);
await new Promise(requestAnimationFrame);
manager.cockpitView.syncSignalLayout();
await new Promise(requestAnimationFrame);
const rect = (element) => element?.getBoundingClientRect().toJSON() || null;
const hud = (selector) => document.querySelector(`#cockpit-hud ${selector}`);
const route = document.getElementById('cockpit-route-direction');
// A live flight may have no route, which hides the DEST cue. Show it while
// measuring so the clearance check always has a cue to clear.
const wasHidden = route.hidden;
try {
route.hidden = false;
const controls = [...document.querySelectorAll(
'#cockpit-utility-controls .cockpit-utility-control',
)];
const launchers = controls.map(rect);
const rowLeft = Math.min(...launchers.map((launcher) => launcher.left));
const rowRight = Math.max(...launchers.map((launcher) => launcher.right));
// Taps beside the row reach what is under it.
const besideHits = [];
if (launchers.length) {
const middle = launchers[0].top + launchers[0].height / 2;
for (const x of [rowLeft - 8, rowRight + 8]) {
const target = document.elementFromPoint(x, middle);
besideHits.push(Boolean(target?.closest('#cockpit-utility-controls')));
}
}
return {
launchers,
rowLeft,
rowRight,
besideHits,
hits: controls.map((control) => {
const glyph = control.querySelector('.cockpit-utility-glyph');
const box = glyph?.getBoundingClientRect();
const target = box && document.elementFromPoint(
box.left + box.width / 2,
box.top + box.height / 2,
);
return Boolean(target && glyph.contains(target));
}),
speed: rect(hud('.cockpit-speed')),
altitude: rect(hud('.cockpit-altitude')),
route: rect(route),
chevron: rect(route.querySelector('.cockpit-route-chevron')),
reticle: rect(hud('.cockpit-reticle')),
rollArc: rect(hud('.cockpit-roll-arc')),
vision: rect(hud('.cockpit-vision-controls')),
switcher: rect(document.getElementById('view-switcher')),
viewport: { width: innerWidth, height: innerHeight },
};
} finally {
route.hidden = wasHidden;
}
});
const obstacles = {
portrait: ['speed', 'altitude', 'route', 'chevron', 'reticle', 'rollArc', 'vision'],
// The row covers the roll arc's lower tick ends; ticks and labels stay readable.
landscape: ['speed', 'altitude', 'route', 'chevron', 'reticle', 'vision'],
// No free band between the instruments: only the vision controls.
short: ['vision'],
}[room];
const overlaps = (a, b) => Boolean(a && b)
&& a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom;
const { rowLeft, rowRight } = phoneRow;
const switcherCentre = (phoneRow.switcher?.left + phoneRow.switcher?.right) / 2;
const [first, second] = phoneRow.launchers;
check(
`${width}×${height} Cockpit Display/Radio row is centred in one line, on screen, tappable and clear of ${obstacles.join(', ')}`,
phoneRow.launchers.length === 2
&& phoneRow.launchers.every((launcher) => launcher.width > 0)
&& phoneRow.speed?.width > 0
&& phoneRow.altitude?.width > 0
&& (room === 'short' || (phoneRow.route?.width > 0 && phoneRow.chevron?.width > 0))
&& phoneRow.hits.every(Boolean)
&& phoneRow.besideHits.every((inside) => !inside)
&& Math.abs((first?.top + first?.bottom) / 2 - (second?.top + second?.bottom) / 2) <= 1
&& phoneRow.launchers.every((launcher) => obstacles.every(
(name) => !overlaps(launcher, phoneRow[name]),
))
&& Math.abs((rowLeft + rowRight) / 2 - switcherCentre) <= 2
&& rowLeft >= 0
&& rowRight <= phoneRow.viewport.width
&& phoneRow.launchers.every((launcher) => (
launcher.top >= 0 && launcher.bottom <= phoneRow.viewport.height
)),
JSON.stringify(phoneRow),
);
}
// A Stories tap that Cockpit refuses leaves the announcement unread.
await page.evaluate(() => document.getElementById('hStories').click());
await page.waitForFunction(
() => document.querySelector('#toast.visible')?.textContent === 'Exit cockpit to open Stories',
);
const resetResult = await page.evaluate(() => {
// Both the UI and compatibility facade delegate to this navigation owner.
const manager = window.__godsEyeView.styleManager._locationNavigation;
@@ -2121,6 +2266,9 @@ try {
&& resetState.visionRestored,
JSON.stringify(resetState),
);
const storiesPopupAfterReset = await page.evaluate(storiesPopupDisplay);
check('the Stories announcement returns once Cockpit closes',
storiesPopupAfterReset !== null && storiesPopupAfterReset !== 'none', String(storiesPopupAfterReset));
check('runtime console remains clean', consoleErrors.length === 0 && localHttpErrors.length === 0,
[...localHttpErrors, ...consoleErrors].slice(0, 6).join(' | '));
} finally {
+214
View File
@@ -0,0 +1,214 @@
#!/usr/bin/env node
/**
* Real-app regression: the wheel zooms with an over-depth icon under the
* centre of the canvas. Start a dev server (`npm run dev`), then run this
* file with QA_BASE_URL set to it.
*
* Below 150 km Cesium sizes a zoom step from the depth it picks at the canvas
* centre. An icon drawn over depth must leave nothing there for that pick, or
* the camera takes the icon (a metre away, on the near plane) for the ground
* and stops zooming.
*/
import assert from 'node:assert/strict';
import puppeteer from 'puppeteer';
const origin = process.env.QA_BASE_URL || 'http://localhost:4173';
const CAMERA_HEIGHT_M = 15_000;
const browser = await puppeteer.launch({
headless: true,
args: [
'--no-sandbox',
...(process.platform === 'darwin'
? ['--use-angle=metal', '--enable-gpu']
: [
'--use-gl=angle',
'--use-angle=swiftshader',
'--enable-unsafe-swiftshader',
]),
],
protocolTimeout: 120_000,
});
const errors = [];
try {
const page = await browser.newPage();
page.on('pageerror', (error) => errors.push(error.message));
const viewport = { width: 1200, height: 800 };
await page.setViewport(viewport);
await page.goto(`${origin}/?welcome=0`, { waitUntil: 'domcontentloaded' });
await page.waitForFunction(
() =>
window.__godsEyeView?.viewer &&
window.__godsEyeView.viewer.scene.screenSpaceCameraController
.enableInputs &&
document.getElementById('loading-screen')?.classList.contains('hidden'),
{ timeout: 90_000 },
);
const setup = await page.evaluate(async (cameraHeight) => {
const C = await import('/node_modules/cesium/Build/Cesium/index.js');
const { drawOf } = await import('/src/render/rendererOf.js');
const viewer = window.__godsEyeView.viewer;
const scene = viewer.scene;
viewer.camera.cancelFlight();
viewer.trackedEntity = undefined;
// Explicit real renders make each gesture independent of host frame rate.
viewer.useDefaultRenderLoop = false;
const controller = scene.screenSpaceCameraController;
controller.inertiaZoom = 0;
controller.inertiaSpin = 0;
const lon = -30;
const lat = 40; // open Atlantic: nothing else of the app's draws here
const icons = drawOf(viewer).icons({ id: 'qa-zoom-under-icon' });
const item = {
id: 'qa-icon',
pos: C.Cartesian3.fromDegrees(lon, lat, 100),
// Held in place on the GPU, as a live aircraft or vessel icon is.
motion: { kind: 'hold', courseDeg: 0 },
image: `data:image/svg+xml;charset=utf-8,${encodeURIComponent(
'<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><rect width="64" height="64" fill="#f0f"/></svg>',
)}`,
size: [64, 64],
disableDepthTest: Infinity,
};
const centre = () =>
new C.Cartesian2(
scene.canvas.clientWidth / 2,
scene.canvas.clientHeight / 2,
);
const frame = () => {
scene.requestRender();
viewer.render();
};
const qa = {
height: () => viewer.camera.positionCartographic.height,
setIcon(shown) {
icons.set(shown ? [item] : []);
},
reset() {
viewer.camera.cancelFlight();
viewer.camera.lookAtTransform(C.Matrix4.IDENTITY);
viewer.camera.setView({
destination: C.Cartesian3.fromDegrees(lon, lat, cameraHeight),
orientation: { heading: 0, pitch: -C.Math.PI_OVER_TWO, roll: 0 },
});
frame();
},
async frames(count) {
for (let i = 0; i < count; i++) {
frame();
await new Promise((resolve) => setTimeout(resolve, 0));
}
return qa.height();
},
/** Whether the icon is what a click at the canvas centre picks. */
iconAtCentre() {
const picked = scene.pick(centre());
return JSON.stringify(picked?.id ?? null).includes('qa-icon');
},
/** Metres from the camera to what the depth pick finds at the centre. */
centreDepthM() {
frame();
const point = scene.pickPositionWorldCoordinates(centre());
return point
? C.Cartesian3.distance(point, viewer.camera.positionWC)
: null;
},
};
window.__zoomUnderIconQa = qa;
const gl = scene.context._gl;
const debug = gl.getExtension('WEBGL_debug_renderer_info');
return {
renderer: gl.getParameter(
debug ? debug.UNMASKED_RENDERER_WEBGL : gl.RENDERER,
),
logDepth: scene.logarithmicDepthBuffer,
pickPosition: scene.pickPositionSupported,
};
}, CAMERA_HEIGHT_M);
console.log(
`[INFO] WebGL renderer: ${setup.renderer}; log depth ${setup.logDepth}`,
);
assert.ok(setup.pickPosition, 'the context must support depth picks');
const qa = (method, ...args) =>
page.evaluate(
(name, rest) => window.__zoomUnderIconQa[name](...rest),
method,
args,
);
const x = viewport.width / 2;
const y = viewport.height / 2;
await page.mouse.move(x, y);
/** Wheel `deltaY` at the canvas centre, then the settled camera height. */
const wheel = async (deltaY) => {
await qa('reset');
await page.evaluate(
({ x, y, deltaY }) => {
window.__godsEyeView.viewer.canvas.dispatchEvent(
new WheelEvent('wheel', {
deltaY,
clientX: x,
clientY: y,
bubbles: true,
cancelable: true,
}),
);
},
{ x, y, deltaY },
);
return qa('frames', 40);
};
// The ground alone: what the icon must not change.
await qa('setIcon', false);
await qa('reset');
await qa('frames', 10);
const groundDepth = await qa('centreDepthM');
const groundIn = await wheel(-600);
const groundOut = await wheel(600);
console.log(
`[INFO] no icon: centre depth ${groundDepth?.toFixed(1)} m, wheel in to ${groundIn.toFixed(0)} m, out to ${groundOut.toFixed(0)} m`,
);
assert.ok(groundIn < CAMERA_HEIGHT_M * 0.95, 'control: wheel in zooms in');
assert.ok(groundOut > CAMERA_HEIGHT_M * 1.05, 'control: wheel out zooms out');
await qa('setIcon', true);
await qa('reset');
await page.waitForFunction(
async () => {
await window.__zoomUnderIconQa.frames(1);
return window.__zoomUnderIconQa.iconAtCentre();
},
{ timeout: 30_000 },
);
console.log('[PASS] the icon draws under the canvas centre');
const depth = await qa('centreDepthM');
const zoomedIn = await wheel(-600);
const zoomedOut = await wheel(600);
console.log(
`[INFO] icon at centre: depth pick ${depth === null ? 'finds nothing' : `${depth.toFixed(3)} m away`}, wheel in to ${zoomedIn.toFixed(0)} m, out to ${zoomedOut.toFixed(0)} m`,
);
assert.ok(
depth === null || depth > 100,
`the depth pick must not land on the icon (${depth} m from the camera)`,
);
console.log('[PASS] the depth pick at the centre ignores the icon');
assert.ok(
zoomedIn < CAMERA_HEIGHT_M * 0.95,
`wheel in must zoom in under an icon (height ${zoomedIn.toFixed(1)} m)`,
);
console.log('[PASS] wheel in zooms in');
assert.ok(
zoomedOut > CAMERA_HEIGHT_M * 1.05,
`wheel out must zoom out under an icon (height ${zoomedOut.toFixed(1)} m)`,
);
console.log('[PASS] wheel out zooms out');
assert.ok(await qa('iconAtCentre'), 'the icon must still pick by click');
console.log('[PASS] the icon still picks by click');
assert.deepEqual(errors, [], 'no JavaScript page errors');
console.log('[PASS] no JavaScript page errors');
} finally {
await browser.close();
}