Skip to content

feat(admin): show as many calendar weeks as fit, at a readable cell size - #468

Merged
dastratakos merged 1 commit into
mainfrom
dastratakos/admin-calendar-fixed-cells
Aug 23, 2026
Merged

feat(admin): show as many calendar weeks as fit, at a readable cell size#468
dastratakos merged 1 commit into
mainfrom
dastratakos/admin-calendar-fixed-cells

Conversation

@dastratakos

@dastratakos dastratakos commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What

The account page's activity calendar keeps one fixed, readable cell size at every viewport and shows however many trailing weeks fit the card — the full year on desktop, a few months on a phone — instead of shrinking cells toward ~4px to force the whole year in. Still no horizontal scroll.

How

  • Fixed geometry: 12px cells with 3px gaps. That keeps the original design's 1rem-cell / 4px-gap proportion, and it is the size at which the full 53-week trailing year fits the desktop card beside the expanded sidebar (53 × 15px + a 28px weekday column ≈ 823px against the card's ~871px content width; at 13px+ the year no longer fits at 1200px). Rounding (rounded-[3px]), the dashed today border, and the always-visible weekday labels return to their full-size treatments everywhere; the tiny-size ring fallback, the container-query label folding, and the clamp() gap/rounding are deleted.
  • Fit by count: a useLayoutEffect measure before first paint plus a ResizeObserver compute how many whole week columns fit beside the fixed-width weekday-label column, and the grid draws the last N weeks (lastWeeks, a new pure fold helper), capped at the trailing year the server already sends — the server is unchanged. Resizing refits live; no partial columns; the grid renders nothing until the first measure lands, which happens pre-paint, so no wrong-width frame ever paints.
  • Honesty follow-through: the heading names the shown span ("trailing year" or "last N weeks"), the caption reads against "the busiest day shown", and the intensity scale is computed over the visible days alone. thinMonthLabels is deleted rather than kept: month labels are set on the whole year and sliced with the weeks, so a column is labeled only where a month opens inside the visible span — openings sit 4+ columns apart, so labels cannot collide at fixed cells (labeling a slice's mid-month first column was the one crowding case the renders showed, and slicing removes it). The newest-weeks slice keeps today's dashed cell in the last column at every width.

Verification

  • ./scripts/check.sh passes (exit 0: repository, type, test, and build checks; the new lastWeeks tests cover N smaller than, equal to, and larger than the available weeks, always ending at the current week).
  • Headless Chrome against the built app with stubbed admin data, viewports 1200/768/390/360px: 53 / 27 / 18 / 16 week columns respectively; one cell's box measured 12×12px with 3px gaps at every width; zero horizontal document overflow and no scroller in the card anywhere; today present, dashed, and in the last column at every width; the instant tooltip verified at both edges at 390px (leftmost and rightmost cells, clamped inside the card); one mid-session resize 1200 → 390 refit the grid live from 53 to 18 columns without a reload. Screenshots inspected and kept untracked under artifacts/admin-calendar-fixed-cells/.
  • 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: e615bc877954992957f217757c804ce7f64dfb77
  • Scenario: smoke
  • Physical-notch check: not performed by CI

The activity calendar stops shrinking its cells to squeeze the trailing
year into any viewport: cells keep one fixed 12px size with a 3px gap —
the original 1rem-cell, 4px-gap proportion, at the size that lets the
full 53-week year fit the desktop card beside the expanded sidebar — and
what flexes is how many trailing weeks are shown. A pre-paint layout
measure plus a ResizeObserver fit the last N whole week columns to the
card's width, capped at the year the server already sends, so a phone
shows a few months, nothing scrolls, and no partial column is cut; the
newest-weeks slice keeps today's dashed column visible at every width.

The squeeze-era thinning machinery goes with it: the ring fallback for
today, the container-query label folding and clamp() geometry, and
thinMonthLabels, replaced by slicing the year's labels with the weeks so
a column is labeled only where a month opens inside the visible span —
openings sit four or more columns apart, so labels cannot collide. The
heading, the caption, and the intensity scale now describe the shown
span alone: fills are read against the busiest day visible, not a
busiest day a narrow surface may have cropped away.

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

vercel Bot commented Aug 23, 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 23, 2026 5:56pm

Request Review

@dastratakos
dastratakos added this pull request to the merge queue Aug 23, 2026
Merged via the queue into main with commit e080c3a Aug 23, 2026
10 checks passed
@dastratakos
dastratakos deleted the dastratakos/admin-calendar-fixed-cells branch August 23, 2026 18:02
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