Skip to content

SelectControl: Migrate Query settings to @wordpress/ui - #86560

Merged
ciampo merged 4 commits into
trunkfrom
codex/selectcontrol-query
Nov 11, 2026
Merged

ciampo merged 4 commits into
trunkfrom
codex/selectcontrol-query

Conversation

@ciampo

@ciampo ciampo commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Part of #80412.

What?

Use @wordpress/ui SelectControl for Query Loop's Post type, Order by, and Sticky posts settings.

Why?

Continue the migration in a focused, independently testable block area.

How?

Resolve selected items from the existing options, ignore reselection of the current post type, and give the empty-string Include choice a stable UI identifier.

Testing Instructions

  1. Enable a public custom post type exposed through the REST API so Post type appears as a dropdown. The E2E custom-post-types test plugin provides this setup.
  2. Insert a Query Loop with a post template, select the outer block, and use a custom query.
  3. Change Post type between Post, Page, and a custom type. Check the available options and their order. Page should add Ascending by order and Descending by order to Order by.
  4. Set taxonomy filters for posts or a parent filter for pages. Select the same post type again and confirm the query settings stay unchanged.
  5. Change Order by and each Sticky posts choice. Return to Include, save, and reopen the page. Include should remain selected.
  6. Reset the settings through the Settings options menu and check the default selections.

Testing Instructions for Keyboard

Tab to each selector. Press Enter to open it, use Home and the arrow keys to move between options, and press Enter to select. Reopen and press Escape to dismiss without changing the value. Focus should return to the selector.

Verification

Production build, block-library type check, scoped lint, eight Query unit tests, and the post-type reselection regression repeated three times passed. Keyboard, forced-colors, and Chromium emulated-touch checks passed. Screen-reader testing remains manual.

Screenshots or screencast

Captured in the post editor with Chromium at 1440 × 1000, using the migrated Query Loop inspector.

Post type
State Preview
Closed Post type: closed
Button hovered Post type: button hovered
Button focused Post type: button focused
Dropdown opened Post type: dropdown opened
Item focused Post type: item focused
Item hovered Post type: item hovered
Order by
State Preview
Closed Order by: closed
Button hovered Order by: button hovered
Button focused Order by: button focused
Dropdown opened Order by: dropdown opened
Item focused Order by: item focused
Item hovered Order by: item hovered
Sticky posts
State Preview
Closed Sticky posts: closed
Button hovered Sticky posts: button hovered
Button focused Sticky posts: button focused
Dropdown opened Sticky posts: dropdown opened
Item focused Sticky posts: item focused
Item hovered Sticky posts: item hovered

Use of AI Tools

Implemented and verified with OpenAI Codex, including an independent agent review.

@github-actions

github-actions Bot commented Nov 10, 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>
Co-authored-by: ramonjd <ramonopoly@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: -193 B (0%)

Total Size: 8.63 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 545 kB -131 B (-0.02%)
build/scripts/block-library/index.min.js 426 kB +147 B (+0.03%)
build/scripts/components/index.min.js 336 kB -209 B (-0.06%)

9c664ca Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric dc29126 trunk % Change
timeToFirstByte 50.6 ms +5.14% -6.03% 50 ms +3.5% -4.3% 1.2%
largestContentfulPaint 84 ms +9.52% -7.14% 82 ms +7.32% -7.32% 2.44%
lcpMinusTtfb 29.7 ms +24.75% -3.7% 29.5 ms +26.95% -6.27% 0.68%
wpBeforeTemplate 25.47 ms +4.04% -5.26% 24.8 ms +6.69% -2.78% 2.7%
wpTemplate 20.6 ms +12.09% -5.19% 20.5 ms +4.73% -5.27% 0.49%
wpTotal 46.47 ms +4.99% -6.24% 45.7 ms +4.22% -3.94% 1.68%
wpMemoryUsage 7.72 MB +0% -0% 7.68 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric dc29126 trunk % Change
timeToFirstByte 43 ms +8.6% -5.23% 41.8 ms +2.39% -3.11% 2.87%
largestContentfulPaint 80 ms +7.5% -5% 76 ms +2.63% -0% 5.26%
lcpMinusTtfb 35.7 ms +9.66% -3.5% 34.2 ms +7.02% -2.34% 4.39%
wpBeforeTemplate 22.61 ms +10% -3.8% 21.8 ms +6.51% -1.83% 3.72%
wpTemplate 16.45 ms +3.34% -6.93% 15.81 ms +4.68% -3.1% 4.05%
wpTotal 39.56 ms +8.27% -5.23% 38.41 ms +2.27% -2.79% 2.99%
wpMemoryUsage 6.41 MB +0% -0% 6.37 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric dc29126 trunk % Change
mediaProcessingJpeg 399.09 ms +0.98% -0.46% 395.4 ms +0.82% -0.78% 0.93%
mediaProcessingAvif 5866.61 ms +0.08% -0.3% 5833.58 ms +0.36% -0.35% 0.57%
mediaProcessingJpegToAvif 4003.54 ms +0.32% -0.12% 3980.86 ms +0.16% -0.57% 0.57%

media-upload

Metric dc29126 trunk % Change
jpegUploadProcessing 1522.91 ms +34.09% -1.53% 1495.08 ms +1.38% -1.19% 1.86%
pngUploadProcessing 260.54 ms +2.56% -1.37% 253.84 ms +3.93% -0.67% 2.64%
largeJpegUploadProcessing 1495.18 ms +0.47% -1.03% 1484.58 ms +0.71% -0.53% 0.71%
multipleImageUploadProcessing 1684.65 ms +21.05% -2.32% 2028.64 ms +2.22% -16.58% -16.96%

post-editor

Metric dc29126 trunk % Change
serverResponse 473.13 ms +3.85% -7.93% 458.45 ms +5.7% -5.85% 3.2%
firstPaint 383.6 ms +11.94% -6.06% 402.14 ms +10.89% -7.73% -4.61%
domContentLoaded 801.08 ms +6.64% -2.4% 793.79 ms +1.35% -0.64% 0.92%
loaded 802.1 ms +6.65% -2.38% 794.82 ms +1.37% -0.63% 0.92%
firstContentfulPaint 445.68 ms +11.41% -2.93% 446.87 ms +1.98% -0.35% -0.27%
firstBlock 2151.29 ms +0.73% -1.42% 2155.32 ms +0.95% -1.29% -0.19%
type 15.84 ms +13.01% -3.6% 17.55 ms +4.05% -7.58% -9.74%
typeWithoutInspector 17.37 ms +4.55% -12.15% 16.41 ms +5.24% -6.95% 5.85%
typeWithTopToolbar 22.3 ms +3.86% -4.66% 21.01 ms +4.81% -6.04% 6.14%
typeContainer 8.27 ms +3.99% -8.71% 8.34 ms +3.84% -8.75% -0.84%
focus 118.5 ms +8.63% -1.54% 117.81 ms +6.89% -4.95% 0.59%
firstFocus 253.3 ms +0% -0% 266.27 ms +0% -0% -4.87%
selectAll 401.68 ms +4.14% -1.07% 408.65 ms +0.57% -2.47% -1.71%
undo 27.05 ms +9.98% -4.36% 28.17 ms +10.4% -5.01% -3.98%
listViewOpen 77.8 ms +7.39% -8.61% 77.58 ms +13.25% -4.47% 0.28%
inserterOpen 43.27 ms +6.36% -11.83% 39.39 ms +5.86% -8.43% 9.85%
inserterHover 11.02 ms +7.44% -7.62% 11.23 ms +6.86% -13.54% -1.87%
inserterSearch 7.62 ms +8.14% -1.05% 8.39 ms +1.19% -5.6% -9.18%
loadPatterns 613.5 ms +10.67% -1.14% 640.92 ms +2.94% -6.6% -4.28%
wpTotal 463.53 ms +3.94% -8.09% 448.9 ms +5.8% -5.98% 3.26%
wpMemoryUsage 14.77 MB +0% -0% 14.74 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric dc29126 trunk % Change
serverResponse 314.76 ms +1.93% -10.62% 315.54 ms +1.77% -7.96% -0.25%
firstPaint 339.15 ms +9.75% -6.66% 355.58 ms +4.33% -4.53% -4.62%
domContentLoaded 639.07 ms +2.02% -0.36% 655.37 ms +0.83% -1.16% -2.49%
loaded 639.86 ms +2.01% -0.35% 656.13 ms +0.85% -1.15% -2.48%
firstContentfulPaint 370.29 ms +0.63% -4.02% 371.66 ms +0.8% -0.31% -0.37%
firstBlock 1954.85 ms +0.38% -0.37% 1981.05 ms +1.92% -2.08% -1.32%
type 15.57 ms +1.35% -9.89% 14.34 ms +5.09% -5.79% 8.58%
navigate 90.91 ms +4.34% -4.18% 95.4 ms +3.78% -6.91% -4.71%
loadPatterns 1079.44 ms +5.26% -4.09% 1050.56 ms +15.12% -10.84% 2.75%
loadPages 989.93 ms +2.55% -0.98% 981.48 ms +1.95% -0.47% 0.86%
wpTotal 306.53 ms +1.95% -10.89% 307.19 ms +1.13% -8.16% -0.21%
wpMemoryUsage 12.79 MB +0% -0% 12.75 MB +0% -0% 0.27%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

9c664ca 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.

Navigates the items list via UP/DOWN arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByLabel('Page Two')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByLabel('Page Two') with timeout 5000ms
  - waiting for getByLabel('Page Two')
    14 × locator resolved to <button type="button" tabindex="-1" aria-pressed="false" id="view-list-0-187-item-wrapper" class="dataviews-view-list__item" aria-labelledby="view-list-0-187-label" aria-describedby="view-list-0-187-description"></button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:146:49
Undo restores the post selection when another synced entity is loaded in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 2,
+   "offset": 2,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5

9c664ca Run

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Nov 10, 2026
@ciampo ciampo added the [Type] Enhancement A suggestion for improvement. label Nov 10, 2026 — with ChatGPT Codex Connector
@ciampo ciampo self-assigned this Nov 10, 2026
@ciampo
ciampo marked this pull request as ready for review November 10, 2026 08:54
@ciampo
ciampo requested a review from fabiankaegy as a code owner November 10, 2026 08:54
@ciampo
ciampo requested review from a team, Mamaduka, ramonjd and t-hamano November 10, 2026 08:54
@ciampo
ciampo force-pushed the codex/selectcontrol-query branch from e6cfb08 to 9c664ca Compare November 11, 2026 07:01
@ciampo
ciampo requested a review from ramonjd November 11, 2026 07:03
@ciampo
ciampo enabled auto-merge (squash) November 11, 2026 07:09
@ciampo
ciampo merged commit b354cda into trunk Nov 11, 2026
91 of 93 checks passed
@ciampo
ciampo deleted the codex/selectcontrol-query branch November 11, 2026 07:21
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants