Explorer: day detail view (#138) #171

Merged
claude-bot merged 1 commit from feat/explorer-day into main 2026-08-01 05:04:25 +00:00
Contributor

Closes #138. Second Explorer view, stacked on the calendar (#137/PR #170, merged).

What this adds

GET /explorer/{YYYY-MM-DD} — one day's weather activity grouped by location, linking each event through to its detail page (/explorer/event/{id}, #139 — next PR).

  • Same local-day rule as the calendar: an event belongs to the date it started in its location's own timezone; tested in both directions across the America/Chicago boundary.
  • SPC day band per the #136 decision (outlooks are day-scale context, not event members): per-location convective risk chips (MRGL–HIGH), derived from retained spc_outlook_pages using the same issued-at + forecast-day-offset date math the live AI-context path already uses — bounded to an ~11-day issuance window, never an unbounded scan. Fire-weather and day-4–8 extended outlooks deliberately excluded (different label scales; documented). Most-recent issuance wins on same-day reissues.
  • Bounded queries throughout: one padded event query + one event_id IN (...) members aggregation — no per-event loops.
  • Event rows: local time window, kind icon/label, severity badge (existing classes), title, member summary ("3 hazards · 1 watch · lightning").
  • Archived locations (#134) shown with an "archived" badge; invisible locations simply absent (visible_location_filter).
  • Malformed day → 404 (path param, not a filter); future/beyond-horizon days render an explanatory state; prev/next-day nav clamped to [horizon, today]; back link to the right calendar month.

Verification

Full bulk suite on the dev server: 942 passed (15 new day-view tests: grouping/severity/member-summary/link, DST-boundary day assignment both directions, visibility incl. shared locations, archived badge, malformed/future/beyond-horizon handling, empty state, SPC chip). Template render smoke-tested across normal/empty/out-of-range branches. ruff clean. No migrations, no new JS.

🤖 Generated with Claude Code

Closes #138. Second Explorer view, stacked on the calendar (#137/PR #170, merged). ## What this adds `GET /explorer/{YYYY-MM-DD}` — one day's weather activity grouped by location, linking each event through to its detail page (`/explorer/event/{id}`, #139 — next PR). - **Same local-day rule as the calendar**: an event belongs to the date it started in its location's own timezone; tested in both directions across the America/Chicago boundary. - **SPC day band** per the #136 decision (outlooks are day-scale context, not event members): per-location convective risk chips (MRGL–HIGH), derived from retained `spc_outlook_pages` using the same issued-at + forecast-day-offset date math the live AI-context path already uses — bounded to an ~11-day issuance window, never an unbounded scan. Fire-weather and day-4–8 extended outlooks deliberately excluded (different label scales; documented). Most-recent issuance wins on same-day reissues. - **Bounded queries throughout**: one padded event query + one `event_id IN (...)` members aggregation — no per-event loops. - Event rows: local time window, kind icon/label, severity badge (existing classes), title, member summary ("3 hazards · 1 watch · lightning"). - **Archived locations** (#134) shown with an "archived" badge; invisible locations simply absent (`visible_location_filter`). - Malformed day → 404 (path param, not a filter); future/beyond-horizon days render an explanatory state; prev/next-day nav clamped to [horizon, today]; back link to the right calendar month. ## Verification Full bulk suite on the dev server: **942 passed** (15 new day-view tests: grouping/severity/member-summary/link, DST-boundary day assignment both directions, visibility incl. shared locations, archived badge, malformed/future/beyond-horizon handling, empty state, SPC chip). Template render smoke-tested across normal/empty/out-of-range branches. `ruff` clean. No migrations, no new JS. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add the Explorer day detail view (#138)
All checks were successful
CI / test (pull_request) Successful in 3m52s
8756c96a39
GET /explorer/{day} renders a single day's WeatherEvents grouped by
visible location (name-sorted, archived locations badged, soft-deleted
history still shown per #134), each event showing local start/end
times, kind icon, severity badge, a per-kind member-count summary
("2 hazards · 1 watch"), and a link to the future event-detail page
(#139). A day-scale SPC convective-outlook risk band sits above the
groups, resolving SPCOutlookPage's forecast-day offset to a calendar
date the same way ai_context._spc_local_day already does for live
outlooks, applied here to the stored issued_at (#136: SPC context
stays day-scale, not folded into event members). Malformed days 404;
future/beyond-horizon days render an explanatory empty state rather
than a 500, mirroring the month calendar's clamp behaviour.

app/services/explorer.py: day_summary() (bounded WeatherEvent +
WeatherEventMember queries, Python-side local-day bucketing),
spc_day_band(), parse_day_param()/prev_next_day(), and
build_explorer_day_context().
app/main.py: GET /explorer/{day} route, same auth as /explorer.
app/templates/explorer_day.html: new template.
tests/test_explorer_day.py: helper unit tests plus integration
coverage for grouping, the local-day boundary rule, visibility,
archived badges, the SPC chip, and malformed/out-of-range days.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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!171
No description provided.