Idle frame rate in the app, timed line batching, KEY REQUIRED status

Three fixes to how the globe draws and reports loading.

**The idle frame rate is the app's rule.** The Cesium frame port capped the loop at `IDLE_FRAME_RATE` whenever nothing held it, so the rule lived inside the renderer. The render governor now sets the rate: the display's own while the loop is held, `IDLE_FRAME_RATE` while not. The frame port gains `onHeldChange(cb)`, which says when its first hold is taken and its last released (animated visual styles included), so the governor hears every hold. The quality setting's frame-rate cap is kept apart from the governor's rate, and the loop draws at the lower of the two, so neither overwrites the other.

**Line batching is timed.** A line set waited 30 drawn frames before its unchanged lines settled into a static batch (300 for the long wait), so the batch built twice as fast at 120 Hz as at 60 Hz, and took seconds at the idle rate. It now waits `SETTLE_MS` (500 ms) and `LONG_SETTLE_MS` (5 s), and moved shapes go back into their batches on the same timing.

**KEY REQUIRED.** A layer that cannot load without a provider key ended the global status chip LOAD FAILED. The chip now has a KEY REQUIRED outcome, ranked below a real failure: a layer whose stats say `keyRequired` ends KEY REQUIRED, any other failure still ends LOAD FAILED. Vessels report a missing AISStream key as `keyRequired` and name the key in the panel; a later outage clears it, as it is no longer the key that is missing.

Checked: the full suite (new tests for `onHeldChange`, the quality cap against the governor's rate, timed settling, and the chip with and without a key), format, boundaries, build, the stub renderer boot and the Cesium conformance run; in the browser, the idle and held frame rates; and the first-run check now asserts that with no keys set the chip never says LOAD FAILED.
This commit is contained in:
Sameh Khamis committed 2026-11-16 14:10:01 -08:00
1 parent 84d3e7b5ce
commit 0ed6cde956
33 files changed
+629 -179

No files matched your search

+10 -8
View File
@@ -386,8 +386,13 @@ test('one ESC does one thing — a Cockpit utility disclosure stops later docume
// they own the same contract: their capture handler is the only one that can
// keep a later document listener (Cockpit exit, the launcher) off the key, and
// only the immediate form does it.
const utilityEsc = ui.slice(ui.indexOf('if (!displayOpen && !radioOpen) return;'));
const claim = utilityEsc.slice(0, utilityEsc.indexOf('setCockpitDisclosure(kind, false'));
const utilityEsc = ui.slice(
ui.indexOf('if (!displayOpen && !radioOpen) return;'),
);
const claim = utilityEsc.slice(
0,
utilityEsc.indexOf('setCockpitDisclosure(kind, false'),
);
assert.match(claim, /event\.preventDefault\(\);/);
assert.match(claim, /event\.stopImmediatePropagation\(\);/);
assert.doesNotMatch(
@@ -606,11 +611,8 @@ test('the tile is the FULLY CONFIGURED experience: quakes and fires together', (
const environmental = FIRST_RUN_MISSIONS.environmental;
assert.deepEqual(environmental.layerIds, ['earthquakes', 'local-firms']);
// Keyless, the honest surface is the LAYER ROW ("KEY REQUIRED"), which the
// FIRMS layer already reports. The misleading part is the GLOBAL chip folding
// that row into LOAD FAILED — a defect in the shared state machine, ledgered
// post-launch, and the note must stay where the next editor will read it
// rather than being re-discovered as a launcher bug.
// Keyless, FIRMS says so on its layer row and in the global chip (both
// KEY REQUIRED), and the note says where the chip's ending comes from.
const module = fs.readFileSync(
new URL('./firstRunExperience.js', import.meta.url),
'utf8',
@@ -621,7 +623,7 @@ test('the tile is the FULLY CONFIGURED experience: quakes and fires together', (
);
assert.match(table, /KEY REQUIRED/);
assert.match(table, /src\/loadingFeedback\.js/);
assert.match(table, /LEDGERED post-launch/);
assert.match(table, /global status chip\s+\/\/\s+ends KEY REQUIRED/);
});
test('every visitor gets the same tile — there is no degraded keyless variant', async () => {