thermograph/static
Emi Griffith 9a2764ae33 Deliver unusual-weather alerts as Discord DMs for linked users (#210)
Adds Discord DM as a notification channel beside web push, for users who linked
their Discord account and opted in. It rides the same fan-out point as push
(_dispatch_discord next to _dispatch_push in the notifier pass), reusing the
transport-agnostic title/body/deep-link, and stays best-effort and isolated: the
in-app row is already committed, and push/email remain the fallback for anyone
Discord can't reach (its DM rule requires a shared server / user install).

- discord.py: send_dm() opens the DM channel then posts an embed via the bot token,
  with one capped 429 retry. Absolute deep links (a DM can't resolve a relative
  path the way the service worker can).
- notify.py: _dispatch_discord() delivers only when the subscriber has a linked
  discord_id and discord_dm on; no-ops entirely when no bot token is configured.
- models.py: User.discord_dm (opt-in flag) + migration 002. Linking sets it True
  (an active opt-in); a new POST /discord/dm mutes it without unlinking, and unlink
  clears it. Exposed on UserRead; account popover shows an on/off toggle.

Claude-Session: https://claude.ai/code/session_013dRZmX9D3JEntfMKWMTWZ8
2026-07-20 04:04:45 +00:00
..
.well-known Add Android TWA build config and Digital Asset Links (#203) 2026-07-20 00:43:56 +00:00
account.js Deliver unusual-weather alerts as Discord DMs for linked users (#210) 2026-07-20 04:04:45 +00:00
app.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
apple-touch-icon.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
cache.js Add a climate-score page from recent-vs-baseline percentile divergence (#196) 2026-07-19 23:02:33 +00:00
calendar.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
calendar.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
chart.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
climate.js Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00
compare.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
compare.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
day.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
day.js Render every percentile through one rule (#186) 2026-07-18 09:08:28 +00:00
digest.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
favicon-16.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
favicon-32.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
favicon-48.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
favicon.svg Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +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
ios-install.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
legend.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
logo-192.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
logo-maskable-192.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
logo-maskable-512.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
logo.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
manifest.webmanifest Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
mappicker.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48: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
score.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
score.js Simplify the score module and page: dedup builders, consolidate metric metadata (#209) 2026-07-20 04:02:40 +00:00
shared.js Show a metric's unit once atop its distribution strip (#195) 2026-07-19 22:30:31 +00:00
style.css Simplify the score module and page: dedup builders, consolidate metric metadata (#209) 2026-07-20 04:02:40 +00:00
subscriptions.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
subscriptions.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
sw.js Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
units.js Report rain in whole millimetres; lift tier spans out of the bars (#192) 2026-07-19 19:28:58 +00:00