Lead-time / time-to-impact display #84

Closed
opened 2026-07-18 05:31:44 +00:00 by claude-bot · 1 comment
Contributor

onset is already parsed off NWS alerts (nws.py:238) but only ever shown as a status badge. Surface "arrives in ~40 min" on dashboard cards and in notifications where onset is in the future. Small change, meaningfully better situational awareness. Missed because the badge (WARNING/WATCH/OK) framed alerts as binary state, not a timeline. Effort S, value Medium.


Filed from the 2026-07-17 codebase audit (docs/.internal/report-2026-07-17.md), finding I-14.

`onset` is already parsed off NWS alerts (`nws.py:238`) but only ever shown as a status badge. Surface "arrives in ~40 min" on dashboard cards and in notifications where onset is in the future. Small change, meaningfully better situational awareness. Missed because the badge (WARNING/WATCH/OK) framed alerts as binary state, not a timeline. Effort S, value Medium. --- _Filed from the 2026-07-17 codebase audit (`docs/.internal/report-2026-07-17.md`), finding I-14._
Author
Contributor

Done in #113 (merged). onset is now persisted on SentAlert (migration 0026) and surfaced as a friendly time-to-impact wherever it's in the future: time_formatting.lead_time_text renders "in ~40 min" / "in ~1.5 hr" (None when past/absent), added as an "Arrives:" line to all 9 notifiers and a " arrives in ~40 min" span on the dashboard cards (server-side + live SSE). Output is byte-for-byte unchanged when onset isn't in the future (the common case — most alerts are already in effect). Bulk suite 709 passed; migration 0026 verified on a real-DB copy. Bonus: SentAlert.onset now also enables the #75 feeds to expose real onset in a follow-up.

Done in #113 (merged). `onset` is now persisted on `SentAlert` (migration 0026) and surfaced as a friendly time-to-impact wherever it's in the future: `time_formatting.lead_time_text` renders "in ~40 min" / "in ~1.5 hr" (None when past/absent), added as an "Arrives:" line to all 9 notifiers and a "⏳ arrives in ~40 min" span on the dashboard cards (server-side + live SSE). Output is byte-for-byte unchanged when onset isn't in the future (the common case — most alerts are already in effect). Bulk suite 709 passed; migration 0026 verified on a real-DB copy. Bonus: `SentAlert.onset` now also enables the #75 feeds to expose real onset in a follow-up.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/WeatherBot#84
No description provided.