Skip to content

feat(admin): draw an account's days as a calendar - #461

Merged
dastratakos merged 1 commit into
mainfrom
dastratakos/admin-account-calendar
Aug 22, 2026
Merged

feat(admin): draw an account's days as a calendar#461
dastratakos merged 1 commit into
mainfrom
dastratakos/admin-account-calendar

Conversation

@dastratakos

@dastratakos dastratakos commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

What

An intensity calendar of the account's activity on the admin account detail page, under the existing "Daily use · hosted tier" bar chart. The bars stay — they carry magnitude — and the calendar carries the pattern they hide: weekday rhythms, weekend gaps, and streak breaks.

  • GitHub-style layout: columns are UTC weeks keyed by their Monday (the retention grid's weeks), rows the seven weekdays, cells the window's days. Weekday and month labels wear the page's mono micro-label style, and each cell carries a title like Aug 12 — 5 voice · 3 attention, with the page's "(so far today)" wording on the partial day.
  • Cell intensity is the retention grid's own technique — color-mix(var(--chart-1) P%, transparent) with the same 8% floor so a one-call day stays a visible mark — scaled against the account's own busiest day in the window. One deliberate reading of the spec: the retention grid mixes in oklab, not in oklch, so the calendar reuses the grid's expression verbatim to keep the page on one interpolation space (mixing into transparent makes the two visually indistinguishable anyway).
  • A covered day with no calls keeps the faintest neutral fill so absence still reads as an observed day; a day outside the window (before its start, or after today) draws nothing. Today wears the retention grid's dashed provisional border, derived from generatedAt via the existing partialDayKey helper, never the browser clock — a fade here would pose as a quiet day.
  • Render rule: the calendar draws only for windows past a week (30d and 90d). A 7-day window folds to a single column that restates the bars above with less resolution, so the honest answer there is no calendar at all. A window with no calls also draws none — the chart card already says so, and an all-neutral grid would restate the absence.
  • The account skeleton grows a matching card at the calendar's real height, under the same past-a-week rule.

How

Pure presentation; no server changes. The calendar composes from the response the page already holds — the zero-filled activity.daily series, windowDays, and generatedAt. The week folding is a small pure helper, apps/web/src/activity-calendar.ts (calendarWeeks, monthLabels, structurally typed over { day: string } like daily-series.ts), with tests in apps/web/tests/activity-calendar.test.ts covering a window opening mid-week, a window ending on a partial today, the 90-day span's ragged first and last weeks, month labeling, and an empty account.

Verification

  • ./scripts/check.sh passes (exit 0) after rebasing onto feae90a. One earlier full run tripped on apps/desktop/src/main/native/microphone-route.test.ts, which passes in isolation and on re-run — a flaky, unrelated desktop test.
  • Web-only change; no desktop surface touched, so no macOS/notch check applies.
  • Rendered in headless Chrome against stubbed 7/30/90-day responses. At 90d the calendar draws fourteen week columns (~300px) with May–Aug month labels, sitting comfortably inside the card with no horizontal scroll (the overflow-x-auto wrapper is there for narrow viewports); the weekday rhythm, empty weekends, and a stubbed mid-window break all read at a glance, and today draws dashed. At 30d it draws five columns with Jul/Aug labels. At 7d no calendar draws. The loading state shows the new skeleton card in place below the chart skeleton.

🤖 Generated with Claude Code

Automated visual evidence

Download the deterministic macOS evidence · workflow run

  • Commit: cc52eacd3c56ef71e1f542d2a4beb84e691128cb
  • Scenario: smoke
  • Physical-notch check: not performed by CI

The account page's bars carry magnitude but hide pattern: weekday
rhythms, weekend gaps, and streak breaks all vanish into a row of
heights. A GitHub-style intensity calendar under the usage chart folds
the same zero-filled daily series into Monday-keyed UTC weeks — the
retention grid's weeks — and fills each day against the account's own
busiest day in the window, with the retention grid's color-mix
technique and fill floor. A covered day with no calls keeps the
faintest neutral fill, a day outside the window draws nothing, and
today wears the retention grid's dashed border, read off generatedAt.
The calendar draws only for windows past a week: a 7-day window folds
to one column that restates the bars with less resolution. The account
skeleton grows a matching card under the same rule, and the pure
week-folding helper carries its own tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
luke-web Ready Ready Preview Aug 22, 2026 2:57am

Request Review

@dastratakos
dastratakos added this pull request to the merge queue Aug 22, 2026
Merged via the queue into main with commit 85e20bd Aug 22, 2026
10 checks passed
@dastratakos
dastratakos deleted the dastratakos/admin-account-calendar branch August 22, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant