Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
This PR aligns DateCalendar’s disabled styling with other disabled form controls by adjusting the selected-day colors, and updates the DataForm “Layout Regular” story to correctly demonstrate separate date and datetime fields.
Changes:
- Adjust selected-day text/background styling for disabled days in
DateCalendar. - Update the DataForm “Layout Regular” story to include both
dateanddatetimefields and correct thedatefield type/value. - Add a components changelog entry documenting the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/dataviews/src/dataform/stories/layout-regular.tsx | Splits the story’s date inputs into distinct date and datetime fields and updates initial data/layout accordingly. |
| packages/components/src/calendar/style.scss | Updates selected-day styling so disabled selected days use muted disabled colors consistent with other controls. |
| packages/components/CHANGELOG.md | Documents the DateCalendar disabled selected-day styling fix in the Components changelog. |
Comments suppressed due to low confidence (1)
packages/dataviews/src/dataform/stories/layout-regular.tsx:72
- This field is labeled as a DateTime option set, but the placeholder/option text still says "Select a date" and "birth date". Consider updating the option labels to reference date/time to avoid confusion when comparing the new
datevsdatetimefields in this story.
id: 'birthdate',
label: 'DateTime as options',
type: 'datetime',
elements: [
{ value: '', label: 'Select a date' },
{ value: '1970-02-23T12:00:00', label: "Jane's birth date" },
{ value: '1950-02-23T12:00:00', label: "John's birth date" },
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ### Bug Fixes | ||
|
|
||
| - `DateCalendar`: Fix disabled selected day having darker background than other disabled controls. [#77138](https://github.com/WordPress/gutenberg/pull/77138) |
There was a problem hiding this comment.
Changelog entry formatting is inconsistent with surrounding bullets (which wrap the PR link in parentheses and end with a period). Please update this line to match the existing pattern so tooling and readability stay consistent.
| - `DateCalendar`: Fix disabled selected day having darker background than other disabled controls. [#77138](https://github.com/WordPress/gutenberg/pull/77138) | |
| - `DateCalendar`: Fix disabled selected day having darker background than other disabled controls ([#77138](https://github.com/WordPress/gutenberg/pull/77138)). |
| .components-calendar__day--selected:not(.components-calendar__range-middle) { | ||
| &:has( | ||
| .components-calendar__day-button, | ||
| .components-calendar__day-button:hover:not(:disabled) | ||
| ) { | ||
| &:has(.components-calendar__day-button:not(:disabled)) { | ||
| color: $components-color-foreground-inverted; | ||
| } | ||
|
|
||
| &:has(.components-calendar__day-button:disabled) { | ||
| color: $components-color-disabled; | ||
| } |
There was a problem hiding this comment.
Within the selected-day rule, the enabled-state :has(.components-calendar__day-button:not(:disabled)) check is redundant because a selected day always contains a day button. You can simplify by applying the inverted text color by default for selected days and only using a single :has(.components-calendar__day-button:disabled) override for the disabled case, reducing selector complexity and :has() usage.
|
Size Change: +54 B (0%) Total Size: 7.74 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 0a13f92. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24130042415
|
|
There's this conversation about whether we go this route or another that's important to figure out for this PR to land: #77127 (comment) |
mirka
left a comment
There was a problem hiding this comment.
I think we can merge this one here, since the styles don't go against the new design system disabled conventions, and there are no immediate @wordpress/ui equivalents to sync with.
Preexisting, but was it intentional that disableNavigation is not true when DateCalendar is disabled in DataForm? (No strong opinion, just checking)
Follow-up to #77090
What?
Fix the disabled state styling of the selected day in the
DateCalendarcomponent so it matches the visual weight of other disabled controls (inputs, selects, etc.).Also adds a
datetimefield to the LayoutRegular story and fixes thedatefield type fromdatetimetodate.Why?
When DataForm date/datetime controls are disabled, the selected day in the calendar had a noticeably darker background (
$components-color-disabled= gray-600,#949494) compared to other disabled controls which use gray-100 (#f0f0f0). This inconsistency made the selected day stand out when it should appear muted like the rest of the disabled form.How?
In
packages/components/src/calendar/style.scss::has()selector for selected day text color from always matching (.components-calendar__day-buttonalways exists) to:has(.components-calendar__day-button:not(:disabled)), so white text only applies to enabled selected days.$components-color-disabled(gray-600) text instead of inverted (white) text.$components-color-disabled(gray-600) to$components-color-gray-100(#f0f0f0), matching the disabledInputControlbackground.In
packages/dataviews/src/dataform/stories/layout-regular.tsx:datetimefield alongside the existingdatefield.datefield type fromdatetimetodate.Testing Instructions
npm run storybook:devTrueFalseUse of AI Tools
Claude Code was used to assist with implementation and to generate this PR summary.