thermograph/static
Emi Griffith b1c6b94765 Follow the unit system for precipitation and wind too (#190)
Defaulting climate pages to the city's temperature convention left every page
half-converted: a Delhi reader got °C next to "9 mph" and "0.00 in". One flag now
drives every measure — picking °C also gives mm and km/h.

Absolute humidity stays g/m³ in both systems; there is no imperial unit for it
anyone would recognise, so converting it would only make the page worse.

units.js becomes the single source for all of it. The formatting logic existed in
three independent copies — shared.js's fmtPrecip/fmtWind/fmtHumid, a second set
inside fmtMetricVal, and a third baked into chart.js's series labels, axis ticks
and tooltip — which is why the units drifted apart in the first place. shared.js
now re-exports from units.js so its importers are unchanged, and chart.js carries
a per-series unit `kind` in place of sniffing for a "°" suffix, which could not
have extended to three unit families.

Server-rendered pages gain the carrier they were missing: precipitation and wind
now render as <span class="precip" data-precip-in> / <span class="wind"
data-wind-mph>, the same contract temperature already had, so climate.js can
repaint them on toggle and the attribute stays imperial as the source of truth.

Precision follows the unit: millimetres get one decimal where inches get two.
0.04 in and 1.0 mm are the same amount, and "1.02 mm" would advertise precision
the source doesn't have. Wind rounds half-up to match Math.round, as temperature
already does.

The weekly table's wind and rain cells are bare numbers to keep the grid narrow,
so their row labels now carry the unit and rebuild per render. Static copy that
names a unit — the legend's "(mph)", "(inches)", and a "(°F)" that had been wrong
for °C readers since the country defaults landed — is marked up with
data-unit-label and painted from the same source.

The chart keeps its imperial domain; only labels convert, so point positions and
the fan geometry are untouched.

Push and email bodies are still imperial-only (notify.py): they are composed
server-side with no client to repaint them and no per-user unit stored, which is
the same limitation temperature already has there. Left for a follow-up.

Claude-Session: https://claude.ai/code/session_013dRZmX9D3JEntfMKWMTWZ8
2026-07-19 19:03:41 +00:00
..
account.js Give climate/city/record pages full header parity + working °F/°C (#124) 2026-07-16 17:48:30 +00:00
app.js Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00
apple-touch-icon.png New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
cache.js Warm neighbor cells server-side (/cell?neighbors=1) (#51) 2026-07-11 20:47:31 +00:00
calendar.html Make the brand lockup a home link on every page (#182) 2026-07-18 08:06:14 +00:00
calendar.js Render every percentile through one rule (#186) 2026-07-18 09:08:28 +00:00
chart.js Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00
climate.js Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00
compare.html Make the brand lockup a home link on every page (#182) 2026-07-18 08:06:14 +00:00
compare.js Account system with weather-notification subscriptions (#89) 2026-07-15 18:46:46 +00:00
day.html Make the brand lockup a home link on every page (#182) 2026-07-18 08:06:14 +00:00
day.js Render every percentile through one rule (#186) 2026-07-18 09:08:28 +00:00
digest.js Rebuild the homepage as a distribution landing; add an SMTP seam (#178) 2026-07-18 07:39:47 +00:00
favicon-16.png New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
favicon-32.png New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
favicon-48.png New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
favicon.svg New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
filtersheet.js Compare basis inline; synced inline + sheet metric selector (both pages) (#82) 2026-07-12 07:45:12 +00:00
google03ab95daa090e8d9.html Add Google Search Console site-verification file (#128) 2026-07-16 18:56:42 +00:00
legend.html Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00
logo-192.png New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
logo-maskable-192.png New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
logo-maskable-512.png New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
logo.png New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
manifest.webmanifest New brand mark: C1 step-curve logo wired through favicons, PWA icons, and header (#169) 2026-07-18 04:26:42 +00:00
mappicker.js Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
nav.js Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
package.json Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
push-client.js Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
shared.js Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00
style.css Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00
subscriptions.html Make the brand lockup a home link on every page (#182) 2026-07-18 08:06:14 +00:00
subscriptions.js Push: surface delivery failures (no longer a silent success) (#157) 2026-07-17 00:12:14 +00:00
sw.js Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
units.js Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00