Move geo import, voice capture, visual settings, scope mask and recent imagery onto the renderer ports

Geo import asks the frame port for renders, the camera port for moveEnd and
the globe port's progress for the terrain queue running dry; its data sources
are added, removed and shown by the listed geoImportPins module. Voice capture
waits on the frame port's postRender. Visual settings toggle the infrared fog
through the globe sky port, and the anime style dims the Milky Way through a
sky getter it is given. The scope mask reads the camera height and listens on
the frame and camera ports. Recent imagery picks the view centre, reads the
view rectangle and the field of view through the query and camera ports.
Installations claim camera sensitivity from their rendering module. The
application shell loads the unbound globe factory.
This commit is contained in:
Sameh Khamis committed 2026-11-07 18:10:39 -08:00
1 parent b19fa56565
commit 81d8e3a4a7
20 files changed
+308 -119

No files matched your search

+13 -3
View File
@@ -2,6 +2,8 @@
// These helpers are DOM/WebRTC-free so they pin the screenshot down-scaling and
// payload-byte estimation that keep an oversized dc.send from stranding a turn.
import { test } from 'node:test';
import { bindRenderer } from '../render/rendererOf.js';
import { fakeSceneFrame } from '../testSupport/fakeCesiumScene.mjs';
import assert from 'node:assert/strict';
import { DataLayerManager } from '../data/manager.js';
import { controlRadio as runControlRadio, createGevActionRunner as createActionRunner } from './gevActions.js';
@@ -36,6 +38,14 @@ import {
import { createVoiceCostTracker } from './voiceCost.js';
import { createTestVoiceUi } from '../testSupport/voiceUi.mjs';
/** A viewer over `scene` whose renderer's frame port is the scene's own loop. */
function framed(scene) {
const viewer = { scene };
bindRenderer(viewer, { frame: fakeSceneFrame(viewer) });
return viewer;
}
test('push-to-talk recognizes Space by code or key', () => {
assert.equal(PUSH_TO_TALK_HOLD_DELAY_MS, 500);
assert.equal(isPushToTalkKey({ code: 'Space', key: 'Unidentified' }), true);
@@ -2811,7 +2821,7 @@ test('hidden document yields no fresh frame — capture must not label a stale c
};
try {
globalThis.document = { hidden: true };
const fresh = await renderFreshCesiumFrame({ scene });
const fresh = await renderFreshCesiumFrame(framed(scene));
assert.equal(fresh, false, 'hidden capture reports non-fresh');
assert.equal(requested, 0, 'no secret render restart while hidden');
} finally {
@@ -2828,7 +2838,7 @@ test('visible document with a rendering scene reports a fresh frame', async () =
postRender: { addEventListener(listener) { fire = listener; return () => { fire = null; }; } },
requestRender() { queueMicrotask(() => fire?.()); },
};
const fresh = await renderFreshCesiumFrame({ scene });
const fresh = await renderFreshCesiumFrame(framed(scene));
assert.equal(fresh, true);
} finally {
globalThis.document = originalDocument;
@@ -2845,7 +2855,7 @@ test('a tab switch during the bounded render wait invalidates freshness', async
postRender: { addEventListener(listener) { fire = listener; return () => { fire = null; }; } },
requestRender() { doc.hidden = true; queueMicrotask(() => fire?.()); },
};
const fresh = await renderFreshCesiumFrame({ scene });
const fresh = await renderFreshCesiumFrame(framed(scene));
assert.equal(fresh, false, 'freshness rechecked after the await');
} finally {
globalThis.document = originalDocument;