Repository navigation
Conversation
The calendar has a fixed size, so stretching its root to the full width of the control left its grid stuck to the start edge, with an uneven gap after it (for example, in the post editor's Date popover). Center it instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +79 B (0%) Total Size: 8.56 MB 📦 View Changed
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I expect my navigation to use the colors I selected for it in
|
Centering the calendar in every date and datetime control moved it in wide inline forms too, where it sat at the start edge before. Restore that layout and center the calendar only inside the panel popover, where the popover is a little wider than the calendar and the uneven gap shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The story defined a datetime field but left it out of the form, so the calendar in a panel popover had no example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
cc @verofasulo |
The popover's width is dynamic and has a floor at 320px. This same issue was discussed at #76325 and the min-width changed to 256 at #76345 but then raised back (intentionally) to 320 at #75204 I'll leave @jameskoster @ciampo comment on this. I'll be happy to reduce the minimum if that's in line with design tokens in place, but I don't consider that decision a blocker to land this fix. |
jorgefilipecosta
left a comment
There was a problem hiding this comment.
From the code point of view things look good 👍 May need some design eyes to validate the approach.
|
I forget if there's a reason why we don't allow it, but the better approach might be to allow calendars to grow to fill their container. |
I've prepared this alternative at #85933 |
|
Coming to this a bit late, and trying to connect some dots: #76325 already identified this issue previously, and at the time the consensus was around reducing the width of the popover from 320px to 256px. The width reduction was implemented in #76345, but then #75204 changed it back to 320px with a note that it is intended "so option labels have more room before truncating". Both this pull request and #85933 treat the popover's width as some fixed value to work within, but the past shows that we'd previously addressed this by changing the popover width itself. Ultimately we'd probably want these to be using tokens anyways, and we have options Certainly not trying to block anything here and this pull request or #85933 would be better than the current state, I just want to make sure we're not retreading ground we've already solved once, and making sure we're clear on what the intended end-state is. |
|
I think that having the calendar stretch would be a better solution, that would decouple from any decision made about the width of the popover. I'll take a look at #85933 |





What?
See #76076 (this comment).
Centers the calendar of the DataForm
dateanddatetimecontrols when they are shown in a panel popover, so it no longer leaves uneven space on its right. This shows up in the post editor's Date popover now that the DataForm-based inspector is stable. Inline forms (for example, the regular layout) keep the calendar at the start edge, as before.Why?
The
CalendarandRangeCalendarcomponents from@wordpress/uihave a fixed size (seven 32px columns). The panel popover is a little wider (at least 320px), so the calendar sat against the start edge with all the spare width after it.How?
packages/dataviews/src/components/dataform-controls/(single date, date range, and datetime) adataviews-controls__calendarclass, replacing the inlinewidth: 100%. The columnStackaround them already stretches them to the full width, so inline forms look the same..dataforms-layouts-panel__field-dropdown. Centering is symmetric, so it works the same in RTL.The post Date field uses the stock
datetimecontrol and its popover has nothing field-specific to target, so the fix applies to every date and datetime field shown in a panel popover (post editor inspector, Quick Edit, and any other DataForm using the panel layout), rather than to the Date field alone.Testing Instructions
layouttopanel-dropdown, and open "Date fields".Testing Instructions for Keyboard
Only the calendar's position changes. Tab into the Date popover and use the arrow keys to move between days to check the calendar still works as before.
Screenshots or screencast
Use of AI Tools
This PR was written with Claude Code (Claude Opus 5.5), which investigated the issue, made the change, and checked it in Storybook and with the unit tests. I reviewed the change.