feat(overview): an activity grid, one cell per history bucket - #97
Closed
Fl0p wants to merge 1 commit into
Closed
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The Overview charts activity as a line, which answers "how much and when" but not "what does a week here look like" — the rhythm question a telemetry front door gets asked most. A Span activity grid now leads the page, under the KPI row. The range picks both the lattice and the bucket width it fetches: 53x7 day cells over a year and over All, 31x6 four-hour cells over a month, 24x7 hourly cells over a week, 24x6 ten-minute cells over a day. Each tiles its window exactly and each is about 115px of cells, so switching range does not move the page. /history grows two sub-day bucket widths, 10m and 4h, so the grid asks for exactly the cell it draws instead of re-bucketing an hourly series in the page — which could not have produced a ten-minute cell at all. Both are additive, both stay raw-only like hour and report covered_since, and an unrecognised width still falls back to day. Cells outside the queried window are drawn as an outline, never as an empty cell: an empty cell means we looked and found nothing, an outline means we did not look. The scale is cut at the quartiles of the cells in view rather than against the busiest one, which rendered a working week as one flat block of full-intensity cells, and it moves to lib/heat.ts where the History page's two heatmaps now read the same five steps. Co-Authored-By: Daedalus <daedalus@agents.flopbut.local> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fl0p
force-pushed
the
flo-596-overview-histogram
branch
from
August 21, 2026 17:51
a82896e to
05f040c
Compare
Fl0p
pushed a commit
that referenced
this pull request
Aug 21, 2026
A GitHub-contributions-style Span activity block now leads the Overview, directly under the KPI row: a fixed lattice of cells, one /history bucket each, so the page's pulse reads at a glance. The range picks both the grid and the bucket width it fetches — 53x7 day cells on Year and All, 31x6 four-hour cells on Month, 24x7 hourly cells on Week (the requested 27x7 is 189 hours and tiles neither a week nor a day; the transpose keeps one block shape), 24x6 ten-minute cells on Day. /history accepts granularity=10m and granularity=4h, additive and raw-only like hour, reporting the raw floor in covered_since. Cells outside the queried window draw as outlines, never as zeros. The five-step heat scale moves to frontend/src/lib/heat.ts, cut at the quartiles of the cells in view rather than against the busiest cell, and the History calendar and hour-of-day heatmaps adopt it. ADR-0016 records the week-grid transpose, the endpoint choice and the ramp. Squash of PR #97, implemented by Daedalus, reviewed and approved by Prospero. Co-Authored-By: Prospero <prospero@agents.flopbut.local> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Squash-merged to main as a43e972 (local squash per the identity rule; both product calls approved — see FLO-596). Branch deleted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A GitHub-contributions-style Span activity grid leads the Overview, under the KPI row. A line chart answers how much and when; it does not answer what does a week here look like, which is the rhythm question a telemetry front door gets asked most.
The grid
The selected range picks both the lattice and the bucket width it fetches — one bucket, one cell, no client-side re-bucketing:
granularityday4hhour10mOn Year/All that is the identical request the History block already makes, so SWR serves both from one fetch.
Deviation from the ticket, deliberate: it asked for
27 × 7on the week grid. 27 hour-columns × 7 rows is 189 hours = 7.875 days — it tiles neither a week nor a day, so no column would be a fixed hour and no row a fixed day, and the grid would drift three hours per row.24 × 7is exactly the 7-day window and is the shape27 × 7was reaching for. Rationale in the ADR.API
GET /api/v1/historytakes two more bucket widths,granularity=10mand4h. Additive; no existing caller changes; an unrecognised width still falls back todayrather than 400ing. Likehour, both are answered fromspansalone and report the shortfall incovered_since—daily_usagebuckets whole UTC days and cannot produce a sub-day bucket.bucketis now documented as a UTC wall-clock label floored to the width.Two judgement calls worth reviewing
frontend/src/lib/heat.ts; the History page's calendar and hour-of-day heatmaps had a private copy and now read the same five steps.Verification
go vet ./...andgo test ./...green (golang:1.23-bookworm, CGO on). Four new tests pin the two widths' bucket labels in UTC, the raw-only rule, and the unknown-width fallback.npm run build(tsc + vite) green.Follow-up, not in this PR
docs/assets/dashboard-overview.pngstill shows the pre-grid Overview. The Overview shape is also changing onflo-595-overview-activity-block; one re-shoot after both land beats two conflicting ones.ADR-0016
🤖 Generated with Claude Code