Skip to content

feat(admin): make the account calendar a full-width trailing year - #466

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

feat(admin): make the account calendar a full-width trailing year#466
dastratakos merged 1 commit into
mainfrom
dastratakos/admin-calendar-year

Conversation

@dastratakos

@dastratakos dastratakos commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

What

The account page's activity calendar no longer follows the 7/30/90-day window switcher. It is now a trailing-year intensity calendar: always the same span — the last 52 complete UTC weeks plus the current partial one — and always drawn, filling the full card width.

  • The account detail response gains a calendar-specific daily series independent of the window: trailing-year UTC day rows, zero-filled, in the same voice/attention shape as the windowed series (AdminUserSource.usage.calendarByDay, AdminUserDetail.activity.calendarDaily).
  • Per the user's requested convention, the calendar's weeks open on Sunday: rows read Sun..Sat top to bottom and columns are Sunday-keyed UTC weeks. This is the account calendar's own convention — the retention grid and every other weekly surface stay Monday-keyed UTC, and each surface's comment now states its own keying.
  • The calendar draws whatever window is chosen above, and an account with zero calls draws the all-neutral year: at a year's span the quiet grid is itself the answer. Intensity scales to the account's busiest day in the year span, and today keeps the dashed partial-day treatment.
  • Week columns flex to fill the card (fr-unit columns with aspect-square cells), so at the content max-width the ~53 columns span edge to edge; below a 10px cell the grid holds that minimum and the existing horizontal scroller takes over. Month labels mark only a month's first week, so twelve months sit uncrowded.

How

  • apps/web/server/admin/admin-user.ts: calendarDayKeys(now) names the Sunday-opened trailing-year span; the builder zero-fills calendarDaily from the new calendarByDay map.
  • apps/web/server/admin/admin-queries.ts: one additional bounded query in the account read, alongside the existing parallel reads, at the calendar's own start bound.
  • apps/web/src/activity-calendar.ts: the week fold is Sunday-keyed for this surface, with the convention (and its difference from the retention grid's) stated where the keying lives.
  • apps/web/src/AdminDashboard.tsx: the render rule loses the windowDays > DAYS_PER_WEEK and no-calls skips (comment updated to carry the year-span rationale), the grid gains minmax(10px, 1fr) columns with aspect-square cells, weekday labels read Sun..Sat, and the caption says the span is the trailing year regardless of the window above.
  • Tests: the week-fold helper tests are rewritten for Sunday keys (including a 53-column trailing-year fold), and the account shaping tests cover the calendar series' span, zero-fill, Sunday opening, and independence from the window.

Verification

  • ./scripts/check.sh passes (exit 0; one unrelated apps/desktop test, microphone-route.test.ts, flaked in an earlier run and passes standalone and in the clean rerun).
  • Headless Chrome against the dev server with stubbed /api/admin/user payloads built by the real buildAdminUserDetail:
    • 1200px viewport: 371 cells from Sunday 2025-08-17 through today 2026-08-22, grid width equal to the wrapper width (edge-to-edge fill), 13 month labels Aug..Aug uncrowded, dashed today cell bottom-right.
    • Instant tooltip at the first column clamps 1px inside the card's left edge and at the last column 16px inside the right edge, wording intact ("Aug 22 (so far today) · Voice calls 3 · Attention reviews 2").
    • 390px viewport: cells hold the 10px minimum, the wrapper scrolls (270px viewport over a 768px grid), and the tooltip inside the scrolled grid draws clamped within the card, not clipped by the scroller.
    • An all-quiet account draws the full all-neutral year with only the dashed today cell.
  • Web-only change; no desktop surface touched, so no macOS/notch check applies.

🤖 Generated with Claude Code

Automated visual evidence

Download the deterministic macOS evidence · workflow run

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

The account activity calendar no longer follows the 7/30/90-day window
switcher: the server now ships a calendar series of its own — the last 52
complete UTC weeks plus the current partial one, zero-filled — read by one
additional bounded query beside the existing parallel reads. The calendar
always draws, an all-quiet account showing the all-neutral year, intensity
scales to the account's busiest day in the year, and the week columns flex
to fill the card down to a minimum cell size, below which the wrapper
scrolls. Weeks open on Sunday (Sun..Sat rows), the user's requested
convention for this one surface; the retention grid and every other weekly
surface stay Monday-keyed.

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 6:21am

Request Review

@dastratakos
dastratakos added this pull request to the merge queue Aug 22, 2026
Merged via the queue into main with commit 5469fab Aug 22, 2026
10 checks passed
@dastratakos
dastratakos deleted the dastratakos/admin-calendar-year branch August 22, 2026 06:26
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