Skip to content

fix(core): Calendar weekday names widen their column instead of overlapping - #12180

Closed
josephfarina wants to merge 3 commits into
mainfrom
calendar-weekday-width
Closed

josephfarina wants to merge 3 commits into
mainfrom
calendar-weekday-width

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

User impact

In a theme with a larger text size and tighter spacing (for example text size 20 with spacing "less"), the weekday names above every calendar (Calendar, and the DateInput, DateRangeInput and DateTimeInput pickers) ran into each other: "SunMonTueWedThu". Each weekday header was a fixed width, the medium element size, which tighter spacing shrinks to 28px, while its name grows with the theme's text size.

Problem and solution fit

The weekday header's width becomes a min-width of the same size, and each of the seven grid columns becomes minmax(min-content, 1fr) (after an auto week-number column when week numbers show). The header row and the day rows share that grid, so a name wider than the minimum widens its column, the days stay aligned under their names, and when the Calendar is narrower than its natural width the columns still never go below their widest cell. At its natural width the Calendar looks the same. In a Calendar wider than its natural width, each weekday name now sits at the centre of its day column, where before it sat at the column's start; the release note says so.

Expected behavior and authority

component:Calendar FR2 already makes each day button a minimum size that grows with a set text size (spec:AST-102 FR4). The record now says the same for each weekday header, and its verification row names the new browser checks.

Evidence

CalendarTextSize.interaction.browser.spec.ts, against the built Calendar story:

  • Default text size: each of the seven weekday headers is exactly its minimum width.
  • Weekday names set to 24px: each name's glyph box stays inside its header, and no name starts before the previous one ends.
  • Twice the text size, 390px viewport: every text size inside the calendar is doubled, with element sizes unchanged. The calendar, and every element in it, stays inside the 390px width (no inner or page scroll), and each weekday name stays inside its header.
  • Default size: each weekday header is exactly its minimum width and each day button exactly its element size, so the geometry matches the base pixel for pixel.

Scope

Components: Calendar

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • The Calendar unit suites pass, apart from three locale-name cases that fail the same way on the base in this environment (ICU data).
  • Core tsc --noEmit, strict ESLint, Prettier, pnpm check:knowledge and the changeset check pass.
  • The browser checks run in CI.

Writing rubric results

Run over the component:Calendar FR2 edit and its verification row.

R1 narration: none.
R2 research: none.
R3 evidence: the verification cell names the test file and what it proves, including the 390px container check.
R4 rejected alternatives: none recorded.
R5 change references: none.
R6 open questions: none touched.
R7 project status: none.

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 17, 2026 12:17am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 12:29 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 16, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 16, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 4f143cc

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 16, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 16, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec a938a0a

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 16, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. Larger weekday names now widen their columns when the Calendar has room, but at large text sizes on phone-width screens they still run together, and the release note overstates the change. The record edit itself has an engineering owner's approval for this head.

  • When the Calendar is narrower than its natural width, as with large text on a phone-width screen, the seven 1fr columns still split the space evenly, so the header's new min-width (packages/core/src/Calendar/styles.ts:85) does not stop long names colliding, and CI's interaction job fails the new check "at twice the text size the calendar fits a 390px container"; making the name the track minimum, for example grid-template-columns: repeat(7, minmax(min-content, 1fr)) (with auto first when week numbers show), clears both cases and keeps the default 32px columns.
  • The changeset says the default look does not change, but in a Calendar wider than its natural width (the two-month narrow-container story) each weekday name now moves to the centre of its day column, so the release note should say that.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • Changeset, weekday names no longer run into each other with larger text or smaller element sizes: false at phone widths (CI interaction failure; 24px names at a 360px width still overlap).
  • Changeset, each weekday column widens to fit its name: false when the Calendar is narrower than its natural width (columns stay equal shares).
  • Changeset, the default look does not change: false for a stretched Calendar (two-month narrow-container story); true at the natural width (default and week-number frames are identical).
  • Description, the header width becomes a minimum of the same size: verified (styles.ts:85).
  • Description, header and day rows share one seven-column grid of equal 1fr columns: verified (styles.ts:100-103, Calendar.tsx:1193).
  • Description, a wider name widens every column together: true only when the Calendar can reach its natural width.
  • Description, the defect reached the DateInput, DateRangeInput and DateTimeInput pickers: verified for their popovers, which render Calendar; the touch sheets keep their own weekday row.
  • Description, the record now covers the weekday header and its verification row names the new checks: verified.
  • Description, the browser checks prove names stay inside their headers at twice the text size in 390px: false, CI fails that check.
  • packages/core/src/Calendar/styles.ts: blocking finding above.
  • packages/core/src/Calendar/__tests__/CalendarTextSize.interaction.browser.spec.ts: the 390px check fails in CI.
  • docs/specs/components/Calendar/Calendar.spec.md: clear.
  • .changeset/calendar-weekday-header-grows.md: blocking finding above.

Automated review (maintainer link)

Comment thread packages/core/src/Calendar/styles.ts Resolved
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 81b2d5a

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 81b2d5a

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the CI run for this head was cancelled because CI was full, so it needs a re-run before merge.

Both earlier findings are fixed: the day columns now take each weekday name as their minimum, so names no longer collide at phone widths, and the release note now says the names centre in a Calendar wider than its natural width. The new browser checks all pass in Chromium against this head's Storybook build, and the default grid is pixel-identical to main.

  • Optional: the new comment above daysGrid in packages/core/src/Calendar/styles.ts is one 29-word sentence; two short sentences would meet the repository's comment style (suggestion inline).
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Release note, weekday names no longer run into each other with a larger text size or smaller element sizes: verified (24px names at 360px wide and twice the text size at 390px show no overlap; the new browser checks pass).
  • Release note, each weekday column is at least as wide as its name: verified (styles.ts:105, styles.ts:108; measured columns are never narrower than their names).
  • Release note, in a Calendar wider than its natural width each name sits at the centre of its day column: verified (two-month narrow-container story).
  • Release note, at its natural width the Calendar looks the same: verified (default and week-number stories are pixel-identical).
  • Description, the defect reached Calendar and the date-field popovers that render it, because each header was a fixed medium width: verified (styles.ts:83 on main).
  • Description, the header width becomes a minimum and each of the seven columns becomes minmax(min-content, 1fr), after auto with week numbers: verified (styles.ts:85, :105, :108).
  • Description, header and day rows share one grid, so a wider name widens its column and the days stay aligned: verified (Calendar.tsx:1193; measured).
  • Description, below its natural width the columns never go below their widest cell: verified (twice the text size at 390px).
  • Description, the Calendar record now covers the weekday header and its verification row names the new checks: verified (record diff).
  • Description, the four browser checks (default header width, 24px names, twice the text size at 390px, default geometry): verified (all seven checks in the file pass in Chromium on this head).
  • Description, unit suites, type check, strict lint, formatting, knowledge and changeset checks pass: verified (Calendar unit suites 323/323, core build with its type check, strict lint on the changed files, formatting, knowledge and changeset checks).
  • Description, the browser checks run in CI: true of the workflow, but they have not run on this head yet (run cancelled, CI full).
  • packages/core/src/Calendar/styles.ts: non-blocking comment-style suggestion.
  • packages/core/src/Calendar/__tests__/CalendarTextSize.interaction.browser.spec.ts: clear.
  • docs/specs/components/Calendar/Calendar.spec.md: clear.
  • .changeset/calendar-weekday-header-grows.md: clear.

Automated review (maintainer link)

Comment on lines +100 to +102
// A column is never narrower than its widest cell, the weekday name
// included, so columns that share too little width overflow instead of
// running one name into the next.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this is one 29-word sentence with two topics, over the 25-word limit the repository's comment style sets for a description. A shorter form that keeps only the reason:

// The widest cell sets each column's minimum, so a long weekday name never
// overlaps the next. When the width runs out, the grid overflows.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 81b2d5a

@josephfarina josephfarina reopened this Nov 18, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12680 perf(cli): a template's component line resolves its names in one pass, not one full lookup per name
  Author: Joey <[email protected]>
- #12180 fix(core): Calendar weekday names widen their column instead of overlapping
  Author: Joey <[email protected]>
- #12159 feat(cli): make an icon set inside your own app
  Author: Joey Farina <[email protected]>
- #12383 fix(Grid): a responsive column shrinks to a container narrower than minWidth
  Author: Joey Farina <[email protected]>
- #12374 [fix] Icon: a glyph given as name renders and warns, instead of crashing
  Author: Joey Farina <[email protected]>
- #12453 fix(charts): line, area and band default to straight segments
  Author: josephfarina <[email protected]>
- #12296 fix(core): a neutral Badge in a primary or destructive Button meets 4.5:1 on its fill
  Author: Joey Farina <[email protected]>
- #12395 fix(CodeBlock): without a code string, CodeBlock names the prop and the fix in development
  Author: Joey Farina <[email protected]>
- #12260 fix(cli): `astryx component Flex` names Stack first
  Author: Joey Farina <[email protected]>
- #12391 fix(core): a two-lane Toolbar wraps instead of squeezing its start lane
  Author: Joey Farina <[email protected]>
- #12427 fix(core): checkbox and radio marks keep their share of the box a theme sizes
  Author: josephfarina <[email protected]>
- #12725 [experimental] cli: with no icon set, experimental icon names the discover search where it lists packs
  Author: Joey Farina <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12738.

@github-actions
github-actions Bot deleted the calendar-weekday-width branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 81b2d5a8 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant