Revert precip% hiding; headline now says 'slim chance of rain' instead

Wrong direction on the previous fix -- hiding the number lost real
information. Better fix: when no hour's icon is rain-classified but there's
still a real (if low) numeric precip_prob somewhere in the day, the
headline now says 'Mostly dry, slim chance of rain' instead of a flat 'Dry
today' that silently disagreed with a 5% sitting on an hour card. Rain% is
shown unconditionally again everywhere (hourly cards, next-2-days cards,
the Now hero line).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-08-25 13:21:14 +00:00
parent 7780ef42a3
commit c6be990f6b
2 changed files with 13 additions and 13 deletions

View file

@ -33,12 +33,6 @@ 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)}°`
}
@ -61,15 +55,14 @@ 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 }) {
const showPrecip = point.precip_prob != null && point.precip_prob >= MIN_PRECIP_DISPLAY
if (!showPrecip && point.wind_speed_mph == null) return null
if (point.precip_prob == null && point.wind_speed_mph == null) return null
const iconSize = large ? 13 : 10
return (
<span className={`wx-meta${large ? ' wx-meta-lg' : ''}`}>
{showPrecip && (
{point.precip_prob != null && (
<span className="wx-meta-line wx-meta-precip">
<Droplet size={iconSize} strokeWidth={2} />
{Math.round(point.precip_prob!)}%
{Math.round(point.precip_prob)}%
</span>
)}
{point.wind_speed_mph != null && (
@ -172,8 +165,8 @@ export default function Display() {
{data.summary && <span className="wx-summary-headline">{data.summary.headline}</span>}
<span>
{currentPoint.feels_like_c != null && <>Feels like {roundTemp(currentPoint.feels_like_c)}</>}
{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</>}
{currentPoint.feels_like_c != null && currentPoint.precip_prob != null && ' · '}
{currentPoint.precip_prob != null && <>{Math.round(currentPoint.precip_prob)}% chance of rain</>}
</span>
{data.summary?.note && <span className="wx-summary-note">{data.summary.note}</span>}
</div>