fix: Plan page: balance the activity map margins, caption and key on one line
Back to our planSummary
The Plan page's four-week activity map looks pushed to the right: the date numbers on the left take room, while the squares end close to the screen edge. Give the whole map a small right margin so it sits more evenly, and keep the caption and key on one line, shrinking their text on phones where needed.
Details
Follow-up to #1240 (owner decision, 2026-11-14, text chat, after comparing a mockup of three versions).
- Right margin: add space on the right of the whole calendar map (weekday letters, squares, caption and key together) equal to half the date column plus its gap, so the squares end a little short of the screen edge. The caption and key keep lining up with the first and last squares because they stay in the same grid.
- One line: the caption and the Less-to-More key never go on two lines at ordinary phone widths. Text is body size on phones and steps down one size on the narrowest, and returns to the larger size from tablet widths up, where there is room. The swatches shrink with it.
- Last resort: below the narrowest common phone width the whole key may still move under the caption, as decided on #1233.
- The week strip is unchanged.
Native first: Tailwind classes on the shared HeatMap only; no new component.
Acceptance criteria
- Not done: The calendar map has the right margin described above at phone, iPad and desktop widths, light and dark, with no horizontal scroll at 320 px.
- Not done: The caption and key share one line at 360, 375, 390, 393 and wider phone widths, and on iPad and desktop.
- Not done: The caption starts at the first square and the key ends at the last square at every width.
- Not done: The inset is one named definition tied to the date column, not a copied number.
- Not done: Tests first, axe check passes;
docs/ui/component-set.md, the UI kit and roadmap notes and their generated rule copies change in the same PR. - Not done: The owner has looked at the live page on a phone; recorded on the issue.
Files likely touched
src/platform/ui/HeatMap.tsx, src/platform/ui/HeatMapKey.test.tsx, docs/ui/component-set.md, src/platform/ui/README.md, src/modules/roadmap/README.md, .claude/rules/generated/
Must not touch
The squares' shades, date labels, selection behavior, plan data and the cards below the map.
Area
frontend, ux, styling
Priority
medium
Generated by Claude Code, opens in a new tab