Skip to content

TimePicker: Migrate the month field to UI SelectControl - #87079

Open
ciampo wants to merge 3 commits into
trunkfrom
codex/time-picker-select-control
Open

ciampo wants to merge 3 commits into
trunkfrom
codex/time-picker-select-control

Conversation

@ciampo

@ciampo ciampo commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

See #80412.

What?

Migrate the Month field in TimePicker to @wordpress/ui SelectControl.

Why?

The publish date and scheduling controls are among the remaining users of the legacy select.

How?

Use the selected month with the existing date calculation for the site's time zone and skip the change callback when the user picks the current month again. Let the trigger shrink beside the day and year fields so a long month name can fit in the popup without stretching the date row.

Testing Instructions

  1. Open a draft post and open the Date field in the post settings. Start with a date on the 31st and choose a month with fewer days. Check that the day moves to the last day of that month and the time stays the same.
  2. Set a future date and check that the Publish button changes to Schedule. Repeat the month change in Pages → Quick Edit and verify the saved date in the site's configured time zone.
  3. With touch input, open the Month field and choose a month. Check that the popup closes and the date picker stays open. In a locale with long month names, check that the day and year fields still fit beside the Month field and that the popup has room for the translated options.

Testing Instructions for Keyboard

  1. Tab to Month and press Enter. Move to another month with the arrow keys and press Enter. Check that the selection changes and focus returns to Month.
  2. Open the list again and press Escape. Check that the month stays selected, focus returns to Month, and the date picker remains open.

Screenshots

Captured in Chromium on Linux at 1440 × 900, with the same date and viewport in each pair. Before uses 3b5195cf76e and after uses ef582d2d24b.

Post editor settings

Closed

Post editor settings, before and after with the Month field closed

Closed, trigger hovered

Post editor settings, before and after with the pointer over the closed Month field

Closed, trigger focused by keyboard

Post editor settings, before and after with keyboard focus on the closed Month field

Dropdown open

Post editor settings, before and after with the Month dropdown open with May selected

Dropdown open, option hovered

Post editor settings, before and after with the pointer over August in the open Month dropdown

Dropdown open, option highlighted by keyboard

Post editor settings, before and after with August highlighted by keyboard in the open Month dropdown

Pre-publish scheduling panel

Closed

Pre-publish scheduling panel, before and after with the Month field closed

Closed, trigger hovered

Pre-publish scheduling panel, before and after with the pointer over the closed Month field

Closed, trigger focused by keyboard

Pre-publish scheduling panel, before and after with keyboard focus on the closed Month field

Dropdown open

Pre-publish scheduling panel, before and after with the Month dropdown open with May selected

Dropdown open, option hovered

Pre-publish scheduling panel, before and after with the pointer over August in the open Month dropdown

Dropdown open, option highlighted by keyboard

Pre-publish scheduling panel, before and after with August highlighted by keyboard in the open Month dropdown

Status panel for a scheduled post

Closed

Status panel for a scheduled post, before and after with the Month field closed

Closed, trigger hovered

Status panel for a scheduled post, before and after with the pointer over the closed Month field

Closed, trigger focused by keyboard

Status panel for a scheduled post, before and after with keyboard focus on the closed Month field

Dropdown open

Status panel for a scheduled post, before and after with the Month dropdown open with May selected

Dropdown open, option hovered

Status panel for a scheduled post, before and after with the pointer over August in the open Month dropdown

Dropdown open, option highlighted by keyboard

Status panel for a scheduled post, before and after with August highlighted by keyboard in the open Month dropdown

Post Date block toolbar

Closed

Post Date block toolbar, before and after with the Month field closed

Closed, trigger hovered

Post Date block toolbar, before and after with the pointer over the closed Month field

Closed, trigger focused by keyboard

Post Date block toolbar, before and after with keyboard focus on the closed Month field

Dropdown open

Post Date block toolbar, before and after with the Month dropdown open with May selected

Dropdown open, option hovered

Post Date block toolbar, before and after with the pointer over August in the open Month dropdown

Dropdown open, option highlighted by keyboard

Post Date block toolbar, before and after with August highlighted by keyboard in the open Month dropdown

Site Editor page settings

Closed

Site Editor page settings, before and after with the Month field closed

Closed, trigger hovered

Site Editor page settings, before and after with the pointer over the closed Month field

Closed, trigger focused by keyboard

Site Editor page settings, before and after with keyboard focus on the closed Month field

Dropdown open

Site Editor page settings, before and after with the Month dropdown open with May selected

Dropdown open, option hovered

Site Editor page settings, before and after with the pointer over August in the open Month dropdown

Dropdown open, option highlighted by keyboard

Site Editor page settings, before and after with August highlighted by keyboard in the open Month dropdown

Pages Quick Edit

Closed

Pages Quick Edit, before and after with the Month field closed

Closed, trigger hovered

Pages Quick Edit, before and after with the pointer over the closed Month field

Closed, trigger focused by keyboard

Pages Quick Edit, before and after with keyboard focus on the closed Month field

Dropdown open

Pages Quick Edit, before and after with the Month dropdown open with May selected

Dropdown open, option hovered

Pages Quick Edit, before and after with the pointer over August in the open Month dropdown

Dropdown open, option highlighted by keyboard

Pages Quick Edit, before and after with August highlighted by keyboard in the open Month dropdown

Pages Date filter

Closed

Pages Date filter, before and after with the Month field closed

Closed, trigger hovered

Pages Date filter, before and after with the pointer over the closed Month field

Closed, trigger focused by keyboard

Pages Date filter, before and after with keyboard focus on the closed Month field

Dropdown open

Pages Date filter, before and after with the Month dropdown open with May selected

Dropdown open, option hovered

Pages Date filter, before and after with the pointer over August in the open Month dropdown

Dropdown open, option highlighted by keyboard

Pages Date filter, before and after with August highlighted by keyboard in the open Month dropdown

Use of AI Tools

Codex implemented the migration, updated and ran tests, and drafted this description.

@github-actions github-actions Bot added the [Package] Components /packages/components label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +223 B (0%)

Total Size: 8.68 MB

📦 View Changed
Filename Size Change
build/scripts/components/index.min.js 346 kB +223 B (+0.06%)

88c24bc Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 6f20222 trunk % Change
timeToFirstByte 45.9 ms +5.12% -8.39% 43.6 ms +5.62% -5.62% 5.28%
largestContentfulPaint 72 ms +5.56% -2.78% 68 ms +2.94% -5.88% 5.88%
lcpMinusTtfb 27 ms +11.3% -12.04% 23.1 ms +5.63% -1.95% 16.88%
wpBeforeTemplate 23.16 ms +16.62% -6.65% 22.44 ms +5.7% -4.23% 3.21%
wpTemplate 17.37 ms +6.45% -4.61% 17.06 ms +3.99% -4.63% 1.82%
wpTotal 42.51 ms +4.75% -9.03% 39.98 ms +6.25% -5.25% 6.33%
wpMemoryUsage 7.75 MB +0% -0% 7.71 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 6f20222 trunk % Change
timeToFirstByte 37.05 ms +7.15% -2.97% 36.35 ms +8.67% -2.34% 1.93%
largestContentfulPaint 68 ms +2.94% -5.88% 66 ms +3.03% -3.03% 3.03%
lcpMinusTtfb 28.65 ms +7.33% -2.79% 28.15 ms +4.62% -1.78% 1.78%
wpBeforeTemplate 20.18 ms +15.01% -1.93% 19.47 ms +16.49% -1.85% 3.65%
wpTemplate 13.53 ms +3.92% -2.44% 13.45 ms +3.27% -2.83% 0.59%
wpTotal 34.13 ms +7.56% -2.67% 33.57 ms +8.79% -3.78% 1.67%
wpMemoryUsage 6.44 MB +0% -0% 6.40 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 6f20222 trunk % Change
mediaProcessingJpeg 324.72 ms +0.66% -0.18% 326.21 ms +0.91% -0.54% -0.46%
mediaProcessingAvif 4858.98 ms +0.24% -0.33% 4868.41 ms +0.23% -0.57% -0.19%
mediaProcessingJpegToAvif 3386.23 ms +0.32% -0.08% 3401.79 ms +0.2% -0.21% -0.46%

media-upload

Metric 6f20222 trunk % Change
jpegUploadProcessing 1470.89 ms +0.93% -1.64% 1450.29 ms +1.44% -0.62% 1.42%
pngUploadProcessing 233.45 ms +4.01% -2.13% 235.49 ms +5.28% -2.45% -0.87%
largeJpegUploadProcessing 1440.75 ms +1.07% -0.88% 1435.43 ms +0.27% -0.18% 0.37%
multipleImageUploadProcessing 1503.45 ms +0.34% -0.32% 1546.23 ms +0.21% -2.06% -2.77%

post-editor

Metric 6f20222 trunk % Change
serverResponse 321.85 ms +2.85% -11.43% 310.64 ms +6.3% -6.17% 3.61%
firstPaint 320.06 ms +18.85% -4.03% 320.51 ms +9% -5.77% -0.14%
domContentLoaded 633.08 ms +11.61% -1.4% 638.7 ms +3.38% -1.46% -0.88%
loaded 633.96 ms +11.58% -1.42% 639.54 ms +3.36% -1.48% -0.87%
firstContentfulPaint 357.98 ms +16.28% -1.23% 360.77 ms +3.59% -2.55% -0.77%
firstBlock 1700.18 ms +3.97% -2.49% 1678.28 ms +1.42% -1.24% 1.3%
type 14.7 ms +4.15% -10.48% 14.48 ms +3.73% -8.01% 1.52%
typeWithoutInspector 14.69 ms +8.44% -10.62% 14.7 ms +4.97% -2.72% -0.07%
typeWithTopToolbar 19.57 ms +11.75% -1.69% 17.61 ms +7.16% -6.08% 11.13%
typeContainer 6.9 ms +3.91% -8.12% 6.58 ms +9.88% -10.64% 4.86%
focus 94.97 ms +4.49% -7.36% 86.93 ms +2.53% -1.18% 9.25%
firstFocus 202.75 ms +0% -0% 199.11 ms +0% -0% 1.83%
selectAll 314.42 ms +0.3% -1.85% 304.09 ms +0.37% -1.94% 3.4%
undo 22.7 ms +9.12% -2.11% 22.56 ms +9.75% -2.75% 0.62%
listViewOpen 61.18 ms +2.26% -10.82% 59.41 ms +24.81% -7.51% 2.98%
inserterOpen 31.54 ms +3.14% -1.87% 32.27 ms +7.13% -1.64% -2.26%
inserterHover 9.41 ms +8.18% -4.25% 9.51 ms +6.52% -6.62% -1.05%
inserterSearch 6.82 ms +12.32% -5.13% 6.59 ms +10.32% -3.49% 3.49%
loadPatterns 500.37 ms +1.36% -2.78% 527.21 ms +9.05% -2.97% -5.09%
wpTotal 313.25 ms +2.63% -11.73% 302.12 ms +6.1% -6.38% 3.68%
wpMemoryUsage 14.81 MB +0% -0% 14.77 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 6f20222 trunk % Change
serverResponse 467.16 ms +1.08% -7.7% 465.24 ms +2.46% -7.52% 0.41%
firstPaint 448.21 ms +4.63% -12.63% 400.35 ms +7.04% -2.95% 11.95%
domContentLoaded 831.83 ms +5.91% -1.29% 828.37 ms +0.43% -1.11% 0.42%
loaded 832.88 ms +5.9% -1.29% 829.47 ms +0.42% -1.14% 0.41%
firstContentfulPaint 474.68 ms +8.33% -3.71% 458.69 ms +1.91% -0.24% 3.49%
firstBlock 2556.34 ms +2.89% -1.16% 2528.24 ms +0.53% -0.25% 1.11%
type 16.61 ms +13.37% -7.65% 17.35 ms +10.78% -6.69% -4.27%
navigate 112.46 ms +5.34% -0.98% 110.29 ms +2.88% -1.79% 1.97%
loadPatterns 1348.31 ms +7.34% -3.63% 1435.62 ms +3.51% -8% -6.08%
loadPages 933.33 ms +1.89% -1.57% 942.75 ms +2.8% -0.44% -1%
wpTotal 457.45 ms +1.14% -7.84% 455.84 ms +2.5% -7.69% 0.35%
wpMemoryUsage 12.82 MB +0% -0% 12.79 MB +0% -0% 0.25%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

88c24bc Run

🏁 Flaky tests

Some 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 want to be able to add multiple close buttons so that users can close the overlay from different positions in /test/e2e/specs/site-editor/navigation-overlay-template-part.spec.js, passed after 1 failed attempt.
Error: expect(locator).toHaveCount(expected) failed

Locator:  getByRole('button', { name: 'Close' })
Expected: 2
Received: 1
Timeout:  5000ms

Call log:
  - Expect "toHaveCount" getByRole('button', { name: 'Close' }) with timeout 5000ms
  - waiting for getByRole('button', { name: 'Close' })
    14 × locator resolved to 1 element
       - unexpected value "1"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-overlay-template-part.spec.js:228:33
Navigates the list via UP/DOWN arrow keys from action buttons in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-170-primary-action-edit-post">Edit</button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:243:5
should select synced pattern in /test/e2e/specs/editor/various/writing-flow.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]') with timeout 5000ms
  - waiting for locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]')
    14 × locator resolved to <div tabindex="0" role="document" draggable="true" data-title="Pattern" data-type="core/block" data-is-drop-zone="true" aria-label="Block: Pattern" id="block-3c8b6dcf-98f0-4465-b37d-b393e9981f15" data-block="3c8b6dcf-98f0-4465-b37d-b393e9981f15" class="block-editor-block-list__block wp-block is-selected is-reusable block-library-block__reusable-block-container wp-block-block block-editor-block-list__layout">…</div>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:1464:5

88c24bc Run

@ciampo ciampo self-assigned this Nov 19, 2026
@ciampo ciampo added the [Type] Enhancement A suggestion for improvement. label Nov 19, 2026
@ciampo
ciampo marked this pull request as ready for review November 19, 2026 15:19
@ciampo
ciampo requested a review from a team as a code owner November 19, 2026 15:19
@github-actions
github-actions Bot requested a review from aduth November 19, 2026 15:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant