diff --git a/frontend/src/pages/Display.tsx b/frontend/src/pages/Display.tsx index da37a09..2286120 100644 --- a/frontend/src/pages/Display.tsx +++ b/frontend/src/pages/Display.tsx @@ -33,6 +33,12 @@ function compassFromDeg(deg: number): string { return COMPASS[Math.round(deg / 45) % 8] } +// Below this, a rain% reads as noise, not information — and worse, it can visibly +// contradict the "Dry today" headline (which is icon-based, not precip_prob-based: +// an hour can have a non-rain icon and still carry a token 5% chance). Hiding trivial +// percentages keeps what's shown consistent with what "Dry today" is actually saying. +const MIN_PRECIP_DISPLAY = 15 + function roundTemp(c: number): string { return `${Math.round(c)}°` } @@ -55,14 +61,15 @@ function AstroRow({ astro }: { astro?: Astro }) { // the text size for today's hourly cards; the next-2-days cards stay at the // smaller default so today still reads as the primary/detailed view. function PointMeta({ point, large }: { point: ForecastPoint; large?: boolean }) { - if (point.precip_prob == null && point.wind_speed_mph == null) return null + const showPrecip = point.precip_prob != null && point.precip_prob >= MIN_PRECIP_DISPLAY + if (!showPrecip && point.wind_speed_mph == null) return null const iconSize = large ? 13 : 10 return ( - {point.precip_prob != null && ( + {showPrecip && ( - {Math.round(point.precip_prob)}% + {Math.round(point.precip_prob!)}% )} {point.wind_speed_mph != null && ( @@ -165,8 +172,8 @@ export default function Display() { {data.summary && {data.summary.headline}} {currentPoint.feels_like_c != null && <>Feels like {roundTemp(currentPoint.feels_like_c)}} - {currentPoint.feels_like_c != null && currentPoint.precip_prob != null && ' · '} - {currentPoint.precip_prob != null && <>{Math.round(currentPoint.precip_prob)}% chance of rain} + {currentPoint.feels_like_c != null && currentPoint.precip_prob != null && currentPoint.precip_prob >= MIN_PRECIP_DISPLAY && ' · '} + {currentPoint.precip_prob != null && currentPoint.precip_prob >= MIN_PRECIP_DISPLAY && <>{Math.round(currentPoint.precip_prob)}% chance of rain} {data.summary?.note && {data.summary.note}}