Satellite class pills use readable body-size text

The class pills' text was the chips' 8px dim mono. It is now the row's
body text: the layer name's 13px size and full-contrast colour, on or off.
The accent border and fill still mark a class that is on, and the swatch
grows to match. Measured in the panel, the pill text is 12.7:1 to 15.3:1
against its background, from about 2.9:1 before.

Each class chip is marked `keyed`, so it keeps that text while off, when it
carries no swatch or count.
This commit is contained in:
Sameh Khamis committed 2026-11-23 18:52:55 -08:00
1 parent d1ea26ab92
commit b4ffc49ef8
6 files changed
+45 -16

No files matched your search

+1 -1
View File
@@ -7819,7 +7819,7 @@ silently demoting every later lookup for the session.
- **Satellites**: core catalog from CelesTrak's stations, visual, GPS, GLONASS, Galileo, GEO, resource, weather, planet, SAR and science groups, tracking lands ~726km out via `viewFrom` (tracked entity owns a point graphic so the tracking camera engages), rings realign via primitive modelMatrix (no per-second rebuild flicker), optional `setParams({catalog:'dense'})` Starlink mode.
- **Satellite classes** (`src/layers/satellites/classes.js`): every satellite is filed under one of six classes, each with its own point colour and toggle chip (the chip shows the colour while the class is on): STATIONS (warm white), IMAGING (cyan), TELECOM (violet; communications and navigation, so GPS, GLONASS, Galileo and BeiDou read as one family), STARLINK (dim slate), PROBES (muted blue-gray) and DEBRIS (receding brown-gray). That module is the single source of truth for class, label and colour, so the dot, the card and the chip's swatch cannot disagree. Two deliberate palette rules: no class may sit in the 40–48° amber band, which is the app-wide known-military convention; and STARLINK stays far below PROBES in Rec.601 luminance so the dense shell stays separable when NVG/FLIR collapse the scene to one channel. The ISS keeps its long-standing red hero dot rather than the STATIONS colour — it carries a permanent name label and its card still reads `STATIONS · ISS`; it is a station whichever group ingested it, so a stations-feed outage cannot refile it. `src/data/satelliteClass.js` keeps the group-based labels beneath the classes: the constellation subtype and a group's own label for a satellite with no class. The tracked satellite's dot keeps that colour too: tracking draws it larger (14 px), white-outlined and over everything, never in another colour (`_addTrackedEntity`, `src/layers/satellites/rendering.js`).
- Class is also a **text field**, not just a color: `TELECOM · GPS` / `STARLINK` / `STATIONS · ISS` leads the tracked card's detail block and replaces the raw CelesTrak tag on the detection-overlay label. Because that canvas composites above the post-FX chain, the class stays readable in NVG/FLIR after the in-scene dot colors are flattened.
- The satellites row in DATA LAYERS carries per-layer sub-controls (`DataLayerManager._syncRowControls`, the first consumer of the optional `getRowControls()` layer hook): one chip per class (the STARLINK chip exposes the existing `catalog` param); a class that is on shows its point colour, its name and its live count in its chip (`swatch` and `count`, drawn by `src/ui/rail/RailChips.vue`), and a class that is off shows only its name; and an info line while SATCAT is stale or unavailable (`Classes may lag: SATCAT is a cached copy` / `Classes may lag: SATCAT unavailable`). Default is the sparse core catalog. The chips are stateless — each declares the params to apply and the manager owns the write — so the Space Missions capture/restore path over the same param stays authoritative. Controls stay hidden while the layer is off. An explicit CORE or DENSE choice participates in versioned local and share-link state; temporary Space Missions overrides do not.
- The satellites row in DATA LAYERS carries per-layer sub-controls (`DataLayerManager._syncRowControls`, the first consumer of the optional `getRowControls()` layer hook): one chip per class (the STARLINK chip exposes the existing `catalog` param); a class that is on shows its point colour, its name and its live count in its chip (`swatch` and `count`, drawn by `src/ui/rail/RailChips.vue`), and a class that is off shows only its name. The chip text is the row's body text (the layer name's 13 px size and full-contrast colour) whether the class is on or off; the accent border and fill mark a class that is on. There is also an info line while SATCAT is stale or unavailable (`Classes may lag: SATCAT is a cached copy` / `Classes may lag: SATCAT unavailable`). Default is the sparse core catalog. The chips are stateless — each declares the params to apply and the manager owns the write — so the Space Missions capture/restore path over the same param stays authoritative. Controls stay hidden while the layer is off. An explicit CORE or DENSE choice participates in versioned local and share-link state; temporary Space Missions overrides do not.
- **Class toggles** (`src/layers/satellites/classes.js`): the layer row carries one chip per class — STATIONS, IMAGING, TELECOM (communications and navigation), PROBES (science, technology development and demonstration, unknown purpose) and DEBRIS (rocket bodies, fragments, unknown objects launched before last year and dead payloads) on by default, so the layer shows what it did before classes; STARLINK off, as DENSE was. Points of a hidden class stay built and are only hidden, so a toggle needs no reload; hidden classes are left out of the detection overlay, the voice/framing position lists and analyst answers (the tracked satellite still answers), and only the chips of classes on screen carry a colour and a count; an on class with nothing loaded shows its colour without a count. The class comes, strongest evidence first, from CelesTrak SATCAT (object type and operational status, fetched per group through `/api/celestrak-satcat/<group>`, cached a day by the proxy; the layer keeps a current read six hours rather than asking on every five-minute update), the bundled UCS Satellite Database pack (UCS-Satellite-Database 5-1-2023: operator, owner country and purpose; `src/data/local_data/ucs_satellites/`), name patterns for satellites launched after May 2023, and finally the CelesTrak groups the TLE came in (a mission group such as `weather` before the orbit group `geo`; a UCS purpose of "Unknown" counts as none). Only crewed stations and the craft that visit them, by name, are STATIONS: the CubeSats CelesTrak's stations group also carries after their deployment from the ISS are classed like any other satellite. A payload whose SATCAT record gives no status, with no UCS record and no recognisable name, that launched 20 or more years ago (SATCAT's launch date, else the TLE designator's year) is presumed dead and filed as debris; without a SATCAT record (a failed read) nothing is presumed. To cover imaging launched after the UCS snapshot the core catalog also reads CelesTrak's `resource`, `weather`, `planet`, `sar` and `science` groups. Debris can be tracked but is never ridden: the orbital entry gate (`orbitEntryAllowed`) refuses it, so no ORBIT entry is offered and double-click does nothing for it. Retired stations and the shuttles have re-entered and have no orbit to show. An explicit class choice is kept in local and share-link state as the `classes` option, one letter per class shown (`sitpd`: stations, imaging, telecom, probes, debris; `0`: none; `src/data/satelliteClassMask.js`), and the layer takes those letters back through `setParams({classes})`; STARLINK maps to the existing `catalog: 'dense'` param instead.
- The satellite Cockpit subject (`getCockpitSubject()`) also carries `satelliteClass`, `cosparId` (from SATCAT, else TLE line 1), `tle` (`{line1, line2, epochMs}`), `owner` (`{countryCode, label}`: ISO 3166-1 alpha-2 for a single country, `null` code for organisations such as ESA, EUMETSAT or Intelsat and for joint owners) and `operator` (UCS; SpaceX for Starlink). UCS names the operator's country and wins over the SATCAT owner code; CelesTrak's CIS (former USSR) is filed under Russia.
- **The STARLINK chip (formerly DENSE) reports the dense LOAD, not the catalog param.** The param flips synchronously while the Starlink shell takes seconds to arrive over a chunked load, and CelesTrak 502s that feed regularly. So the chip reads `STARLINK ···` (busy, disabled) while loading, ACTIVE only once dense points are actually on screen, and `STARLINK ✕` with the reason on hover when the load fails — a failure also reverts `catalog` to `core`, drops any partial chunk, and leaves the chip clickable to retry. A load is judged by points added, not by HTTP status: a 200 carrying an empty body, a passed-through HTML error page, or only TLEs the core catalog already owns fails with the same revert semantics as a 502. Any explicit request for `core` clears a latched error even when the mode does not change, so a Space Missions restore of an already-core snapshot never leaves the user with a failure they did not cause. Because the load settles asynchronously, the layer pushes a re-render through the optional `setRowControlsListener()` hook; nothing else would repaint that row before the 5-minute catalog refresh, so the counts would otherwise sit stale.
+4
View File
@@ -452,6 +452,10 @@ test('every class but Starlink shows by default; each class chip turns its class
// point colour and its count beside its name, an off one only its name.
const controls = satellitesLayer.getRowControls();
assert.equal(controls.legend, undefined, 'no separate list of counts');
assert.ok(
controls.chips.every((entry) => entry.keyed === true),
'every class chip, on or off, is a keyed chip',
);
assert.deepEqual(
controls.chips.map((entry) => [entry.id, entry.swatch, entry.count]),
[
+5 -3
View File
@@ -712,7 +712,7 @@ export function createControls({ state: layerState, services, parts, source }) {
/**
* Layer-row sub-controls (DataLayerManager row-controls contract): one
* toggle chip per satellite class (src/layers/satellites/classes.js). A
* keyed toggle chip per satellite class (src/layers/satellites/classes.js). A
* class that is on carries its point colour (`swatch`) and, once any of
* it is loaded, its count, so the point colours are learnable; a class
* that is off carries only its name.
@@ -752,8 +752,10 @@ export function createControls({ state: layerState, services, parts, source }) {
title: t(SATELLITE_CLASS_DISPLAY[id].blurb),
params: { classes: { [id]: classes[id] !== true } },
};
// The colour key and count ride on a class that is on; an off
// class is its name alone.
// Every class chip is a keyed chip, so its name reads the same on
// or off. The colour key and count ride on a class that is on; an
// off class is its name alone.
chip.keyed = true;
if (!chip.active) return chip;
chip.swatch = SATELLITE_CLASS_DISPLAY[id].color;
if (counts[id] > 0) chip.count = counts[id];
+6 -2
View File
@@ -288,6 +288,7 @@ test('a keyed chip carries its swatch and count while on, only its name while of
id: 'class-imaging',
label: 'IMAGING',
active: true,
keyed: true,
swatch: '#4fd8ff',
countText: '1.2K',
};
@@ -316,7 +317,9 @@ test('a keyed chip carries its swatch and count while on, only its name while of
render(
h(LayerRows, {
items: [
classRow([{ id: 'class-imaging', label: 'IMAGING', active: false }]),
classRow([
{ id: 'class-imaging', label: 'IMAGING', active: false, keyed: true },
]),
],
}),
container,
@@ -326,7 +329,8 @@ test('a keyed chip carries its swatch and count while on, only its name while of
assert.equal(off.textContent, 'IMAGING');
assert.equal(off.querySelector('.data-toggle-chip-swatch'), null);
assert.equal(off.querySelector('.data-toggle-chip-count'), null);
assert.equal(off.classList.contains('chip-keyed'), false);
// Still a keyed chip, so its name keeps the same readable text.
assert.equal(off.classList.contains('chip-keyed'), true);
assert.equal(container.querySelector('.data-toggle-legend-item'), null);
render(null, container);
});
+7 -5
View File
@@ -5,16 +5,17 @@ import UiIcon from '../kit/UiIcon.vue';
// Keyed chips shared by rail cards; the owner decides what a click does.
// An `icon` chip shows a Material Symbol (named in index.html's `icon_names`
// subset) with its label as the accessible name and tip; an `action` chip
// (Zoom, Remove) is a plain button, not an on/off toggle. A `swatch` chip
// (a CSS colour) keys what it turns on: the colour before its label and, with
// `countText`, how many after it; the owner leaves both off a chip that is off.
// (Zoom, Remove) is a plain button, not an on/off toggle. A `keyed` chip
// keys what it turns on in body-size, full-contrast text: with `swatch` (a CSS
// colour) the colour before its label and, with `countText`, how many after
// it; the owner leaves both off a chip that is off.
defineProps({
chips: { type: Array, default: () => [] },
onSelect: { type: Function, default: () => {} },
});
const chipClass = (chip) =>
`data-toggle-chip chip-${chip.state || (chip.active ? 'active' : 'idle')}${chip.icon ? ' chip-icon' : ''}${chip.swatch && !chip.icon ? ' chip-keyed' : ''}`;
`data-toggle-chip chip-${chip.state || (chip.active ? 'active' : 'idle')}${chip.icon ? ' chip-icon' : ''}${chip.keyed && !chip.icon ? ' chip-keyed' : ''}`;
</script>
<template>
@@ -33,8 +34,9 @@ const chipClass = (chip) =>
:aria-busy="String(Boolean(chip.busy))"
@click="onSelect(chip)"
><UiIcon v-if="chip.icon" :name="chip.icon" :size="null" /><template
v-else-if="chip.swatch"
v-else-if="chip.keyed"
><span
v-if="chip.swatch"
class="data-toggle-chip-swatch"
aria-hidden="true"
:style="{ background: chip.swatch }"
+22 -5
View File
@@ -942,18 +942,35 @@ html:not([lang='en'])
background: var(--accent-dim);
}
/* A keyed chip (RailChips.vue `swatch`): the colour of what it turns on before
its label and the count after it, while it is on. Off, it is a plain chip. */
/* A keyed chip (RailChips.vue `keyed`): the colour of what it turns on before
its label and the count after it, while it is on; off, its name alone. Its
text is the row's body text (.data-name's size and colour), on or off, so
the key reads at a glance; on and off differ by the accent border and fill. */
.data-toggle-chip.chip-keyed {
display: inline-flex;
align-items: center;
gap: 4px;
gap: 5px;
padding: 3px 8px;
font-family: var(--font-sans);
font-size: 13px;
font-weight: 500;
letter-spacing: 0.3px;
color: var(--text-primary);
}
.data-toggle-chip.chip-keyed:hover,
.data-toggle-chip.chip-keyed:focus-visible,
.data-toggle-chip.chip-keyed.active {
color: var(--text-primary);
}
.data-toggle-chip.chip-keyed .data-toggle-chip-swatch {
width: 8px;
height: 8px;
}
.data-toggle-chip-count {
font-variant-numeric: tabular-nums;
letter-spacing: 0.5px;
opacity: 0.75;
}
/* Async sub-controls: a chip must never read ACTIVE before the data it turns