fix(satellites): class choices survive a reload and travel in share links

Only catalog and the tracked satellite were saved for the layer, so a class
chip lasted until the next reload and no share link carried it. The choice
is now the satellites option `classes`: one letter per class shown
(`sitpd` by default, `0` for none), with Starlink left to `catalog`, and
the layer takes the letters back through setParams. A partial request
(`{debris: false}`) hides only what it names.
This commit is contained in:
Sameh Khamis committed 2026-11-08 15:16:01 -08:00
1 parent 8ae56587c3
commit c84cfcadeb
9 files changed
+148 -12

No files matched your search

+35
View File
@@ -970,6 +970,41 @@ test('a direct Context selection promotes its owned tracker layer before persist
coordinator.destroy();
});
test('a satellite class choice is saved, shared and restored', async () => {
const storage = memoryStorage();
const manager = productionManager();
const coordinator = new LayerStateCoordinator(manager, shareSink(), {
storage,
});
await coordinator.start();
await manager.setEnabled('satellites', true, { origin: 'user' });
assert.equal(
coordinator.getDurableState().options.satellites.classes,
'sitpd',
'every class but Starlink by default',
);
manager.setLayerParams(
'satellites',
{ classes: { debris: false } },
{ origin: 'user' },
);
const durable = coordinator.getDurableState();
assert.equal(durable.options.satellites.classes, 'sitp');
assert.equal(
new URLSearchParams(encode(durable)).get('lo')?.includes('s.k.sitp'),
true,
);
coordinator.destroy();
// A reload hands the layer its letters back (the layer decodes them:
// src/data/satelliteClass.test.mjs).
const reloaded = productionManager();
const next = new LayerStateCoordinator(reloaded, shareSink(), { storage });
await next.start();
assert.equal(reloaded.getLayerParams('satellites')?.classes, 'sitp');
next.destroy();
});
test('explicit Flight to Satellite replacement keeps the new Satellite ID durable', async () => {
const manager = productionManager();
const coordinator = new LayerStateCoordinator(manager, shareSink(), {