frontend: fix the three inconsistencies the onboarding guide found #99

Merged
admin_emi merged 2 commits from fix/frontend-doc-and-parity-gaps into dev 2026-07-25 21:11:34 +00:00
Showing only changes of commit 259f3f170d - Show all commits

View file

@ -38,13 +38,20 @@ for systemd/CI callers. Entry target is `app:app`.
`cache.js` reads `null` cross-origin and never revalidates. Don't change the
ETag derivation or that list without checking `frontend/static/cache.js`.
- **`data/grading.py::pct_ordinal()`** is mirrored by `frontend`'s
`shared.js::pctOrd()` — floor a percentile into `1..99`, never 0 or 100.
`server/internal/format::PctOrdinal` (SSR) and `static/shared.js::pctOrd()`
(browser) — floor a percentile into `1..99`, never 0 or 100.
`TEMP_BANDS`/`RAIN_BANDS` are the source of truth for tier names and
thresholds; changing them without the frontend produces tiers drawn in colours
that disagree with the labels the API returns.
- **Fahrenheit country set**`api/content_payloads.py`'s `F_COUNTRIES` must stay
identical to `frontend`'s `format.py::F_COUNTRIES` and `static/units.js`'s
`F_REGIONS`. There is a test asserting this.
- **Fahrenheit country set**`api/content_payloads.py`'s `F_COUNTRIES` is
canonical; `frontend`'s `server/internal/format::FCountries` and
`static/units.js`'s `F_REGIONS` must stay identical to it. Both are asserted
by tests in `frontend/server/internal/format/format_test.go` — but note the
backend cross-check **skips in CI** (the frontend image's build context is
`frontend/`, so this file is unreachable from the builder stage, which is the
only place CI runs those tests). It fires on a full checkout. The `units.js`
check does run in the image build. `frontend/format.py`'s copy is the
superseded Python service's and is not deployed.
- **`/healthz` and `/api/version` are deliberately I/O-free** so they stay cheap
under tight healthcheck intervals.