Skip to content

fix(ui): localize the date picker and let the keyboard clear it - #3759

Merged
yannickmonney merged 2 commits into
mainfrom
fix/date-picker-locale-clear
Sep 28, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/date-picker-locale-clear

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

The shared date picker now follows the UI language and can be cleared from the keyboard. German and French dates, month names, weekday names, day-choice accessible names, and month-group accessible names are localized; German and French weeks start on Monday. Swiss German uses the German calendar. The range picker uses the same locale and accessible labels. Stored values remain local midnight in milliseconds.

The clear action is a named 24px button beside the trigger. Enter or Space clears the value, removes the button, and returns focus to the date trigger without opening the calendar. Each control has its own visible focus indicator.

Validation on the reviewed head:

  • 51 focused shared UI unit and locale tests pass, including six DE/de-CH/FR accessible-label regressions that failed before the review correction.
  • 17 Chromium tests pass. Native keyboard and date-selection flows cover EN, DE, de-CH and FR at 390px in dark mode and 1280px in light mode, with local-midnight values, focus after clearing, target size and no horizontal overflow.
  • Shared UI typecheck and typed lint pass. Manual registry and the tasks guide check pass. React Doctor reports only the existing date-range-picker complexity warning.
  • Manual boxes TASK-F45 and TASK-A12 document localized calendars and keyboard clearing; their IDs preserve the recurrence feature's reservations.

The first browser run after rebasing triggered Vite dependency re-optimization and duplicate React in two existing recurrence target-size cases. All date cases passed; the settled rerun passed all 17 cases.

Existing library limitation: react-datepicker hardcodes the selected-date live-region sentence in English and exposes no translation prop for it. Its supported day/month label props are now translated. The range picker's input continues to display numeric dates. These tests inspect accessible names and focus; physical screen-reader speech was not tested.

@yannickmonney
yannickmonney force-pushed the fix/date-picker-locale-clear branch from 81f88c9 to b01b75f Compare September 28, 2026 20:50

@yannickmonney yannickmonney left a comment

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.

Independent local review at b01b75f2a91081818e2cef529c18ba8432827832: the three focused DatePicker, range-picker and locale-hook suites executed here, 41 tests passed. Source review confirms the named sibling Clear button and focus return, plus locale-aware display/month/week handling. This supports the scoped repairs for #3743 and the visible-date portion of #3744; it is not a full acceptance or browser-layout verdict.

Please finish the configurable accessible day labels in this same localization change. Two additional actual-component checks reproduce the disclosed leftover:

  • German: Choose Montag, 31. August 2026
  • French: Choose lundi 31 août 2026

The dependency exposes chooseDayAriaLabelPrefix and disabledDayAriaLabelPrefix, so those can use EN/DE/FR package messages in both single and range pickers. Add assertions for the accessible labels as well as visible month text. Keep the separate upstream live-announcement limitation explicit rather than treating it as evidence that the configurable prefixes cannot be fixed. This is follow-through on the existing localization report, not a new counted audit finding.

Validation limits: all 43 checks here used actual components in jsdom; I did not rerun your Chromium suite or the full repository gate. The initial isolated test setup needed a dependency-path/asset allowlist correction before the tests ran; those setup failures are not product defects. React Doctor ran, but its detached-checkout scan covered the whole package (65/100 with existing diagnostics), so that score is not a change-specific regression verdict. Root checkout remains untouched; no production tests, merge or deployment.

@yannickmonney yannickmonney left a comment

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.

Revision review at 4c0f418d4a2dd4b72ca1a1a9f40a45631ccdbb42: the requested configurable day-choice and month-group labels now use the EN/DE/FR package catalogs in both the single and range pickers (de-CH inherits German). Fresh execution of the DatePicker, range-picker and locale-hook suites passed 42/42 tests, including all four locale cases. I read the nine-file delta from b01b75f; the two runtime changes are the translation props and the manual box now covers the accessible labels. The previously observed Choose Montag / Choose lundi issue is addressed. No additional blocker found in this scoped delta.

This is a source and actual-component jsdom review. I did not execute the added Chromium tests or the full repository gate, and it is not a browser-layout acceptance claim. The separate upstream live-announcement limitation remains outside this repair. No production testing, merge or deployment.

The date picker formatted with date-fns and no locale, so German and
French users read "Sep 29, 2026" and an English calendar with a Sunday
week start. Both pickers now take the date-fns locale of the active UI
language (de-CH follows de); the stored local-midnight value is
unchanged.

Its clear control was an aria-hidden button outside the tab order, so
keyboard and screen-reader users could not remove a date. It is now a
named 24px button beside the trigger with its own focus ring, and focus
returns to the trigger after clearing.
@yannickmonney
yannickmonney force-pushed the fix/date-picker-locale-clear branch from 4c0f418 to 1b25efe Compare September 28, 2026 22:10
@yannickmonney
yannickmonney merged commit 3257d0e into main Sep 28, 2026
49 checks passed
@yannickmonney
yannickmonney deleted the fix/date-picker-locale-clear branch September 28, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant