Rebuild the Context panel around the selected item and the view

Clicking anything a layer can identify opens one card in Context: a hero
tile (route globe and 3D model for a flight, the camera for CCTV, headline
figures otherwise), its facts, actions with Cockpit or the orbital view as
the primary one, and a standard set of nearby blocks (weather and local
time, flights, vessels, hazards, alerts) within one radius the user sets.
Aircraft show altitude as a graph. Things that move are followed when
picked, and a card closes when its layer is turned off.

With nothing selected the panel describes the view: the layers that are on
with a breakdown of what each holds, the camera's height, what is in view,
then time, weather and local news. From far out it shows worldwide counts
per layer. A search field in the header narrows whatever the panel shows.

Prototype. Context reads weather and hazard feeds while its panel is closed,
the two 3D previews on a flight card repaint continuously, Follow can show
pressed after tracking has ended elsewhere, and most new strings are fixed
English. Same-named sites are told apart by position, not by a stable id.
This commit is contained in:
Manjunath Paparaju authored and Sameh Khamis committed 2026-11-16 14:58:53 -08:00
1 parent f7f18c2823
commit cc83763452
21 files changed
+6595 -1

No files matched your search

+32
View File
@@ -246,6 +246,19 @@ export function createQueries({
* routeDestination: string|null}}
*/
/** An airport at one end of a route, when it has a position. */
function routeEnd(airport) {
const lat = Number(airport?.lat ?? airport?.latitude);
const lon = Number(airport?.lon ?? airport?.longitude);
if (!Number.isFinite(lat) || !Number.isFinite(lon)) return null;
return {
code: String(airport?.code ?? '').trim() || null,
name: String(airport?.name ?? airport?.municipality ?? '').trim() || null,
lat,
lon,
};
}
function mapAnalystRecord(
icao24,
info,
@@ -293,6 +306,16 @@ export function createQueries({
lastContactAtMs: num(info?.lastContactEpochMs),
routeOrigin: routeOk ? text(info?.route?.origin?.code) : null,
routeDestination: routeOk ? text(info?.route?.destination?.code) : null,
// The airports themselves, for the context card's route globe.
routeFrom: routeOk ? routeEnd(info?.route?.origin) : null,
routeTo: routeOk ? routeEnd(info?.route?.destination) : null,
// The scheduled route when it does not fit where the plane is (often
// another leg of the same flight number): the card shows it marked
// unverified, everything else still treats the flight as routeless.
routeScheduled:
!routeOk && info?.route?.origin?.code && info?.route?.destination?.code
? { from: text(info.route.origin.code), to: text(info.route.destination.code) }
: null,
};
}
const methods = {
@@ -748,6 +771,15 @@ export function createQueries({
return result;
},
/**
* Ask for an aircraft's scheduled route (origin and destination airports),
* as tracking does; it lands on the record when the lookup answers.
* @param {string} icao24
*/
requestRoute(icao24) {
if (icao24) parts.enrichment._requestRouteEnrichment(String(icao24).trim().toLowerCase());
},
/**
* Start camera-tracking an aircraft by ICAO24 address.
* @param {string} icao24 - ICAO 24-bit transponder address.