From eeda6d51d166e6284af9b4410ecaafd05d2705df Mon Sep 17 00:00:00 2001 From: brandonabyrd Date: Tue, 10 Nov 2026 12:36:19 -0600 Subject: [PATCH] fix(recent-imagery): refresh when availability removes drape --- changelog.d/1540-recent-imagery-dateline.md | 2 +- src/layers/recentImagery/index.js | 4 +--- src/layers/recentImagery/rendering.js | 15 ++++++++------- src/layers/recentImagery/source.js | 4 ++-- src/layers/recentImagery/thumbnails.js | 3 +-- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/changelog.d/1540-recent-imagery-dateline.md b/changelog.d/1540-recent-imagery-dateline.md index 11f35f95bc..f896c11ace 100644 --- a/changelog.d/1540-recent-imagery-dateline.md +++ b/changelog.d/1540-recent-imagery-dateline.md @@ -2,7 +2,7 @@ into a box about 360° wide and refused as too large; it is now the short box across ±180°, which lists the days for that box and drapes a pinned day on both sides. Availability probes both sides of ±180° (a day counts as present when either - side has data, and only the sides the probe proved present are draped — a + side has data, and sides confirmed empty are not draped — a side confirmed empty never lands on the map), each side is bounded by its own deadline and both sides' answers are heard — sides proven present all drape, a side that stalls only bounds the day for its deadline instead of diff --git a/src/layers/recentImagery/index.js b/src/layers/recentImagery/index.js index 50d7a442c4..6520d81f85 100644 --- a/src/layers/recentImagery/index.js +++ b/src/layers/recentImagery/index.js @@ -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 { diff --git a/src/layers/recentImagery/rendering.js b/src/layers/recentImagery/rendering.js index 86a67b84cd..b6c23a0663 100644 --- a/src/layers/recentImagery/rendering.js +++ b/src/layers/recentImagery/rendering.js @@ -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; }, diff --git a/src/layers/recentImagery/source.js b/src/layers/recentImagery/source.js index 45022d8ce7..02f4ff2366 100644 --- a/src/layers/recentImagery/source.js +++ b/src/layers/recentImagery/source.js @@ -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; diff --git a/src/layers/recentImagery/thumbnails.js b/src/layers/recentImagery/thumbnails.js index 0b583ba936..c727dcf40c 100644 --- a/src/layers/recentImagery/thumbnails.js +++ b/src/layers/recentImagery/thumbnails.js @@ -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 {