fix(recent-imagery): keep a slot's halves in place when its probe changes them

- A probe that narrows or widens a dateline slot keeps the layer of the half
  that stays; a new half is inserted right above it, so in A/B without a
  split one day stays on top on both sides of ±180.
- A VIIRS dateline box drapes nothing without per-half evidence, so a
  replacement source without presentBoxes cannot drape an empty black side.
- The loader keeps the halves confirmed empty; DETAILS says partial for a
  confirmed-empty side and unknown for a side that did not answer.
- mount adds parts without a rollback; unused Cesium test fakes are gone.
This commit is contained in:
German Khokhlov committed 2026-11-20 11:31:14 +04:00
1 parent 5555aba82c
commit e71ed72272
9 files changed
+164 -77

No files matched your search

+9 -7
View File
@@ -136,14 +136,16 @@ function coverageText(coverage) {
return t('unknown');
}
/** A present day covers the box only in part when its probe omits a side. */
/** A confirmed-empty side means partial coverage. An unanswered side leaves coverage unknown. */
function shownCoverage(candidate, box) {
const drapes = candidate.thumbnail?.availableBoxes;
return candidate.thumbnail?.status === 'present' &&
Array.isArray(drapes) &&
drapes.length < nonCrossingBoxes(box).length
? 'partial'
: candidate.coverage;
const { status, availableBoxes, emptyBoxes } = candidate.thumbnail ?? {};
if (
status !== 'present' ||
!Array.isArray(availableBoxes) ||
availableBoxes.length >= nonCrossingBoxes(box).length
)
return candidate.coverage;
return emptyBoxes?.length ? 'partial' : 'unknown';
}
function cloudText(candidate) {
+14 -3
View File
@@ -1066,7 +1066,7 @@ test('DETAILS is a collapsed rail card holding every note, and the empty-days to
assert.equal(article.dataset.open, 'false');
});
test('DETAILS shows partial coverage when a present dateline day drapes one half', async () => {
test('DETAILS shows partial coverage for a dateline day with one side empty, unknown when a side did not answer', async () => {
const f = fixture();
f.layer.enable();
f.layer.setBox(FIJI_BOX);
@@ -1074,10 +1074,21 @@ test('DETAILS shows partial coverage when a present dateline day drapes one half
await settle();
assert.match(f.byId('ri-details').textContent, /Coverage full/);
const get = f.thumbnails.get;
const [west] = nonCrossingBoxes(FIJI_BOX);
f.thumbnails.get = (key) => ({ ...get(key), availableBoxes: [west] });
const [west, east] = nonCrossingBoxes(FIJI_BOX);
f.thumbnails.get = (key) => ({
...get(key),
availableBoxes: [west],
emptyBoxes: [east],
});
f.thumbnails.probe(f.snap().focus.key, 'present');
assert.match(f.byId('ri-details').textContent, /Coverage partial/);
f.thumbnails.get = (key) => ({
...get(key),
availableBoxes: [west],
emptyBoxes: [],
});
f.thumbnails.probe(f.snap().focus.key, 'present');
assert.match(f.byId('ri-details').textContent, /Coverage unknown/);
});
test('the body scroll position survives renders even when DOM mutations reset it', async () => {