mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
fix(weather): weather cards measure from the timeline time and know when wind follows it
At a past time the radar, lightning and satellite cards aged the shown frame and judged the source delayed against the wall clock, so a frame from years back read "Source observations delayed" and an age in the millions of minutes. Frame ages, the delayed status and the stale stat now count from the timeline time at a past time, and from now while live, as before. The observed timeline's readout and preview show the time alone at a past time, since its age from the timeline time is always zero. The wind card noted that it does not follow the timeline whenever the observed clock was at a past time, even when a host follows the world clock for wind. The weather clock now reports whether a layer follows the world clock (weatherClock.follows(id), the world clock's follows), and the wind row and card drop that note when its source follows the timeline.
This commit is contained in:
1 parent
7b4b4d4184
commit
6e23a73283
8 files changed
+151
-21
No files matched your search
@@ -258,8 +258,9 @@ export function createWindLayer({
|
||||
return { model, overlay, paused, units };
|
||||
},
|
||||
getRowControls() {
|
||||
// A source that follows the timeline shows the wind at its time.
|
||||
const historyStatus =
|
||||
clock?.getState().mode === 'history'
|
||||
clock?.getState().mode === 'history' && !clock.follows?.('wind')
|
||||
? t('Forecast · does not follow history')
|
||||
: null;
|
||||
const valid = formatWindValidTime(manifest?.cycle?.validIso);
|
||||
|
||||
@@ -454,3 +454,19 @@ test('a parameter replacement during manager enable does not roll the layer back
|
||||
assert.equal(layer.getStats().count, 4);
|
||||
await manager.destroyAll();
|
||||
});
|
||||
|
||||
test('wind whose source follows the timeline drops the note that it does not follow the timeline', async () => {
|
||||
const { createWeatherClock } = await import('../weather/clock.js');
|
||||
const { createWorldClock } = await import('../../time/worldClock.js');
|
||||
const world = createWorldClock();
|
||||
const clock = createWeatherClock({ world });
|
||||
const layer = createWindLayer({ feed: { getSnapshot: async () => snapshot('gfs') }, clock });
|
||||
world.follow('wind');
|
||||
await clock.setTarget('2026-09-14T12:00:00.000Z');
|
||||
assert.equal(clock.getState().mode, 'history');
|
||||
assert.doesNotMatch(layer.getRowControls().info, /does not follow history/);
|
||||
world.follow('wind', false);
|
||||
assert.match(layer.getRowControls().info, /Forecast · does not follow history/);
|
||||
layer.destroy();
|
||||
clock.destroy();
|
||||
});
|
||||
Reference in new issue
Block a user