Repository navigation
fix(core): Calendar nightly audit — provider locale in an announcement, 320px reflow, forced-colors selection - #5453
Conversation
…nt, no 320px overflow, forced-colors selection
Nightly component audit of Calendar (rubric v1.8). Two BLOCKs and two FIXes,
each measured in Chromium before and after.
- I21: the range-cleared announcement formatted its date without the provider
locale, so Intl fell back to the host locale. Nine sibling call sites pass it.
- R1: numberOfMonths={2} overflowed a 320px viewport (scrollWidth 504 against
clientWidth 320) and pushed the next-month button off screen. The months
container now wraps; nothing moves above 488px.
- A14: the selected date lost its fill entirely under forced colors, rendering
identically to every other day. Highlight/HighlightText with
forced-color-adjust: none, the pattern ToggleButton already uses.
- D4/D1: a literal 50% radius and ten raw 2px offsets replaced with
--radius-full and --spacing-0-5.
- Dead srOnly style removed; it hand-rolled VisuallyHidden and nothing used it.
Two tests, each red before the fix and green after, and a narrow-container
story so the sweeps can see the reflow.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsCalendar (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Review loop caught this: the 2px is (--size-element-md − --size-element-sm) / 2, the gap between the day button and its cell, not a step on the spacing scale. Matcha sets --spacing-0-5 to 3px, so tokenising it grew the day's hit target to 42px inside a 40px cell and overlapped adjacent days by 2px. Reverted to the literal, with the geometry recorded so the next reader does not make the same swap. Deriving it with calc() from the two size tokens is the real improvement — it would also close butter's pre-existing 4px dead gap — and wants its own measured change.
|
Thanks — the 320px reflow and the forced-colors selection are both right, and the radius change does something you didn't claim: in y2k the endpoints stop poking out of a square band.
The ten So on matcha adjacent days' hit targets overlap by 2px. The on-scale rule covers padding, margin and gap; an absolute inset is a layout value, sanctioned as-is. On the locale line: #5296 fixes that at the root and was approved this afternoon; #5303 threads the provider locale through all twelve call sites and rewrites this same function. Worth landing #5296 instead of patching call sites one at a time. Needs a merge with main too; #5452 fixed the fixtures CI is red on. Revert the ten insets and I'm happy with the rest. MERGE: hold(request changes — the inset tokens) [Reviewed by Robohands] |
|
Fixed in f0b75aa — reverted to the literal, with the geometry recorded in a comment so the next reader doesn't make the same swap. Confirmed both halves of your evidence against the theme sources: matcha sets Carried, not fixed: deriving the inset with |
|
Nit, not blocking — Still strictly better than the before, where the month was unreachable rather than below it. Carried in the ledger row rather than fixed here. |
No textual conflicts. Calendar.tsx, Calendar.test.tsx, Calendar.doc.mjs and styles.ts auto-merged cleanly alongside upstream's Calendar work (meta#5306 min/max opening month, meta#5453 320px reflow, meta#5120/meta#5303 locale, meta#6121 theme selectors). Merge fallout fixed here: - astracat F4: meta#6121 moved generated variant selectors from bare classes to data attributes, so the calendar-picker defineTheme assertion now expects `.astryx-calendar-picker[data-picker="year"]` instead of the stale `.astryx-calendar-picker.year`, matching how meta#6121 updated the sibling calendar-nav assertion. Red before: "expected ... to contain '.astryx-calendar-picker.year'" (Calendar.test.tsx:1885). - Provider locale: meta#5120/meta#5303 moved the static caption onto the InternationalizationProvider locale and added the @astryx/no-raw-intl-locale lint rule, which the picker option labels (still undefined-locale) now fail. They pass `locale` like the caption again, so the two caption modes keep agreeing on month names. New test "labels the month picker in the provider locale, like the static caption" was red first (es-ES rendered "March", expected "marzo"). Calendar.test.tsx 112/112 green after both.





Nightly component audit of Calendar (
core), rubric v1.8, againstcd1a2daa59a.Every finding below was measured in real Chromium before and after — not read off the source.
What this fixes
🔴 I21 — the cleared-range announcement was spoken in the host locale
Calendar.tsx:465formatted its date withplainDateFormat(date, DATE_FORMAT_WITH_WEEKDAY)and omitted thelocaleargument that the other nine call sites in the file pass.Intl.DateTimeFormat(undefined, …)falls back to the browser's locale, so this one announcement ignoredInternationalizationProvider.The new test makes it concrete — with the provider on
ja-JP:The expected string is the day button's own accessible name, which was already localized correctly. Red before, green after.
🔴 R1 —
numberOfMonths={2}overflowed a 320px viewportMeasured at 320px CSS width:
scrollWidth/clientWidthThe document scrolled sideways (WCAG 1.4.10) and the next-month button sat outside the viewport. The docs actively recommend this configuration — "Show two months side by side when the user frequently selects dates that span a month boundary" — so the layout that failed is the one the component tells people to use.
monthsContainernow wraps. Above 488px nothing moves; below it the second month stacks.Before / after at 320px:
🟠 A14 — the selected date vanished under forced colors
Under
forced-colors: activethe selected day readbackgroundColor rgb(255,255,255)/color rgb(0,0,0)/forced-color-adjust auto— identical to every unselected day, so a Windows High Contrast user could not see which date was selected.Fixed with the pattern
ToggleButton.tsx:56already uses:Highlight/HighlightTextplusforced-color-adjust: none, which a<button>needs because the UA otherwise keeps the native ButtonFace surface and ignores the authored fill. After:bg rgba(5,0,73,0.8),color rgb(255,255,255),forced-color-adjust none. A compiled-rule test guards it, in the same shape as the CheckboxInput / Skeleton / ToggleButton ones.🟡 D4 — a literal radius where a role token exists
borderRadius: '50%'on the day button →radiusVars['--radius-full']. Equivalent only while the box stays square, which is exactly the caveat the radius convention names — and the review found it does more than I claimed: in y2k the range endpoints stop poking out of a square band.↩︎ Withdrawn: the ten
2pxinsetsI originally swapped these for
--spacing-0-5and the review loop blocked it, correctly. That2pxis(--size-element-md − --size-element-sm) / 2— the gap between the day button and its cell — not a step on the spacing scale, and the two only coincide on the neutral theme:On matcha the tokenised version grew the hit target past its cell and overlapped adjacent days by 2px. Reverted to the literal, with the geometry recorded in a comment so the next reader does not make the same swap. An absolute inset is a layout value and is sanctioned as-is.
Deriving it with
calc()from the two size tokens would be better than either, and would also close butter's pre-existing 4px dead gap between adjacent day hit targets. That is its own measured change, not this one.🧹 Dead code
An unused
srOnlystyle that hand-rolledVisuallyHidden(§1 A17) with a deprecatedclip: rect(…). Nothing referenced it.Needs review — carried, not fixed
System-level, filed as #5451: the pressed overlay never paints, library-wide. Calendar's day button has no pressed state, and it turns out it cannot get one at the component level. I added the house
:activeoverlay, measured it, and found it dead: StyleX gives a@media-nested:hovera higher priority bucket than a bare:active, so the compiled hover selector out-specifies the pressed one (3,4,0) vs (3,3,0) and wins while the pointer is down — which is the only time:activematches. The same masking applies toButton's four variants andAvatarGroupOverflow;Buttononly looks fine because itstransform: scale(0.98)still fires. I backed my change out rather than ship dead CSS that reads like a fix, and filed one issue with the compiled-CSS evidence. Cousin of #5442.Everything else here needs a decision rather than a correction, so none of it is touched:
onDayHoveris wired toonMouseEnter/onMouseLeaveand nothing else, so a keyboard user arrowing toward the second endpoint sees no preview of the range they are about to commit. Wiring it to focus is a behaviour change, not a correction.labelprop. A consumer cannot name the widget for its purpose ("Departure date"); the grid's only accessible name is the month it happens to be showing. Adding one is new public API.changeAction, where the convention says async-capable core components ship one. Also new API.focusDateprop, which has no callback, and the focus target does not exist until the new grid has rendered.mode="light"on their<Theme>, so under the dark toolbar global they render light-mode tokens against a dark page and are close to illegible. Visible in the contact sheet. A story fix, and<Theme>'s nested-mode semantics are subtle enough that I did not want to guess in this PR.Verification
pnpm test— Calendar 148 pass (146 + 2 new). Full suite was 7 red on the first push — all inpackages/cli, none Calendar's. #5452 fixed those fixtures on main; main is merged in and the two that CI blocks on now pass locally.pnpm build,pnpm lint:strict(scoped),check:sync,check:changesets,typecheck:docs,check-use-client— clean.pnpm a11y:audit --components Calendar— 0 violations over 20 stories, 0 new baseline entries, baseline file untouched.pnpm rtl:audit --filter Calendar— measured, not N-A'd: D1 auto-pass on 2 icons, curated D2 pass, 0 fail, 0 surprise.assets/pr-5453.Changeset is
patch. No API added, no behaviour broken.