mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
Merge upstream/main: air-quality layer (AQHI) meets i18n
Upstream's #568 adds the Air quality layer to the Weather group (ECCC AQHI, Canada only) with a band legend, worst-first list and voice support. - package-boundaries: both sides' entries unioned. - layerPanel/weatherPanel tests: both sides' new tests kept; the weatherPanel fixture follows upstream (legendCategorical: true, the 'list' block id) while our localized-history (K-6) test stays. - air-quality strings marked: band labels and the provider label as msg() data, the readings-list aria-label through t(); es/ru entries added (+6 keys each). - The synthetic air-quality allocation-benchmark titles follow the file's own convention (// i18n-ignore) like TRK/VESSEL/CAMERA. Also verified the auto-merged weatherPanel.js against upstream: ORDER gains 'air-quality', OBSERVED stays slice(2, 5), and the data-driven legendCategorical path is upstream's. npm run i18n: complete (2559), no unmarked strings. npm test: only the pre-existing environmental OPENAI_API_KEY leak fails. Build passes.
This commit is contained in:
commit
f3da0916d9
38 files changed
+2061
-62
No files matched your search
@@ -11,8 +11,9 @@ const ORDER = [
|
||||
'weather-radar',
|
||||
'weather-satellite',
|
||||
'weather-lightning',
|
||||
'air-quality',
|
||||
];
|
||||
const OBSERVED = new Set(ORDER.slice(2));
|
||||
const OBSERVED = new Set(ORDER.slice(2, 5));
|
||||
const utc = (time) =>
|
||||
Number.isFinite(Date.parse(time))
|
||||
? `${formatUtcDayMonth(time)} ${utcClock(time)}`
|
||||
@@ -166,7 +167,10 @@ export function createWeatherPanel({
|
||||
? t('LATEST · newest per product')
|
||||
: historyTime(state.target),
|
||||
});
|
||||
const models = active.map(({ id, icon, summary, legend = [], list }) => {
|
||||
const models = active.map((entry) => {
|
||||
const { id, icon, summary, legend = [], list } = entry;
|
||||
// Discrete classes (storm geometry, AQHI bands) list swatches, not a ramp.
|
||||
const categorical = entry.legendCategorical === true;
|
||||
let detail = summary.detail;
|
||||
const product = state.products.find((item) => item.id === id);
|
||||
if (OBSERVED.has(id)) {
|
||||
@@ -207,17 +211,15 @@ export function createWeatherPanel({
|
||||
id: 'legend',
|
||||
type: 'legend',
|
||||
legend: {
|
||||
categorical: id === 'weather-cyclones',
|
||||
categorical,
|
||||
colors: legend.map(({ color }) => color),
|
||||
labels: legend.map(({ label }) => label),
|
||||
units: id === 'weather-cyclones' ? '' : summary.units,
|
||||
units: categorical ? '' : summary.units,
|
||||
zeroIndex: legend.findIndex(({ label }) => label === '0'),
|
||||
},
|
||||
};
|
||||
const blocks = [
|
||||
...(id === 'weather-cyclones' && list?.items?.length
|
||||
? [{ id: 'storms', type: 'list', list }]
|
||||
: []),
|
||||
...(list?.items?.length ? [{ id: 'list', type: 'list', list }] : []),
|
||||
{ id: 'details', type: 'lines', lines },
|
||||
...(legend.length ? [legendBlock] : []),
|
||||
...(summary.settings?.length
|
||||
|
||||
Reference in new issue
Block a user