Fix the follow-up review findings in import, layers, startup and engines

- KML/KMZ import: a per-file canvas budget and cache for ground overlays,
  limits on rings and vertices of raised polygons, overlays across 360° and
  near the poles, degenerate holes, polar and single-latitude fills,
  absolute overlays at their altitude, overlay order by drawOrder as on
  Cesium, and pins on tiles keep their measured height.
- Points on the surface: OSM Places and Street Level cones share the
  surface sampler and sit on the terrain before they are measured, within
  a sampling budget per pass; Cockpit's contact-dot bank keeps the dot
  atlas, and a failed fleet model loads again after a pause.
- Startup: the loading screen lifts after the share-link view is restored,
  the retry screen names the failed engine and takes focus, and the
  fallback toast stays for 6 s.
- Engines: an engine switch lands a running camera flight at its
  destination (camera.completeFlight on both engines), the sighting card
  leaves focus on the engine picker after a switch, and a Cesium model
  error stays with the instance that failed.
- The MCP panel builds again: its wind-mesh alias resolves to the stub.
- QA: the wildlife switch waits for the camera to rest, GBFS --w2 says it
  needs the dev server, and test fixtures are shared instead of copied.
This commit is contained in:
German Khokhlov committed 2026-11-10 01:57:11 +04:00
1 parent 0ef29781e5
commit 60fb8fee07
82 files changed
+2363 -1574

No files matched your search

+38 -2
View File
@@ -3211,7 +3211,7 @@ test('Bhote Koshi republishes its evidence cards to the incoming engine overlay'
// The event on a Navara engine double: its surface samples the terrain at
// its finest level (or fails to), and its loaded terrain answers `terrain`.
async function navaraEvidenceCard({ sample }) {
async function navaraEvidenceCard({ sample, signal }) {
const event = JSON.parse(await readFile(eventUrl, 'utf8'));
installEventDom();
globalThis.window = { setTimeout: () => 1, clearTimeout() {} };
@@ -3251,7 +3251,7 @@ async function navaraEvidenceCard({ sample }) {
renderHost: { request() {}, hold() {}, release() {} },
});
await layer.init(null, { engine });
await layer.enable(null, { origin: 'local-restore' });
await layer.enable(null, { origin: 'local-restore', signal });
const [first] = event.evidenceSpine;
const card = entries.find(
(entry) => entry.id === `evidence-card-${first.id}`,
@@ -3281,6 +3281,42 @@ test('Navara evidence anchors stand on the most detailed terrain', async () => {
}
});
test('Navara evidence sampling stops waiting when enable is cancelled', async () => {
const originalDocument = globalThis.document;
const originalWindow = globalThis.window;
const controller = new AbortController();
const started = Promise.withResolvers();
const sample = Promise.withResolvers();
const enabling = navaraEvidenceCard({
signal: controller.signal,
sample: () => {
started.resolve();
return sample.promise;
},
});
let timer;
try {
await started.promise;
controller.abort();
const outcome = await Promise.race([
enabling.then(
() => 'enabled',
(error) => error.name,
),
new Promise((resolve) => {
timer = setTimeout(() => resolve('still waiting'), 100);
}),
]);
assert.equal(outcome, 'AbortError');
} finally {
clearTimeout(timer);
sample.resolve([]);
await enabling.catch(() => {});
globalThis.document = originalDocument;
globalThis.window = originalWindow;
}
});
test('Navara evidence anchors without a terrain sample follow the terrain near the camera', async () => {
const originalDocument = globalThis.document;
const originalWindow = globalThis.window;