Improved day tab selection and icons
Tweaked at a glance panel
This commit is contained in:
Fraxle
2026-06-23 17:28:47 +01:00
parent c090367f7c
commit 87907f50d6
5 changed files with 52 additions and 48 deletions
+6 -2
View File
@@ -385,7 +385,9 @@ export function computeGlanceSummary(todayRows, profile, variant, skinType, cols
const peakRow = (field) => todayRows.reduce((best, r) =>
(r[field] != null && (best == null || r[field] > best[field])) ? r : best, null);
const maxRainProb = Math.max(0, ...todayRows.map(r => r.precipProb ?? 0));
const peakRainRow = todayRows.reduce((best, r) =>
(r.precipProb != null && (best == null || r.precipProb > best.precipProb)) ? r : best, null);
const maxRainProb = peakRainRow ? (peakRainRow.precipProb ?? 0) : 0;
// Longest run of rows that satisfy a predicate.
const longestWindow = (rows, cond) => {
@@ -428,7 +430,9 @@ export function computeGlanceSummary(todayRows, profile, variant, skinType, cols
const rainItem = {
icon: '🌧',
label: 'Rain risk',
value: `${Math.round(maxRainProb)}%`,
value: maxRainProb > 0 && peakRainRow?.iso
? `${Math.round(maxRainProb)}% at ${hhmm(peakRainRow.iso)}`
: `${Math.round(maxRainProb)}%`,
alert: maxRainProb >= 60,
};