feat(admin): show as many calendar weeks as fit, at a readable cell size - #468
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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
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 theclamp()gap/rounding are deleted.useLayoutEffectmeasure before first paint plus aResizeObservercompute 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.thinMonthLabelsis 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.shpasses (exit 0: repository, type, test, and build checks; the newlastWeekstests cover N smaller than, equal to, and larger than the available weeks, always ending at the current week).artifacts/admin-calendar-fixed-cells/.🤖 Generated with Claude Code
Automated visual evidence
Download the deterministic macOS evidence · workflow run
e615bc877954992957f217757c804ce7f64dfb77smoke