mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
fix(imagery): re-probe cancelled auto-preview successor (merge main)
Reschedule thumbnail intent when pruning an empty automatic day changes follow/preview, so a scrolled-off VIIRS successor cannot stay pending. Add node:test regression for the cancelled successor. Preserve current main's voice-cancel handling and changelog/docs. Review credit: gekh and quanticsoul4772. Tests not run locally; verify with node --test.
This commit is contained in:
commit
4554cdf5c6
793 files changed
+139589
-3309
No files matched your search
@@ -1153,6 +1153,48 @@ const dailyViirs = () =>
|
||||
),
|
||||
);
|
||||
|
||||
test('empty auto VIIRS re-requests a cancelled successor', async () => {
|
||||
const f = fixture();
|
||||
const days = dailyViirs();
|
||||
const newest = days[0].key;
|
||||
const next = days[1].key;
|
||||
f.layer.setSources({ hls: false });
|
||||
await f.ready(days);
|
||||
|
||||
assert.equal(f.diag().following, newest);
|
||||
assert.ok(
|
||||
f.thumbnails.retained.at(-1).includes(next),
|
||||
'the next day was originally scheduled',
|
||||
);
|
||||
|
||||
// Move the visible window away before either day answers: retention
|
||||
// cancels the next day's probe but keeps the currently followed day.
|
||||
f.layer.setVisibleRange(25, 29);
|
||||
assert.equal(
|
||||
f.thumbnails.retained.at(-1).includes(next),
|
||||
false,
|
||||
'the next day is no longer retained',
|
||||
);
|
||||
const before = f.thumbnails.requests.filter(([key]) => key === next).length;
|
||||
|
||||
f.thumbnails.probe(newest, 'empty');
|
||||
assert.equal(f.diag().following, next);
|
||||
assert.equal(f.snap().preview.pending, next);
|
||||
assert.ok(
|
||||
f.thumbnails.retained.at(-1).includes(next),
|
||||
'the new follow day is retained without scrolling again',
|
||||
);
|
||||
assert.equal(
|
||||
f.thumbnails.requests.filter(([key]) => key === next).length,
|
||||
before + 1,
|
||||
'the cancelled successor is requested again',
|
||||
);
|
||||
|
||||
f.thumbnails.probe(next, 'present');
|
||||
assert.equal(f.snap().preview.key, next);
|
||||
assert.deepEqual(f.drapes(), { a: `${next}|none`, b: null });
|
||||
});
|
||||
|
||||
test('restored pins outside the visible strip window are probed and swipe once present', async () => {
|
||||
const f = fixture();
|
||||
const days = dailyViirs();
|
||||
@@ -1389,3 +1431,13 @@ test('with SELECT BOX armed, Escape clears the preview first and the next Escape
|
||||
assert.equal(f.snap().toolActive, false);
|
||||
await tool.destroy();
|
||||
});
|
||||
|
||||
test('a voice search cancelled mid-flight says so instead of looking empty', async () => {
|
||||
const f = fixture();
|
||||
f.layer.enable();
|
||||
f.layer.setBox(BOX);
|
||||
assert.equal(f.snap().searching, true);
|
||||
f.layer.cancelPendingSearch();
|
||||
assert.equal(f.snap().searching, false);
|
||||
assert.equal(f.snap().notice, 'Search cancelled');
|
||||
});
|
||||
Reference in new issue
Block a user