fix(satellites): every class but Starlink shows by default

Showing only Stations and Imaging by default hid GPS, GEO comsats, Hubble
and the rest of what the layer showed before classes, for every existing
user and saved view. Every class now starts on except Starlink, which stays
off as the DENSE switch was.
This commit is contained in:
Sameh Khamis committed 2026-11-08 15:16:01 -08:00
1 parent 63e6338c19
commit d404445da3
5 files changed
+26 -18

No files matched your search

+16 -11
View File
@@ -412,7 +412,7 @@ test('a dependency owner hiding the points surrenders the whole row', async () =
}
});
test('stations and imaging show by default; each class chip turns its class on and off', async () => {
test('every class but Starlink shows by default; each class chip turns its class on and off', async () => {
const originalFetch = globalThis.fetch;
const log = console.log;
const warn = console.warn;
@@ -434,35 +434,40 @@ test('stations and imaging show by default; each class chip turns its class on a
text: async () => served[String(url)] || '',
});
await satellitesLayer.update({ scene: { primitives: { add: (p) => p, remove() {} } } });
assert.deepEqual(shown(), [25544, 40002], 'stations and imaging only');
assert.deepEqual(shown(), [25544, 40001, 40002, 40003], 'all but Starlink');
assert.deepEqual(
satellitesLayer.getRowControls().chips.map((entry) => entry.label),
['STATIONS', 'IMAGING', 'TELECOM', 'STARLINK', 'PROBES', 'DEBRIS'],
);
assert.equal(chip('imaging').active, true);
assert.equal(chip('telecom').active, false);
assert.deepEqual(chip('telecom').params, { classes: { telecom: true } });
assert.equal(chip('telecom').active, true);
assert.equal(
satellitesLayer.getRowControls().chips.find((entry) => entry.id === 'catalog').active,
false,
);
assert.deepEqual(chip('telecom').params, { classes: { telecom: false } });
assert.deepEqual(
satellitesLayer.getRowControls().legend.map((row) => row.klass),
['stations', 'imaging'],
['stations', 'imaging', 'telecom', 'debris'],
'the legend keys only what is on screen',
);
satellitesLayer.setParams(chip('telecom').params);
satellitesLayer.setParams(chip('debris').params);
assert.deepEqual(shown(), [25544, 40001, 40002, 40003]);
assert.equal(chip('debris').active, true);
assert.deepEqual(shown(), [25544, 40002], 'telecom and debris off');
assert.equal(chip('debris').active, false);
assert.deepEqual(satellitesLayer.getParams().classes, {
stations: true,
imaging: true,
telecom: true,
telecom: false,
starlink: false,
probes: false,
debris: true,
probes: true,
debris: false,
});
satellitesLayer.setParams(chip('telecom').params);
satellitesLayer.setParams(chip('imaging').params);
assert.deepEqual(shown(), [25544, 40001, 40003], 'imaging off');
assert.deepEqual(shown(), [25544, 40001], 'telecom back on, imaging off');
assert.equal(satellitesLayer.setParams({ classes: 'all' }), false, 'malformed request refused');
} finally {
console.log = log;
+7 -4
View File
@@ -39,14 +39,17 @@ export const SATELLITE_CLASS_IDS = Object.freeze([
'debris',
]);
/** Which classes show when nobody has chosen. */
/**
* Which classes show when nobody has chosen: everything the layer showed
* before classes existed. Starlink stays off, as the DENSE switch was.
*/
export const DEFAULT_SATELLITE_CLASSES = Object.freeze({
stations: true,
imaging: true,
telecom: false,
telecom: true,
starlink: false,
probes: false,
debris: false,
probes: true,
debris: true,
});
/**
+1 -1
View File
@@ -32,7 +32,7 @@ test('six classes, with stations and imaging on by default and the rest off', ()
]);
assert.deepEqual(
SATELLITE_CLASS_IDS.filter((id) => DEFAULT_SATELLITE_CLASSES[id]),
['stations', 'imaging'],
['stations', 'imaging', 'telecom', 'probes', 'debris'],
);
for (const id of SATELLITE_CLASS_IDS) {
const display = SATELLITE_CLASS_DISPLAY[id];