Merge origin/main: shipwrecks, news, transit fronts, signal-lost trails and uncredited photos on the renderer's ports

Upstream's layers and changes are carried onto the ports, with no Cesium
outside src/render and no reach into the viewer:

- Shipwrecks draw as one icon set, clicked through the input dispatcher.
- News draws through draw sets, the camera port and the input dispatcher;
  its beacons pulse each frame through the frame port.
- The scene occlusion probe moves into src/render/cesium and reaches
  detection through a new application hook, createOcclusionProbe; its
  private Cesium reads go through internals.js.
- Flight and military trails, the stale and SIGNAL LOST cue, coasting and
  following the world clock run on the draw and frame ports. GPU icons
  follow the scene clock while the world clock is followed, and fade when
  stale. A report that holds is not planned again every tick.
- Vessels are keyed by their record id.

The stub boot now enables military, shipwrecks and news as well.
This commit is contained in:
Sameh Khamis committed 2026-11-10 20:03:28 -08:00
commit a755f63638
331 files changed
+40654 -1666

No files matched your search

+36 -15
View File
@@ -1,5 +1,6 @@
import { isFollowing, stopFollowing } from '../data/followed.js';
import { interruptGlobeRotation } from '../cameraVerbs.js';
import { normalizeDisplayText } from '../data/displayText.js';
import {
layerSnapshot,
feedProvenanceEnvelope,
@@ -2839,7 +2840,7 @@ async function trackEntity(
() => {
let trackedOk = false;
if (family.kind === 'vessel') {
trackedOk = !!module.selectById?.(found.mmsi);
trackedOk = !!module.selectById?.(found.id ?? found.mmsi);
flyToLandmark(viewer, found.latitude, found.longitude, {
range: 6000,
pitch: -45,
@@ -4040,8 +4041,13 @@ function locateLayerEntity(dataManager, { layerId, id, lat, lon }) {
?.module?.getAnalystRecords?.()
.filter(
(item) =>
String(item.icao24 ?? item.mmsi ?? item.noradId ?? item.id) ===
String(id),
String(
item.icao24 ??
item.vesselId ??
item.mmsi ??
item.noradId ??
item.id,
) === String(id),
) || [];
// Bikeshare uses station names as IDs: retain the coordinate identity
// even if a namesake disappears. Moving records use their fresh fix.
@@ -5086,13 +5092,7 @@ function uniqueStrings(values) {
* @returns {string} Sanitized single-line label (max 120 chars).
*/
function sanitizeLabel(value) {
const text = String(value || '');
let out = '';
for (const ch of text) {
const code = ch.codePointAt(0);
out += code < 0x20 || code === 0x7f ? ' ' : ch; // drop control chars incl. newlines
}
return out.replace(/\s+/g, ' ').trim().slice(0, 120);
return normalizeDisplayText(value, 120);
}
function cachePrecision(service) {
@@ -5208,10 +5208,8 @@ function compactProperties(props) {
}
function cleanText(value) {
if (value == null || typeof value === 'object') return '';
const text = String(value).trim();
if (!text || text === 'undefined' || text === 'null') return '';
return text.length > 180 ? `${text.slice(0, 177)}...` : text;
const text = normalizeDisplayText(value);
return text === 'undefined' || text === 'null' ? '' : text;
}
function layerTitle(layerId) {
@@ -5367,6 +5365,7 @@ function cameraViewBox(viewer) {
/** Identity fields every compact analyst item keeps when present. */
const ANALYST_IDENTITY_FIELDS = Object.freeze([
'icao24',
'vesselId',
'mmsi',
'registration',
'label',
@@ -5375,12 +5374,29 @@ const ANALYST_IDENTITY_FIELDS = Object.freeze([
'noradId',
]);
/**
* Keys that identify an analyst record. The referent registry, track_entity,
* locateLayerEntity and follow-up filters match on them, so they skip
* display-text normalization.
*/
const ANALYST_CANONICAL_FIELDS = new Set([
'layerKey',
'id',
'icao24',
'vesselId',
'mmsi',
'noradId',
'registration',
'callsign',
'routeId',
]);
/**
* Compact one analyst record for the voice payload: identity, position (so a
* follow-up can fly to it), distance, and that layer's manifest fields with
* times as ISO text. The full record set stays engine-side for follow-ups.
*
* `icao24`/`mmsi` ride along because the tool instructions tell the model to
* `icao24`/`vesselId`/`mmsi` ride along because the tool instructions tell the model to
* hand this result straight to track_entity, and `id` is a DISPLAY label
* (callsign, else registration, else hex). A callsign-less contact therefore
* handed track_entity a tail number the lookup could not resolve, and the
@@ -5412,6 +5428,11 @@ function compactAnalystItem(r) {
} else compact[key] = r[key];
}
if (present(r.ageHours)) compact.ageHours = r.ageHours;
// Canonical keys stay raw: bikeshare's id is the raw station name.
for (const key of Object.keys(compact)) {
if (typeof compact[key] === 'string' && !ANALYST_CANONICAL_FIELDS.has(key))
compact[key] = normalizeDisplayText(compact[key]);
}
return compact;
}