Skip to content

test(Calendar): month buttons keep focus at a bound and do not scale under reduced motion - #12363

Open
cixzhang wants to merge 4 commits into
mainfrom
test/calendar-month-buttons-focus-motion
Open

cixzhang wants to merge 4 commits into
mainfrom
test/calendar-month-buttons-focus-motion

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

Test and record fix: prove that Calendar's month buttons keep focus at a bound and do not scale under reduced motion, and remove two stale implementation-gap notes from Calendar FR6.

User impact

  • Keyboard users: a Previous or Next month button that reaches min or max stays focusable with aria-disabled and keeps focus. That already holds on main, since Button became focusable when disabled; this pins it with a test.
  • People who prefer reduced motion: a held press does not scale the month buttons. That already holds on main; this pins it in a real browser.
  • No product change.

Change

  • Calendar.test.tsx: "a month button that reaches the bound keeps focus and stays focusable" (Next month into the month that holds max: aria-disabled, no native disabled, focused before and after a further Enter).
  • New Calendar/__tests__/CalendarMonthButtonPress.interaction.browser.spec.ts: a held mouse press on Next month scales it with full motion and leaves it unscaled under reduced motion.
  • Calendar.spec.md: drops the two closed gaps wherever the record states them: the FR6 implementation-gap notes, the readiness row, the two month-button current-state bullets, and the FR6 evidence gap (which keeps only the mirrored chevron pixels). The FR6 verification row and verified_by name both tests.

Authority

Calendar FR6, spec:AST-085 FR1 and FR4, and design:reduced-motion DR1. The record already requires this behavior; the gap notes were stale.

Evidence

  • At main be7f821, Calendar suites pass 324/324.

  • The browser spec passes in real Chromium (Playwright 1.61.1); WebKit runs in CI.

  • pnpm check:knowledge passes.

  • Preflight at 058f558 (pnpm preflight --browser, a clean worktree on current main): review:pre, build, typecheck, lint, vitest ui, vitest node, knowledge, changesets, the Storybook build and the accessibility specs pass. The interaction-spec step stopped before any test ran with Project(s) "packages/core/src/Calendar/__tests__/CalendarMonthButtonPress.interaction.browser.spec.ts" not found: preflight passes --project chromium before the spec files, so Playwright reads the file as a project name. A separate tooling fix is in progress. Run with the file first, pnpm test:interaction packages/core/src/Calendar/__tests__/CalendarMonthButtonPress.interaction.browser.spec.ts --project chromium passes 3 of 3 runs, both tests each run.

Writing rubric results

  • The record edit removes the two closed gaps wherever the record states them: the FR6 implementation-gap notes, the month-button clause of the readiness row, the two month-button current-state bullets, and the FR6 evidence gap (narrowed to the mirrored chevron pixels). It names the tests in the FR6 verification row and in verified_by.
  • It states the system, in the present tense, with no history.

Owner and land path

  • Owner: Astryx maintainers, fix-loop lane 1.
  • Land path: code review, CI, merge.

…under reduced motion

Calendar FR6 listed two implementation gaps that no longer hold: Button is
focusable with aria-disabled (no native disabled), so a month button that
reaches min or max keeps focus; and Button's press scale does not apply
under reduced motion. A unit test proves the first, and a browser case
proves the press scales with full motion and not under reduced motion. FR6
drops both gap notes and its verification row names the tests.
@vercel

vercel Bot commented Nov 17, 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 20, 2026 10:34am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 20, 2026, 2:24 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 058f558

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Calendar · Storybook 78.4 kB (0) · 11.8 kB CSS (0) 1,814 (0) ✓ · ✓ · ✓

Package size: no published package changed; no new dependencies.

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec b7db2e7

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 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. The two new tests are sound and pass, but the Calendar record still states the two gaps that this pull request removes from FR6.

  • docs/specs/components/Calendar/Calendar.spec.md still says the month buttons go natively disabled at a bound and scale under reduced motion, at line 64 (Compatibility/readiness), lines 316-321 (the two "Month buttons" Current-state impact bullets) and line 294 (the FR6 evidence gap), which contradicts the edited FR6 and the new tests; delete those statements and narrow line 294's evidence gap to the mirrored chevron pixels.

Optionally, add CalendarMonthButtonPress.interaction.browser.spec.ts to the record's verified_by beside the other two Calendar interaction specs. Because the fix edits the record, an engineering owner comments /approve-spec <full head SHA> again on the new head.

Claims and files checked

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

  • Claims:
    • A month button at a bound stays focusable with aria-disabled and keeps focus on main: verified (Calendar.tsx:759-797 renders Button with isDisabled; Button.tsx:1179 sets aria-disabled, no native disabled; the new test passes).
    • A held press does not scale the month buttons under reduced motion on main: verified (Button.tsx:172-188; the new browser spec passes).
    • No product change: verified (only tests and the record change; the built public surface of Core and the themes is unchanged).
    • The new unit test checks aria-disabled, no native disabled, and focus before and after Enter: verified (Calendar.test.tsx:2214-2226).
    • The new browser spec shows a scaled press with full motion and none under reduced motion: verified (CalendarMonthButtonPress.interaction.browser.spec.ts:31-60, 2 of 2 pass).
    • FR6 drops both gap notes and its verification row names both tests: verified (Calendar.spec.md:132, :294).
    • The gap notes were stale and the record already requires the behavior: partly false, since FR6 does but Calendar.spec.md:64, :294 and :316-321 still state the gaps.
    • All Calendar suites pass: verified (324 of 324).
    • The browser spec passes in real Chromium: verified.
    • WebKit runs it in CI: verified in playwright.interaction.config.ts (webkit project); not yet run on this head.
    • The knowledge check passes: verified.
    • The record edit only removes two sentences and names tests: verified (Calendar.spec.md:132, :294).
    • The record states the system in the present tense with no history: partly false, since lines Calendar.spec.md:64 and :316-321 state behavior the system no longer has.
  • Files:
    • docs/specs/components/Calendar/Calendar.spec.md: blocking finding above; non-blocking verified_by note.
    • packages/core/src/Calendar/Calendar.test.tsx: clear.
    • packages/core/src/Calendar/__tests__/CalendarMonthButtonPress.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

The readiness row, the two month-button current-state bullets and the FR6
evidence gap still named the native disabled and reduced-motion gaps. They
are removed; the evidence gap keeps the mirrored chevron pixels, and
verified_by lists the month-button browser spec.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec bc39aa4

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 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. Both tests pass and the Calendar record no longer states either gap, but one line of the pull request description misstates the record change.

  • The "Writing rubric results" line "The record edit only removes two sentences and names tests in a verification row" is false at this head, which also drops the month-button clause from the readiness row, deletes the two month-button Current-state impact bullets, narrows the FR6 evidence gap and adds a verified_by entry; update that line to describe the whole record edit.

The fix is a description edit with no commit, so the existing /approve-spec for this head stays valid. CI has not run yet because the pull request is a draft; it runs once the pull request is marked ready for review.

Claims and files checked

Review mode: full; reason: spec-record

  • Claims:
    • The intent is to pin both month-button behaviors with tests and drop FR6's two stale gap notes: verified.
    • A month button at a bound stays focusable with aria-disabled and keeps focus, already on main: verified (Calendar.tsx:759-797 renders Button with isDisabled; Button.tsx:1210 sets aria-disabled and no native disabled; the new test passes).
    • A held press does not scale the month buttons under reduced motion, already on main: verified (Button.tsx:166-189; the new browser spec passes).
    • No product change: verified (only tests and the record change; the built public surface of Core and the themes is unchanged).
    • The new unit test checks aria-disabled, no native disabled, and focus before and after Enter: verified (Calendar.test.tsx:2214-2226).
    • The new browser spec shows a scaled press with full motion and none under reduced motion: verified (2 of 2 pass in Chromium).
    • The record drops both gaps wherever it states them, and the FR6 verification row and verified_by name the tests: verified (Calendar.spec.md:22, :65, :133, :295, Current-state impact).
    • The record already requires this behavior and the gap notes were stale: verified (FR6's requirement text is unchanged).
    • All Calendar suites pass: verified (324 of 324).
    • The browser spec passes in real Chromium: verified.
    • WebKit runs it in CI: verified in the interaction config and the WebKit job's scope; not yet run on this head (draft).
    • The knowledge check passes: verified.
    • The record edit only removes two sentences and names tests in a verification row: false (above).
    • The record states the system in the present tense with no history: verified.
    • Both commit messages describe their commits accurately: verified.
  • Files:
    • docs/specs/components/Calendar/Calendar.spec.md: clear.
    • packages/core/src/Calendar/Calendar.test.tsx: clear.
    • packages/core/src/Calendar/__tests__/CalendarMonthButtonPress.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

# Conflicts:
#	docs/specs/components/Calendar/Calendar.spec.md
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 706808b

@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. Both new tests pass on this head, the Calendar record no longer states either closed gap, and the description now matches the record change. CI has not run on this head yet because the pull request is a draft; mark it ready for review so CI runs. Optional: the focusable-disabled spec's verification table asks for a real-browser focus check at the Calendar max month, and one more case in the new browser spec would cover it.

Claims and files checked

Review mode: full; reason: merge-touches-pr-files

  • Claims:
    • The intent is to pin both month-button behaviors with tests and drop the stale FR6 gap notes: verified.
    • A month button at a bound stays focusable with aria-disabled and keeps focus, already on main: verified (Calendar.tsx:775, :796 render Button with isDisabled; Button.tsx:1210 sets aria-disabled and no native disabled; the new test passes).
    • A held press does not scale the month buttons under reduced motion, already on main: verified (Button.tsx:166-189; the new browser spec passes).
    • No product change: verified (only tests and the record change; the built public surface of Core and the themes is unchanged).
    • The new unit test checks aria-disabled, no native disabled, and focus before and after Enter: verified (Calendar.test.tsx:2214-2226).
    • The new browser spec shows a scaled press with full motion and none under reduced motion: verified (2 of 2 pass in Chromium).
    • The record drops both gaps wherever it states them, and the FR6 verification row and verified_by name the tests: verified (Calendar.spec.md:22, :65, :133, :300, Current-state impact).
    • The record already requires this behavior and the gap notes were stale: verified (FR6's requirement text is unchanged).
    • The Calendar suites pass (324 tests): verified at this head (324 of 324).
    • The browser spec passes in real Chromium: verified.
    • WebKit runs it in CI: verified in the WebKit job's scope; not yet run on this head (draft).
    • The knowledge check passes: verified.
    • The writing-rubric result describes the whole record edit: verified.
    • The record states the system in the present tense with no history: verified.
    • The commit messages describe their commits accurately: verified.
  • Files:
    • docs/specs/components/Calendar/Calendar.spec.md: clear (the merge with main keeps main's range-band text).
    • packages/core/src/Calendar/Calendar.test.tsx: clear.
    • packages/core/src/Calendar/__tests__/CalendarMonthButtonPress.interaction.browser.spec.ts: clear.

Automated review (maintainer link)

# Conflicts:
#	docs/specs/components/Calendar/Calendar.spec.md
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 20, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 058f558

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 20, 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.

Approved pending CI. Both new tests pin behavior Calendar already has, the Calendar record no longer states either closed gap anywhere, and the new month-button press spec passed both cases in CI's Chromium and WebKit lanes on this head. The required checks started when the pull request left draft and two unit-test shards had not finished, so this approval holds only once they pass. No blocking findings.

  • Optional, and not introduced here: the focusable-disabled spec's verification table still asks for a real-browser focus check at the Calendar max month, and the new focus case runs in jsdom; a third case in the new browser spec would close that row.
Claims and files checked

Review mode: same-head; reason: none

  • Claims:
    • The intent is to pin both month-button behaviors with tests and drop the stale FR6 gap notes: verified.
    • A month button at a bound stays focusable with aria-disabled and keeps focus, and already did on main because Button is focusable when disabled: verified (Calendar.tsx:759-797 passes isDisabled to both buttons; Button.tsx:1185 and :1216 render only aria-disabled; the new unit case).
    • A held press does not scale the month buttons under reduced motion, and already did not on main: verified (Button.tsx:166-205 resolves the press transform to scale(1) under reduced motion; the new browser spec).
    • No product change: verified (two test files and one record; nothing that ships is touched).
    • The new unit case moves Next month into the month that holds max and checks aria-disabled, no native disabled, and focus before and after a further Enter: verified (Calendar.test.tsx:2214-2226).
    • The new browser spec shows a held mouse press scaling the button with full motion and leaving it unscaled under reduced motion: verified (2 of 2 pass in CI's Chromium lane on this head).
    • The record removes the two closed gaps wherever it stated them (the FR6 notes, the readiness row, the two month-button current-state bullets, and the FR6 evidence gap, now only the mirrored chevron pixels), and the FR6 verification row and verified_by name both tests: verified.
    • Calendar FR6, the focusable-disabled spec's FR1 and FR4, and the reduced-motion rule DR1 already require this behavior, so the gap notes were stale: verified (FR6's requirement text is unchanged; the source disproves both notes on main).
    • The Calendar suites pass at 324 tests: verified on this head.
    • The browser spec passes in real Chromium with Playwright 1.61.1: verified (CI's Chromium lane; the repository pins Playwright ^1.61.1).
    • WebKit runs the spec in CI: verified (both cases pass in CI's WebKit lane on this head).
    • The knowledge check passes: verified.
    • Preflight's review, build, typecheck, lint, unit, knowledge, changeset, Storybook build and accessibility steps pass on this head: consistent with CI for every check that has finished; the local preflight run itself was not repeated.
    • Preflight's interaction step stops before any test because it passes --project chromium before the spec files, so Playwright reads the file as a project name: verified (scripts/preflight.mjs:366-367 appends the selected specs after --project chromium, at :544).
    • A separate tooling fix is in progress: verified (#13082 is open and reorders those arguments).
    • Run with the file first, the interaction command passes 3 of 3 runs with both tests each run: consistent (CI ran the same spec with the same config and project, and both tests passed); the three-run repeat was not repeated.
    • The writing-rubric results describe the whole record edit, and the record states the system in the present tense with no history: verified.
    • The commit messages describe their commits accurately: verified.
  • Files:
    • docs/specs/components/Calendar/Calendar.spec.md: clear; the readiness row now names only the two remaining gaps, both listed under Current-state impact.
    • packages/core/src/Calendar/Calendar.test.tsx: clear.
    • packages/core/src/Calendar/__tests__/CalendarMonthButtonPress.interaction.browser.spec.ts: clear; it uses the shared Storybook and Playwright helpers rather than its own.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 058f558a Deployed Nov 20, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant