Repository navigation
fix(ui): localize the date picker and let the keyboard clear it - #3759
Conversation
81f88c9 to
b01b75f
Compare
yannickmonney
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
4c0f418 to
1b25efe
Compare
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:
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.