thermograph/static
Emi Griffith 431457132a Warm neighbor cells server-side (/cell?neighbors=1) (#51)
cache.js contained a JavaScript clone of backend/grid.py's snapping math
(its own comment said so) to compute the 8 surrounding cells and fire 8
staggered prefetch requests — grid geometry had two homes, one per
language, plus a client-side guess at Nominatim pacing.

The server now owns it: grid.neighbors(cell) steps one cell width from
the center and re-snaps (adjacent rows have different longitude steps;
poles and the antimeridian handled by snap), and /api/v2/cell grew a
neighbors=1 flag that enqueues those cells for a single background
worker. The warm-only guarantee matches prefetch=1 — a cell with no
cached archive is skipped, so no weather-API quota is ever spent — and
reverse_geocode's own lock paces the at-most-one Nominatim call per
never-labeled cell. Re-enqueues are TTL-deduped; the worker starts from
the lifespan hook, so tests and offline importers never spawn it.

The client now sends its one conditional bundle request with
neighbors=1 (a warm spot costs an empty 304) instead of skipping the
bundle and firing 8 extra requests; the grid-math clone and the
now-unused hasFreshCache are deleted.

Tests (114): grid.neighbors mid-latitude/pole/antimeridian, the
neighbors=1 enqueue + TTL dedupe, _warm_cell materializing the
history-derived store rows, and the never-fetch-upstream guarantee.
Verified with the headless-Chromium smoke across all five pages.
2026-07-11 20:47:31 +00:00
..
app.js Extract the chart library and the chunked streaming fetch (#49) 2026-07-11 20:33:06 +00:00
cache.js Warm neighbor cells server-side (/cell?neighbors=1) (#51) 2026-07-11 20:47:31 +00:00
calendar.html Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
calendar.js Extract the chart library and the chunked streaming fetch (#49) 2026-07-11 20:33:06 +00:00
chart.js Extract the chart library and the chunked streaming fetch (#49) 2026-07-11 20:33:06 +00:00
compare.html Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
compare.js Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
day.html Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
day.js Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
index.html Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
legend.html Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
logo.png Link previews: Open Graph tags + logo for shared URLs (#35) 2026-07-11 15:59:14 +00:00
logo.svg Link previews: Open Graph tags + logo for shared URLs (#35) 2026-07-11 15:59:14 +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 Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
package.json Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
shared.js Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
style.css CSS: delete dead selectors, one mobile block, shared control recipes (#50) 2026-07-11 20:42:41 +00:00
units.js Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00