fix(recent-imagery): address dateline review (halves availability, voice guard, export, renderer fallback)

This commit is contained in:
brandonabyrd authored and Byrd-IT committed 2026-11-13 17:12:47 -06:00
1 parent 9a34d63f1d
commit d60f2420f4
9 files changed
+209 -54

No files matched your search

+10 -4
View File
@@ -523,6 +523,10 @@ export function createRecentImageryPanel({
function exportsView() {
const ab = snapshot.mode === 'ab';
// Worldview Snapshots rejects a crossing BBOX: say so up front.
const crossing = Boolean(
snapshot.box && snapshot.box.west > snapshot.box.east,
);
return [
{
id: 'export',
@@ -532,10 +536,12 @@ export function createRecentImageryPanel({
label: ab
? t('EXPORT {slot}', { slot: slotId.toUpperCase() })
: t('EXPORT'),
title: ab
? t('Download {slot} as a PNG', { slot: slotId.toUpperCase() })
: t('Download the image as a PNG'),
disabled: !exportTarget(slotId) || exporting.has(slotId),
title: crossing
? t('Select one side of the dateline')
: ab
? t('Download {slot} as a PNG', { slot: slotId.toUpperCase() })
: t('Download the image as a PNG'),
disabled: crossing || !exportTarget(slotId) || exporting.has(slotId),
reserved: slotId === 'b' ? !ab : undefined,
onClick: () => void exportImage(slotId),
})),
+4
View File
@@ -978,6 +978,10 @@ test('opacity drives both images; EXPORT downloads the pin or the preview and EX
'Select one side of the dateline',
'the drawn box is not a warning until an export is tried',
);
const crossingExport = f.byAction('export-a');
assert.equal(crossingExport.disabled, true, 'EXPORT is off up front');
assert.equal(crossingExport.title, 'Select one side of the dateline');
// The exportImage guard stays as a backstop.
assert.equal(await f.readout.exportImage('a'), false);
assert.equal(
f.byId('ri-notice-text').textContent,