fix: tackle slowness of CalendarInput and Ethiopic calendar failures#1757
Open
kabaros wants to merge 3 commits into
Open
fix: tackle slowness of CalendarInput and Ethiopic calendar failures#1757kabaros wants to merge 3 commits into
kabaros wants to merge 3 commits into
Conversation
…lag/CI timeouts Bumps @dhis2/multi-calendar-dates from 2.1.2 to 3.0.0-alpha.1, which fixes a broken-memoization bug in useDatePicker causing the year/month navigation lists and day-cell grid to be fully rebuilt (through Intl) on every render, including every keystroke while typing (LIBS-763). Also un-skips the previously-disabled Ethiopic validation test, now that the CLDR48 era-code bug blocking it is fixed in the same release. Adds Jest coverage for gaps documented in the new CLAUDE.md: widget-click day selection for Ethiopic/Nepali, and the format/strictValidation/ pastOnly/dir/numberingSystem/weekDayFormat props, none of which had any test before. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
useDatePicker was receiving validationOptions spread as-is, which is keyed minDateString/maxDateString for validateDateString's benefit - useDatePicker itself destructures minDate/maxDate, so it never actually got the bounds. In strict mode this meant the input correctly rejected an out-of-range date while the calendar widget still navigated to and selected it, instead of falling back to today like useDatePicker's own getInvalidDateResult is meant to for a date it recognizes as invalid. Warning mode was unaffected since it never triggers that fallback path regardless. Adds regression coverage for both the fixed strict-mode case and the (correct, unaffected) warning-mode case, plus a CLAUDE.md gotcha and a trim of that file down to durable, agent-facing guidance rather than a narrative of specific bugs found this session. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CalendarInput's onDateSelect payload carries a validation object that CalendarInput computes itself via multi-calendar-dates' validateDateString - it was never reflected in this package's own types, since CalendarProps (and by extension CalendarInputProps) derived onDateSelect structurally from useDatePicker's bare signature, which knows nothing about it. Adds CalendarInputValidation (derived from validateDateString's own return type rather than duplicated by hand) and CalendarInputOnDateSelectPayload, and overrides onDateSelect on CalendarInputProps specifically, since the bare Calendar widget never produces this field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Contributor
|
🚀 Deployed on https://pr-1757--dhis2-ui.netlify.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Bumps @dhis2/multi-calendar-dates to 3.0.0-alpha.1 also:
The bump to multi-calendar-dates dhis2/multi-calendar-dates#102 bumps it to latest 0.5 and also vendors it to fix the Ethiopic calendar. These changes are breaking in multi-calendar-dates, but none of the changes affect the API of the UI component -⚠️ it might still warrant a breaking change though given the big internal refactor
useDatePickerconsumed signature is unchanged.Fixes: