Skip to content

CustomSelectControl: Remove unused V2 API and align recommendations - #86663

Merged
ciampo merged 7 commits into
trunkfrom
codex/custom-select-control-cleanup
Nov 12, 2026
Merged

ciampo merged 7 commits into
trunkfrom
codex/custom-select-control-cleanup

Conversation

@ciampo

@ciampo ciampo commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

See #80412. Stacked on #86661.

What?

Remove the unused CustomSelectControlV2 API and recommend the WordPress UI select controls for new interfaces. The public legacy controls remain supported.

Why?

V2 has no production consumers or public export. After #86661, the validated wrapper is the only remaining internal CustomSelectControl consumer.

How?

Move the internals required by v1 under custom-select-control, remove V2-only rendering and types, and align Storybook, the component catalog, migration guidance, and the recommendation lint rule.

Compatibility and retained exceptions

The public v1 export, props, callback shape, legacy class names, and validation behavior remain available. Its existing tests cover the retained implementation; the removed suite exercised the unused V2 API, including multiple selection.

This PR adds no runtime deprecation warning or removal date. The validated custom-select wrapper remains, as do native SelectControl usages in TimePicker, QueryControls, TreeSelect, and the DataViews validated wrapper. Native-select behavior and validation require separate compatibility decisions.

The new lint guidance names the UI alternatives and links to both migration guides. The validated native-select wrapper and a test of a native-select render callback have narrow, explained lint exceptions.

Testing Instructions

  1. In Storybook, open CustomSelectControl and check the default, hints, small size, and controlled examples. Their behavior should match the base branch.
  2. Check that the story is marked Not recommended and points to the UI SelectControl migration guide. The UI SelectControl should remain recommended.
  3. Import either legacy select from @wordpress/components in a file checked by use-recommended-components. Check that the lint message names the UI replacement and migration guide.
  4. Check the retained validated custom-select and native-select wrappers. Required-field validation and accessible descriptions should still work.

Testing Instructions for Keyboard

In the legacy CustomSelectControl story, use arrow keys while the dropdown is closed, open it, select with Enter, and dismiss with Escape. Check the selected value and focus return against the base branch.

Verification

The retained component, validated wrapper, FontSizePicker, and recommendation-rule suites pass, 199 tests in total. Type checking, CSS lint, the production build, and the Storybook build pass. The generated catalog snapshot removes only CustomSelectControl.

The editor E2E environment could not start because Docker has exhausted its predefined network address pools. No Docker networks were removed.

Use of AI Tools

Implemented and checked with Codex, including an independent agent review.

@github-actions

github-actions Bot commented Nov 11, 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: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: mirka <0mirka00@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: -474 B (-0.01%)

Total Size: 8.64 MB

📦 View Changed
Filename Size Change
build/scripts/components/index.min.js 336 kB -474 B (-0.14%)

f418e78 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 8cbfe3e trunk % Change
timeToFirstByte 56.35 ms +7.99% -5.32% 56.55 ms +4.77% -4.07% -0.35%
largestContentfulPaint 88 ms +11.36% -4.55% 88 ms +6.82% -4.55% 0%
lcpMinusTtfb 32.2 ms +19.41% -7.3% 30.75 ms +20.65% -6.67% 4.72%
wpBeforeTemplate 29.13 ms +14.66% -2.27% 29.48 ms +9.67% -2.31% -1.19%
wpTemplate 21.78 ms +6.8% -3.49% 21.77 ms +6.38% -4.27% 0.05%
wpTotal 51.88 ms +9.87% -4.41% 52.35 ms +5.21% -3.65% -0.9%
wpMemoryUsage 7.72 MB +0% -0% 7.69 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 8cbfe3e trunk % Change
timeToFirstByte 47.5 ms +4.53% -3.16% 49.05 ms +4.69% -3.16% -3.16%
largestContentfulPaint 84 ms +2.38% -4.76% 84 ms +4.76% -0% 0%
lcpMinusTtfb 35.6 ms +4.78% -3.79% 36.55 ms +1.5% -3.69% -2.6%
wpBeforeTemplate 27.06 ms +6.98% -1.11% 27.52 ms +11.52% -1.93% -1.67%
wpTemplate 16.41 ms +5.73% -3.35% 17.6 ms +3.92% -6.14% -6.76%
wpTotal 44.17 ms +5.55% -3.24% 45.87 ms +4.1% -3.27% -3.71%
wpMemoryUsage 6.41 MB +0% -0% 6.38 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 8cbfe3e trunk % Change
mediaProcessingJpeg 401.01 ms +2.17% -0.81% 402.76 ms +0.25% -1.25% -0.43%
mediaProcessingAvif 6162.68 ms +0.7% -0.37% 6146.22 ms +0.49% -0.51% 0.27%
mediaProcessingJpegToAvif 4251.76 ms +0.33% -0.19% 4260.5 ms +0.23% -0.7% -0.21%

media-upload

Metric 8cbfe3e trunk % Change
jpegUploadProcessing 2026.01 ms +2.85% -2.35% 1967.47 ms +1.3% -21.75% 2.98%
pngUploadProcessing 276.98 ms +3.42% -2.31% 278.05 ms +1.37% -1.87% -0.38%
largeJpegUploadProcessing 1969.68 ms +1.81% -21.66% 2002.59 ms +0.14% -23.47% -1.64%
multipleImageUploadProcessing 2075.86 ms +1.29% -0.63% 2076.34 ms +0.54% -0.14% -0.02%

post-editor

Metric 8cbfe3e trunk % Change
serverResponse 501.67 ms +0.75% -9.83% 508.1 ms +1.3% -7.83% -1.27%
firstPaint 431.98 ms +9.77% -4.72% 462.22 ms +1.94% -8.15% -6.54%
domContentLoaded 835.47 ms +4.89% -1.61% 876.48 ms +1.72% -1.14% -4.68%
loaded 836.56 ms +4.87% -1.55% 877.65 ms +1.71% -1.13% -4.68%
firstContentfulPaint 471.34 ms +7.82% -1.14% 495.06 ms +1.39% -0.57% -4.79%
firstBlock 2238.51 ms +6.95% -1.14% 2332.75 ms +0.23% -0.79% -4.04%
type 18.02 ms +12.49% -3.61% 18.67 ms +10.28% -5.78% -3.48%
typeWithoutInspector 18.43 ms +8.52% -5.26% 19.18 ms +6.41% -9.7% -3.91%
typeWithTopToolbar 25.22 ms +13.96% -14.35% 26.19 ms +18.37% -4.35% -3.7%
typeContainer 9.87 ms +6.59% -14.89% 8.96 ms +16.52% -6.58% 10.16%
focus 127.75 ms +3.72% -6.82% 122 ms +13.51% -5.03% 4.71%
firstFocus 274.91 ms +0% -0% 283.32 ms +0% -0% -2.97%
selectAll 426.02 ms +2.34% -2.47% 434.72 ms +0.16% -0.83% -2%
undo 32.62 ms +3.49% -4.94% 32.05 ms +4.12% -7.3% 1.78%
listViewOpen 86.26 ms +3.45% -5.25% 82.57 ms +10.77% -12.61% 4.47%
inserterOpen 46.02 ms +7.67% -2.63% 47.94 ms +1.77% -6.57% -4.01%
inserterHover 12.78 ms +8.69% -11.19% 11.97 ms +16.12% -8.44% 6.77%
inserterSearch 8.91 ms +2.02% -11.78% 8 ms +10.62% -8.63% 11.38%
loadPatterns 686.84 ms +9.34% -2.15% 723.82 ms +6.2% -5.17% -5.11%
wpTotal 491.95 ms +0.66% -10.02% 498.26 ms +1.27% -7.98% -1.27%
wpMemoryUsage 14.78 MB +0% -0% 14.74 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 8cbfe3e trunk % Change
serverResponse 371.29 ms +7.72% -1.29% 403.85 ms +0.27% -0.35% -8.06%
firstPaint 428.62 ms +3.29% -7.03% 397.9 ms +13.21% -5.72% 7.72%
domContentLoaded 799.03 ms +2.24% -0.81% 800.43 ms +1.26% -0.95% -0.17%
loaded 800.07 ms +2.21% -0.81% 801.51 ms +1.24% -0.93% -0.18%
firstContentfulPaint 444.1 ms +1.97% -1.13% 447.36 ms +1.3% -2.87% -0.73%
firstBlock 2366.02 ms +0.64% -1.31% 2388.45 ms +0.41% -0.29% -0.94%
type 17.23 ms +6.09% -8.65% 17.64 ms +14.23% -6.29% -2.32%
navigate 119.19 ms +1.27% -3.41% 110.86 ms +6.96% -2.87% 7.51%
loadPatterns 1253.84 ms +11.26% -13.75% 1335.7 ms +2.14% -2.41% -6.13%
loadPages 933.92 ms +2.63% -1.53% 928.01 ms +2.77% -0.95% 0.64%
wpTotal 361.96 ms +7.87% -1.24% 394.64 ms +0.29% -0.27% -8.28%
wpMemoryUsage 12.79 MB +0% -0% 12.76 MB +0% -0% 0.24%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

f418e78 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.

Should insert content using the inline inserter in /test/e2e/specs/widgets/editing-widgets.spec.js, passed after 1 failed attempt.

Undo restores the post selection when another synced entity is loaded (RTC WebSocket) 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": 6,
+   "offset": 6,
  }

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
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": 6,
+   "offset": 6,
  }

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
does not select blocks in the canvas preview when editing from the sidebar (Site Editor v2) in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator: getByRole('combobox', { name: 'Search or type URL' })
Expected: focused
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeFocused" getByRole('combobox', { name: 'Search or type URL' }) with timeout 5000ms
  - waiting for getByRole('combobox', { name: 'Search or type URL' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:416:47)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:21
does not select blocks in the canvas preview when editing from the sidebar in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator: getByRole('combobox', { name: 'Search or type URL' })
Expected: focused
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeFocused" getByRole('combobox', { name: 'Search or type URL' }) with timeout 5000ms
  - waiting for getByRole('combobox', { name: 'Search or type URL' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:416:47)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:21
should apply a named font size using the font size buttons in /test/e2e/specs/editor/various/font-size-picker.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:paragraph {"fontSize":"large"} -->
+ <!-- wp:paragraph {"fontSize":"medium"} -->
- <p class="has-large-font-size">Paragraph to be made "large"</p>
+ <p class="has-medium-font-size">Paragraph to be made "large"</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/font-size-picker.spec.js:153:6
should reset a named font size using input field in /test/e2e/specs/editor/various/font-size-picker.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:paragraph {"fontSize":"small"} -->
+ <!-- wp:paragraph {"fontSize":"tiny"} -->
- <p class="has-small-font-size">Paragraph with font size reset using input field</p>
+ <p class="has-tiny-font-size">Paragraph with font size reset using input field</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/font-size-picker.spec.js:216:6
should reset a named font size using the tools panel menu in /test/e2e/specs/editor/various/font-size-picker.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:paragraph {"fontSize":"medium"} -->
+ <!-- wp:paragraph {"fontSize":"small"} -->
- <p class="has-medium-font-size">Paragraph with font size reset using tools panel menu</p>
+ <p class="has-small-font-size">Paragraph with font size reset using tools panel menu</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/font-size-picker.spec.js:178:6

f418e78 Run

@github-actions github-actions Bot added [Package] Components /packages/components [Tool] ESLint plugin /packages/eslint-plugin [Package] Block editor /packages/block-editor [Package] DataViews /packages/dataviews labels Nov 11, 2026
@ciampo
ciampo force-pushed the codex/custom-select-control-cleanup branch from c3f6304 to e4ddf58 Compare November 11, 2026 11:53
@ciampo ciampo self-assigned this Nov 11, 2026
@ciampo ciampo added the [Type] Code Quality Issues or PRs that relate to code quality label Nov 11, 2026
@ciampo
ciampo marked this pull request as ready for review November 11, 2026 11:56
@ciampo
ciampo requested a balanced review from Copilot November 11, 2026 11:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain to block approval.

No open issues 🎉

What changed in this PR

Removes the unused internal CustomSelectControlV2 API as part of the select-control migration in #80412, following the FontSizePicker migration in #86661. Public legacy controls remain supported.

Changes:

  • Moves the internals needed by legacy CustomSelectControl into its own directory and removes V2-only code, types, documentation, and tests.
  • Aligns Storybook, the component catalog, and lint guidance to recommend WordPress UI select controls.
  • Preserves native-select validation and test usages through narrow, documented lint exceptions.
File Description
tools/​docs/​manifest.cjs Removes the deleted V2 README exclusion.
storybook/​components-manifest.yml Removes legacy CustomSelectControl from the catalog.
packages/​eslint-plugin/​rules/​use-recommended-components.js Adds UI replacement guidance for both legacy selects.
packages/​eslint-plugin/​docs/​rules/​use-recommended-components.md Links migration guides and explains retained exceptions.
packages/​eslint-plugin/​CHANGELOG.md Records updated select recommendations.
packages/​dataviews/​src/​components/​validated-form-controls/​select-control.tsx Documents the native-validation lint exception.
packages/​components/​src/​custom-select-control/​style.module.scss Retains legacy styling while removing V2-only variants.
packages/​components/​src/​custom-select-control/​stories/​index.story.tsx Marks the legacy control as not recommended.
packages/​components/​src/​custom-select-control/​README.md Recommends UI SelectControl for new interfaces.
packages/​components/​src/​custom-select-control/​item.tsx Relocates item internals and removes compact sizing.
packages/​components/​src/​custom-select-control/​internal-types.ts Defines types for the retained internal implementation.
packages/​components/​src/​custom-select-control/​index.tsx Uses local internals instead of V2 imports.
packages/​components/​src/​custom-select-control/​custom-select.tsx Houses the retained legacy select implementation.
packages/​components/​src/​custom-select-control-v2/​types.ts Deletes V2-specific types.
packages/​components/​src/​custom-select-control-v2/​test/​index.browser.test.tsx Deletes tests for the removed V2 API.
packages/​components/​src/​custom-select-control-v2/​README.md Deletes V2 documentation.
packages/​components/​src/​custom-select-control-v2/​index.tsx Deletes the unused V2 component entry point.
packages/​components/​src/​custom-select-control-v2/​custom-select.tsx Removes the former shared implementation after relocation.
packages/​components/​CHANGELOG.md Records the internal V2 cleanup.
packages/​block-editor/​src/​components/​responsive-block-control/​test/​index.jsdom.test.tsx Documents the native-select test lint exception.

Review effort: Balanced

Comment thread packages/components/CHANGELOG.md Resolved
@ciampo
ciampo force-pushed the codex/custom-select-control-cleanup branch from e4ddf58 to ed73cfb Compare November 11, 2026 12:39

@ntsekouras ntsekouras left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

'Use `RadioGroupControl` from `@wordpress/ui` instead. See the migration guide: https://wordpress.github.io/gutenberg/?path=/docs/components-radiocontrol--migration-guide',
ResponsiveWrapper: 'Use the CSS `aspect-ratio` property instead.',
SelectControl:
'Use `SelectControl` from `@wordpress/ui` instead, or `Select` for the minimal variant. Retain the legacy control when native select behavior is required. See the migration guide: https://wordpress.github.io/gutenberg/?path=/docs/components-selectcontrol--migration-guide',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when native select behavior is required

Like what? Was this a thing in any of the migrations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring the retained DataViews ValidatedSelectControl, which needs an HTMLSelectElement ref for validation. I've kept that explanation on its import and removed the general caveat from the lint message.

@ciampo
ciampo requested a review from mirka November 11, 2026 15:48
@ciampo

ciampo commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @mirka , I'll address + merge once #86661 gets merged

@ciampo
ciampo force-pushed the codex/font-size-picker-ui-select branch from c46c800 to 5729963 Compare November 12, 2026 09:50
Base automatically changed from codex/font-size-picker-ui-select to trunk November 12, 2026 17:07
@ciampo
ciampo force-pushed the codex/custom-select-control-cleanup branch from 1558d25 to f418e78 Compare November 12, 2026 17:15
@ciampo
ciampo enabled auto-merge (squash) November 12, 2026 17:18
@ciampo
ciampo merged commit 16bb8f9 into trunk Nov 12, 2026
113 of 116 checks passed
@ciampo
ciampo deleted the codex/custom-select-control-cleanup branch November 12, 2026 18:06
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Package] Components /packages/components [Package] DataViews /packages/dataviews [Tool] ESLint plugin /packages/eslint-plugin [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants