Show news from the window the server serves

A host may serve fewer hours than the day. The hotspots answer may name its window
(`windowHours`, a whole number from 1 to 24); the layer keeps reports, the
feed, In view and the chosen event inside it, and the panel says
"Last 12 h" or "Last 24 h" accordingly. Without a window named, or with one
out of range, the layer keeps the full day as before.
This commit is contained in:
Denis Groshev committed 2026-11-06 00:45:27 +01:00
1 parent f3e206bf37
commit 60fad38c3f
18 files changed
+178 -73

No files matched your search

+10
View File
@@ -76,6 +76,7 @@ function view(extra = {}) {
inView: { active: false, loading: false, error: null, items: [] },
selected: null,
hasMore: true,
windowHours: 24,
loading: false,
error: null,
...extra,
@@ -276,3 +277,12 @@ test('scrolling to the end asks once per page, again after a filter change or a
assert.equal(loadMores(), 3);
news.destroy();
});
test('the panel names the window the server serves', () => {
const { news, panel } = fixture();
news.update(view({ windowHours: 12 }));
assert.equal(
panel.querySelector('.news-readout__window').textContent,
'Last 12 h',
);
});