Skip to content

[scheduler] Identify month-view dates and day buttons to screen readers - #24288

Merged
flaviendelangle merged 6 commits into
mui:masterfrom
sviat-barbutsa:fix/scheduler-month-date-names
Dec 4, 2026
Merged

flaviendelangle merged 6 commits into
mui:masterfrom
sviat-barbutsa:fix/scheduler-month-date-names

Conversation

@sviat-barbutsa

Copy link
Copy Markdown
Contributor

Fixes #24279.

In the July month view, NVDA previously announced the July 2 cell only as "Wednesday", which could match any Wednesday in the grid. Its day-number button was also just named "2".

To make these unambiguous for screen reader users, I updated the accessible names across the month grid:

  • Date cells: Now include the month and day alongside the weekday and optional week number. Adjacent-month dates (like June 29 in the July grid) use their own month name.
  • Day buttons: When Day view is available, the button now announces an action label like "Go to July 2". The date formatting respects dateLocale, and the label prefix can be localized via localeText.goToDay.

Testing

  • Screen reader (NVDA 2026.3.1 + Chrome 157 on Windows): Compared the original and patched builds using automated key presses and NVDA's queued speech. On July 2, the report-focus announcement changed from "Wednesday cell focused" to "Wednesday July 2 cell focused". Navigating to the day button in browse mode changed from "2 button" to "Go to July 2 button". I also verified June 29 in the July view and confirmed pressing Enter on the July 2 button still navigates to Day view.

  • Unit & browser tests: The Community Scheduler test suite passed in jsdom (782 tests) and Chromium (802 tests, running Playwright in UTC to match the test suite's timezone).

  • Build & docs: Verified the Scheduler package build and TypeScript type check. The model API documentation generator passed, while the component API docs generator reported the same 44 baseline missing-demo errors as clean master on Windows.

  • I have followed (at least) the PR section of the contributing guide.

@code-infra-dashboard

code-infra-dashboard Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-scheduler 🔺+339B(+0.09%) 🔺+73B(+0.06%)
@mui/x-scheduler-premium 🔺+336B(+0.07%) 🔺+76B(+0.05%)
@mui/x-chat 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

No regressions in 38 benchmarks · precise to ±11.1% (±68.5% at worst) · ran 7m 33s · details


Check out the code infra dashboard for more information about this PR.


const hiddenCount = day.withPosition.length - visibleOccurrences.length;

const dateLabel = formatMonthAndDayOfMonth(locale, day.plainDate);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would combining the weekday header with this month/day string put them in the wrong order in some locales?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right now the cell puts the weekday before the date in every locale, whereas Japanese expects the weekday last. I'll format the weekday, month, and day together so the active locale controls the order, and add tests for both English and Japanese.

@rita-codes rita-codes changed the title [Scheduler] Identify month-view dates and day buttons to screen readers [scheduler] Identify month-view dates and day buttons to screen readers Nov 23, 2026
@rita-codes rita-codes added accessibility a11y type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: scheduler Changes related to the scheduler. type: bug It doesn't behave as expected. and removed type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Nov 23, 2026
@rita-codes

Copy link
Copy Markdown
Member

Thank you so much for picking this up, @sviat-barbutsa, and for testing it with NVDA! Thanks as well to @RyanMcCleary for the clear report and for checking the preview: having a real screen reader user confirm the announcements is very valuable.

I went through the PR. The approach works: the cells get their name from the hidden span in Chromium too, the new tests fail without the fix, the whole x-scheduler* suite passes in jsdom and Chromium, and pnpm l10n gives no diff. Nothing here blocks the merge. There's one accessibility detail I'd like to fix first, plus a few small suggestions.

Bugs (2)

1. 🟡 On the first day of a month, the button's name doesn't contain its visible text

Location: packages/x-scheduler/src/month-view/month-view-row/MonthViewCell.tsx:259

aria-label={localeText.goToDay(formatMonthAndDayOfMonth(locale, day.plainDate))}

On day 1 the button shows the short month (formatMonthShortAndDayOfMonth), but the new name uses the long month. Since aria-label replaces the visible text, the visible label is no longer part of the name, and that fails WCAG 2.5.3 (Label in Name):

Locale Visible Name
en-US Sep 1 Go to September 1
fr-FR 1 juil. Aller au 1 juillet
de-DE 1. Sept. … 1. September

The tests don't catch it because they use May, where both forms are the same in English. Days 2 to 31 are fine: "15" is part of "Go to May 15".

Failure scenario: A speech-control user (Voice Control, Dragon) says "click Sep 1" in the September grid, and nothing matches.

Using the same short format for the name as the visible text would keep them aligned. The full date is still announced by the cell itself, right before the button.

2. ℹ️ The Week view header button, for consistency

Location: packages/x-scheduler/src/internals/components/day-time-grid/DayTimeGrid.tsx:513

This follows up on Ryan's question about the other views. The Week view doesn't have the same problem: its header button is named "Wed 2", so it already identifies the day, and its column header reads "Wednesday, July 2". It only lacks the action that the Month view button now announces ("Go to …"). Keeping this PR to the Month view is perfectly fine. If we want both views to match, it can be a small follow-up.

Tests (2)

1. 🟡 A first-of-month case on another month

Location: packages/x-scheduler/src/month-view/tests/MonthView.test.tsx:71

A test on July 1 or September 1, checking that the button's name contains its visible text, would pin Bugs 1.

2. ℹ️ The clock changes

Location: packages/x-scheduler/src/month-view/tests/MonthView.test.tsx:30, :151

createDate(...) is the more correct form and gives the same instants under TZ=UTC, so nothing gets weaker. It's a bit outside the scope of the PR, though, and eventToolbar.MonthView.test.tsx:11 still uses new Date(...). Whatever you prefer.

Simplifications (1)

1. 🟡 The schedulerId fallback never runs

Location: packages/x-scheduler/src/month-view/month-view-row/MonthViewCell.tsx:216

const dateLabelId = schedulerId ? `${schedulerId}-MonthViewDate-${day.key}` : undefined;

EventCalendar and EventCalendarProvider always set schedulerId with useId(), and MonthViewWeekRow and AgendaView build their ids from it without a guard. Dropping the undefined branch would remove three conditional paths: !dateLabelId, || undefined, and the span without an id.

Docs (2)

1. 🟡 The accessibility page could be shorter

Location: docs/data/scheduler/accessibility/accessibility.md:51

We try to keep these pages lean. The tests already cover the adjacent-month dates, and the localization page covers the new goToDay key. One sentence about what the cell and the button announce would be enough.

2. ℹ️ A removed comment

Location: packages/x-scheduler-internals/src/calendar-grid/day-cell/CalendarGridDayCell.tsx:108

The removed comment said that the aria-labelledby passed by the styled layer is appended. That's still true, and both DayGridCell and now MonthViewCell rely on it, so it's worth keeping (maybe with a mention of the new opt-out).

Verdict

Approve after nits. The fix works and is well tested. Only the first-of-month label needs a change before we merge. Thanks again for the contribution! 🙌

@rita-codes
rita-codes self-requested a review November 23, 2026 09:52
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 24, 2026
@sviat-barbutsa

Copy link
Copy Markdown
Contributor Author

Thanks, Rita. I updated the button label in f99f25e. The September 1 button now shows "Sep 1" and has the accessible name "Go to Sep 1". Could you take another look when you have a chance?

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@rita-codes

rita-codes commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Thanks @sviat-barbutsa, the day 1 label looks good now, and the PR is ready to go once it is updated with master 🙌

#24290 was merged in the meantime, so two things are needed:

  1. Resolve the conflict in MonthViewCell.tsx: the day number button keeps your aria-label and uses the new openDayAndFocus(store, day.plainDate, event) from master as its onClick.
  2. Update the tests that [scheduler] Restore focus when opening a date in Day view #24290 added in EventCalendar.test.tsx (the "opening a date in Day view" block): they look for the day button by its number (String(day), '26', '20'), and it is now named "Go to May 26". There are 4 of them.

I tried it locally and everything passes with those two changes. I will approve and merge as soon as it is updated.
Thank you for taking care of this 🙇‍♀️

@flaviendelangle flaviendelangle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PR review

No merge-blocking findings. The focused MonthView and EventCalendar suites passed in jsdom: 112 tests passed, 3 skipped. No manual screen-reader testing was performed.

Bugs (0)

No findings.

Tests (0)

No findings.

Simplifications (1)

1. 🟡 Remove the unreachable date-label fallback

Location: MonthViewCell.tsx:218

const dateLabelId = schedulerId
  ? `${schedulerId}-MonthViewDate-${day.plainDate.toString()}`
  : undefined;

Both EventCalendar and EventCalendarProvider supply schedulerId through useId(). The fallback adds unnecessary branches for the label ID and column-header inclusion. This was already raised in the earlier review and remains unchanged, with no explicit agreement to defer it.

Failure scenario: Maintenance requires accounting for a missing-ID path that neither supported provider produces.

Fix: Construct dateLabelId directly and set includeColumnHeaderInLabel={false}.

Docs (0)

No findings.

Already tracked

Verdict

Approve after nits - only the previously raised fallback cleanup remains.


🤖 Review generated with Codex

@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 4, 2026
@flaviendelangle
flaviendelangle merged commit 9825dbd into mui:master Dec 4, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y scope: scheduler Changes related to the scheduler. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scheduler] Month view cells and day number buttons don't include the date in their accessible names

4 participants