fix(recent-imagery): refresh when availability removes drape

This commit is contained in:
brandonabyrd authored and Byrd-IT committed 2026-11-13 17:12:47 -06:00
1 parent 9924cb15eb
commit eeda6d51d1
5 files changed
+13 -15

No files matched your search

+1 -3
View File
@@ -549,9 +549,7 @@ export function createRecentImageryLayer({
: (slotId === 'a') !== _swapped
? 'left'
: 'right',
// Which halves of a dateline box the probe proved present; the
// renderer drapes only those, so a confirmed-empty half never
// lands on the map as black "no data" tiles.
// Keep every half except those confirmed empty by the probe.
availableBoxes: thumbnails.get(candidate.key)?.availableBoxes ?? null,
});
} else {
+8 -7
View File
@@ -29,7 +29,7 @@ function clampAlpha(value) {
const boxKey = (box) =>
[box.west, box.south, box.east, box.north].map(Number).join(',');
/** Comparable per-half availability signature; '' with no evidence. */
/** Comparable per-half availability signature; unknown differs from empty. */
const boxesKey = (list) =>
Array.isArray(list)
? list
@@ -160,10 +160,9 @@ export function createRecentImageryRenderer({
// [] means "not a box": add no layer rather than drape the raw box.
const parts = nonCrossingBoxes(box);
if (!parts.length) return false;
// A dateline day drapes only the halves its probe proved present (VIIRS
// is a JPEG product; a draped confirmed-empty half is a black rectangle).
// No evidence drapes the whole box, as before. Proven halves that do not
// match this box (a stale entry) leave the slot empty, never draped.
// Skip confirmed-empty halves; a failed probe is not proof of emptiness.
// No evidence drapes the whole box, as before. Evidence for a different
// box leaves the slot empty rather than applying stale availability.
const allowed = Array.isArray(availableBoxes)
? parts.filter((part) =>
availableBoxes.some((half) => half && boxKey(half) === boxKey(part)),
@@ -237,9 +236,11 @@ export function createRecentImageryRenderer({
}
return true;
}
removeOwned(slotId);
if (!mount(slotId, { candidate, box, ...look, availableBoxes }))
const removed = removeOwned(slotId);
if (!mount(slotId, { candidate, box, ...look, availableBoxes })) {
if (removed) requestRender('recent-imagery-hide');
return false;
}
requestRender('recent-imagery-show');
return true;
},
+2 -2
View File
@@ -119,8 +119,8 @@ function probeHalf(
/**
* The answer to one request: the response, enriched (non-enumerably, so the
* transport's own shape is untouched) with the non-crossing halves the probe
* proved present. An empty evidence list is a confirmed-empty day; no field
* means the caller did not probe per half.
* did not confirm empty. An empty evidence list is a confirmed-empty day;
* no field means the caller did not probe per half.
*/
function withPresentBoxes(response, presentBoxes) {
if (!response) return response;
+1 -2
View File
@@ -91,8 +91,7 @@ export function createThumbnailLoader({
let status = 'error';
let objectUrl = null;
let acquisitionTime = null;
// Which half of a dateline box the probe proved present; null when the
// request was not probed per half.
// Halves not confirmed empty; null when no per-half probe is available.
let availableBoxes = null;
let cancelled = false;
try {