Fix popup overflow
Fix pulldowns overflow
Update extra popus
Update UTCI/SunSoak - Show variant selected
This commit is contained in:
Fraxle
2026-05-26 13:15:26 +01:00
parent f8a220b325
commit 1509ddb78d
8 changed files with 95 additions and 16 deletions
+14 -3
View File
@@ -73,14 +73,20 @@ export function getCellTagEvents(events, row) {
});
}
// --- BANNER PRIORITY -----------------------------------------------------
// Weather event IDs that are safety-relevant and should always appear as the
// first banner slide, ahead of cosmic events and lower-priority weather items.
const PRIORITY_WEATHER_IDS = new Set(['heat-spike', 'frost', 'storm']);
// --- MAIN EXPORT ---------------------------------------------------------
// Returns ALL active events for the given rows/date as an array.
// Empty array = nothing active.
//
// Order within array:
// 1. PROMO_OVERRIDE (if set, returned alone)
// 2. All matching cosmic calendar events for this date
// 3. All matching weather-derived events
// 2. Priority weather events (heat spike, frost, storm) — always slide 1
// 3. All matching cosmic calendar events for this date
// 4. Remaining weather-derived events (sunset, stargazing, …)
export function getActiveEvents(rows, location) {
// 1. Manual promo override - shown alone, no mixing with other events
@@ -107,7 +113,12 @@ export function getActiveEvents(rows, location) {
checks.forEach(ev => { if (ev) weatherEvents.push(ev); });
}
return [...cosmicHits, ...weatherEvents];
// Sort so priority weather warnings (heat, frost, storm) always lead,
// then cosmic events, then the remaining weather items.
const priorityWeather = weatherEvents.filter(ev => PRIORITY_WEATHER_IDS.has(ev.id));
const otherWeather = weatherEvents.filter(ev => !PRIORITY_WEATHER_IDS.has(ev.id));
return [...priorityWeather, ...cosmicHits, ...otherWeather];
}
// --- LENS EVENT PICKER ---------------------------------------------------