v1.5.0 Phase 2b: lead-time / time-to-impact display (#84) #113
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!113
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/v1.5.0-phase2b-leadtime"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surfaces "arrives in ~40 min" wherever an NWS alert's
onsetis in the future.onsetwas already parsed ontoNWSAlertbut never shown, and the dashboard readsSentAlert, which had noonset— so this persists it.SentAlert.onset(nullable timestamptz) + migration 0026;_record_and_dispatchpopulates it on new and refreshed records.time_formatting.lead_time_text(onset, now)→"in ~40 min"/"in ~1.5 hr"/None(past/absent), UTC-safe;arrives_line(alert)wraps it for message bodies.lead_timeJSON key, email, matrix, signal, sms segment-budgeted, pushover, webex, ntfy). Omitted (empty, dropped bycompose) when onset is absent/past → bodies byte-for-byte unchanged in that common case.build_dashboard_contextcomputes_lead_timeper active alert; the card shows a "⏳ arrives in ~40 min" span (server-side + SSE JS), and the SSE payload carriesonset/onset_local/lead_time. Static (computed at page-load / dispatch), matching the existing issued/expires rendering.Bonus:
SentAlert.onsetnow also lets the #75 feeds expose real onset in a later pass (they currently null it).Testing (dev server)
ruff clean; targeted tests 70 passed; bulk suite 709 passed; migration 0026 applied on a restored copy of the real dev DB (onset column present). Most alerts have onset == sent-time or in the past → they correctly show no lead time; the feature only fires for genuinely future onsets (pre-issued watches, timed warnings).
Closes #84
🤖 Generated with Claude Code