Edge Health time-window toggle (24h / 7d / 30d) — parked 2026-05-17

DARE.CO.UK · PARKED SKETCH · 2026-05-17

Mirrored from ~/.claude/.../memory/project_edge_health_time_toggle_parked.md. This is a design sketch parked for future build — read for context, not as a current deliverable.

Dan’s end-of-day ask 2026-05-17. Add a pill-style time-window toggle (24h / 7d / 30d) above the Edge Health 4-card row. Verified 2026-05-17 evening — both adapters (httpRequests1hGroups for 24h, httpRequests1dGroups for 7d/30d) already wired in dare_cf_analytics.py; build is ~45 min UI binding + per-card reframe per window. 90d stays as the static cards’ baseline, not a toggle option.


Dan, 2026-05-17 end-of-day: “add a toggle to ‘edge health’, similar pattern [screenshot of 24h / 7d / 30d pill]. Plumbing is complete already, should be easy enough to model. It should give great feedback.”

Visual reference (Dan’s screenshot):

Three-pill toggle showing 24h / 7d / 30d, with 24h selected (dark filled, white text)

Same pattern as the existing Trend/Live cache-chart toggle and the Weekday/Month bar-chart toggle. Pill background, dark-filled active state, light hover.

Why “plumbing is already complete”:

The current Edge Health adapter (_edge_health_cards() in dare_cf_analytics.py) queries CDN, security layer, and DNS provider sitting in front of dare.co.uk.">CF GraphQL via httpRequests1hGroups (or similar). The same query accepts arbitrary time-range parameters — 24h is the current default; 7d and 30d are 1-line since/until adjustments. The card-rendering function takes the resulting numbers; no re-architecting needed.

Sketch:

STASH6

Each card already has a delta (vs prior period); the toggle reshapes WHICH prior period the delta references and which window the headline number summarises.

Cycle pre-fill (sketch · strategise · audit · plumbing · UI):

Expected build time: ~45 min total via the full cycle. The “plumbing complete” observation makes this a small UI bind, not a multi-day rebuild.


Verified plumbing + per-card reframe — 2026-05-17 evening

After Dan flagged the screenshot of the current Edge Health row, I checked the adapters in ~/bin/dare_cf_analytics.py. Both required granularities are already wired:

Window CDN, security layer, and DNS provider sitting in front of dare.co.uk.">CF GraphQL query Adapter Already in use for
24h httpRequests1hGroups (hourly buckets) fetch_hourly() at line 330 Live trend chart toggle (cache chart)
7d httpRequests1dGroups (daily buckets) fetch() at line 248 Daily heatmap, current 90d cards
30d httpRequests1dGroups (daily buckets) Same as 7d, wider since/until Same — just narrower than current 90d call

No new query shape, no new auth, no new code path. The toggle is wiring + UI, not infrastructure.

Per-card reframe (the 4 Edge Health cards)

Current state (per Dan’s 2026-05-17 screenshot): two cards already say “(90d)” in their title because their meaning collapses without a window; two cards are point-in-time (“today” / “right now”). The toggle reframes each card per window:

Card 24h 7d 30d
cache hit rate “right now” — last 24h ratio, vs prior 24h “this week” — 7d ratio, vs prior 7d “this month” — 30d ratio, vs prior 30d
bandwidth offloaded “today” — single-day GB “weekly” — 7d GB “monthly” — 30d GB
threats blocked today’s count + vs 7d avg (current copy) weekly count + daily avg monthly count + weekly avg
5xx error share “today’s %” “rolling 7d %” “monthly %”

Baseline label shifts per window

Top-right copy (currently vs 90-day baseline · click any alert to view in Cloudflare) needs to switch per window: - 24h selectedvs prior 24h · click any alert to view in Cloudflare - 7d selectedvs prior 7d · click any alert to view in Cloudflare - 30d selectedvs prior 30d · click any alert to view in Cloudflare

The “click any alert to view in Cloudflare” tail stays constant; only the baseline-period phrase moves.

Why not include 90d in the toggle?

The current cards already render a 90d view as the static default (that’s what’s in Dan’s screenshot — “bandwidth offloaded (90d)”, “5xx error share (90d)”, and the implicit “+45pp vs 90 days ago” delta on cache-hit-rate). 90d is the long-baseline context the cards live inside. The value of the toggle is the shorter windows — “what’s happening now / this week / this month” reads that the 90d view can’t surface. Adding 90d as a toggle option would just duplicate the static default.

If a user ever needs to drop the 90d frame entirely and only see (say) 7d in isolation, the current toggle pattern already supports it — they pick 7d and the baseline phrase + per-card numbers re-render coherently. The 90d static framing is “the page’s resting state,” not “one of four toggle options.”

Implementation specifics (resolved from the parked decisions above)


Why this gives “great feedback” (Dan’s words):

The current dashboard answers “what’s happening RIGHT NOW” (24h). The toggle adds “what’s been happening THIS WEEK” and “what’s the MONTHLY normal” — different mental models, different decisions enabled:

Three reads from one toggle. Each card more useful at each horizon. Dan can decide which one’s the daily-glance default later; today’s data only supports the 24h read.

Cross-section applicability (Dan, also 2026-05-17 — “All the headings can have this carry-over”):

The toggle isn’t only for Edge Health. Dan named the canonical set of sections that should all inherit the 24h/7d/30d pattern, each with their own toggle:

Section What 24h vs 7d vs 30d reveals
Edge Health 24h = incident response; 7d = trend; 30d = baseline cache/threats/origin behaviour
Site Health 24h = today’s tripwire snapshot; 7d = “any check spent time amber/red?”; 30d = monthly health baseline (needs accrued history)
Top Paths 24h = today’s hot pages; 7d = weekly performers; 30d = the durable archive winners
Content Types 24h = today’s request mix; 7d/30d = is image/HTML/JSON balance shifting?
Status Codes 24h = today’s error mix; 7d = “is 5xx creeping?”; 30d = the long-tail 404 inventory
Top Countries 24h = today’s geography; 7d/30d = which markets growing, which fading

Same pill markup, same JS click-handler, same ?window=... query parameter into the CDN, security layer, and DNS provider sitting in front of dare.co.uk.">CF GraphQL adapter. Per-section state (each toggle independent) OR global state (one toggle controls all sections) — strategise decision in build session.

Plumbing decision matters: cache adapters keyed by (section, window) so the page can render multiple sections at different windows without re-fetching. CDN, security layer, and DNS provider sitting in front of dare.co.uk.">CF GraphQL rate-limit allows this at ~3× the current query count, well within tier.

Portfolio applicability:

Same pattern lifts to dogwood / audrey / gf.cx dashboards when those exist. The window parameter generalises to any time-series gauge — wherever a dashboard renders a “right now” reading, the toggle adds “and what’s been happening” for free.

Sibling memories:

Resume conditions:

Source: parked_sketch_edge_health_time_toggle_2026-05-17.md · Rendered 2026-05-17 19:02