v1.6.1: edge-triggered lightning alerts + public-page open/copy button #122

Merged
claude-bot merged 3 commits from feat/v1.6.1-tweaks into main 2026-07-22 15:44:06 +00:00
Contributor

Two follow-ups from operator feedback on the v1.6.0 lightning release.

Edge-triggered lightning proximity alerts (#87 follow-up)

Replaces the fixed 30-minute cooldown with the requested behavior:

  • Fires once when lightning moves into the radius (not per-strike, not per-refresh).
  • Silent while it persists.
  • Re-arms after the area is clear for LIGHTNING_ALERT_CLEAR_MINUTES (default 10).

Mechanism: Location.lightning_last_seen_at (migration 0030) is refreshed every poll while lightning is present (committed even when not firing); an alert fires only on the clear→present transition (prev_seen is None or older than clear_minutes). LIGHTNING_ALERT_COOLDOWN_MINUTES is retained but deprecated/unused. No-radius locations stay a no-op. Tuning note: a lull longer than clear_minutes within one storm would re-fire — 10 min is a sensible default and tunable.

Public location page open/copy button

Public location pages were served at /api/locations/{id}/public but had no UI entry point — you could enable a page but not open or share it. Public-enabled locations now show a "Public page ↗" link + a "Copy link" button (absolute URL via window.location.origin, clipboard with a prompt fallback) in the Locations action column.

Testing (dev server)

ruff clean; 11 lightning tests (incl. entry/persist/re-entry-after-clear); locations.html renders; bulk suite 776 passed; migration 0030 verified through the full chain on a restored copy of the real prod DB (head 0030, lightning_last_seen_at present).

🤖 Generated with Claude Code

Two follow-ups from operator feedback on the v1.6.0 lightning release. ## Edge-triggered lightning proximity alerts (#87 follow-up) Replaces the fixed 30-minute cooldown with the requested behavior: - Fires **once when lightning moves into** the radius (not per-strike, not per-refresh). - **Silent while it persists.** - **Re-arms after the area is clear for `LIGHTNING_ALERT_CLEAR_MINUTES`** (default 10). Mechanism: `Location.lightning_last_seen_at` (migration **0030**) is refreshed every poll while lightning is present (committed even when not firing); an alert fires only on the clear→present transition (`prev_seen` is None or older than `clear_minutes`). `LIGHTNING_ALERT_COOLDOWN_MINUTES` is retained but deprecated/unused. No-radius locations stay a no-op. Tuning note: a lull longer than `clear_minutes` within one storm would re-fire — 10 min is a sensible default and tunable. ## Public location page open/copy button Public location pages were served at `/api/locations/{id}/public` but had **no UI entry point** — you could enable a page but not open or share it. Public-enabled locations now show a **"Public page ↗"** link + a **"Copy link"** button (absolute URL via `window.location.origin`, clipboard with a prompt fallback) in the Locations action column. ## Testing (dev server) ruff clean; 11 lightning tests (incl. entry/persist/re-entry-after-clear); `locations.html` renders; bulk suite **776 passed**; migration 0030 verified through the full chain on a **restored copy of the real prod DB** (head 0030, `lightning_last_seen_at` present). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fire once when lightning moves INTO a location's radius, stay silent while it
persists, and re-arm only after the area has been clear for
LIGHTNING_ALERT_CLEAR_MINUTES (default 10) — instead of re-firing on a fixed
30-minute cooldown.

- Location.lightning_last_seen_at (migration 0030), refreshed every poll while
  lightning is present; an alert fires only on the clear->present transition
  (prev_seen is None or older than clear_minutes). last_seen is committed even on
  the present-but-no-fire path so persistence is tracked; when absent it ages out.
- LIGHTNING_ALERT_CLEAR_MINUTES config; LIGHTNING_ALERT_COOLDOWN_MINUTES retained
  but deprecated/unused (kept for .env compat).
- No-radius locations remain a no-op.

Full suite green on the dev server: 776 passed; migration 0030 verified through the
full chain on a real-prod-DB copy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Public location pages were served at /api/locations/{id}/public but had no UI entry
point. Public-enabled locations now show a "Public page ↗" link and a "Copy link"
button (absolute URL via window.location.origin; clipboard with a prompt fallback)
in the Locations action column.
Add v1.6.1 changelog
All checks were successful
CI / test (pull_request) Successful in 4m26s
8ab39cf553
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
claude-bot deleted branch feat/v1.6.1-tweaks 2026-07-22 15:44:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
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!122
No description provided.