Skip to content

DataViews: vendor ValidatedToggleGroupControl - #81450

Open
jorgefilipecosta wants to merge 3 commits into
trunkfrom
update/vendor-toggle-group-control-into-dataviews
Open

DataViews: vendor ValidatedToggleGroupControl#81450
jorgefilipecosta wants to merge 3 commits into
trunkfrom
update/vendor-toggle-group-control-into-dataviews

Conversation

@jorgefilipecosta

Copy link
Copy Markdown
Member

Part of #81230
Follow-up to #81391

What?

Moves ValidatedToggleGroupControl out of the @wordpress/components private APIs and into @wordpress/dataviews, its only consumer.

Why?

See #81230.

How?

The ValidatedToggleGroupControl wrapper now lives in the validated-form-controls folder of the DataViews package, where it reuses the already-vendored ControlWithError foundation and builds on the public __experimentalToggleGroupControl export instead of private APIs. The component, its story, and its private API registration are removed from the components package, and the mention of its delegate-based implementation is dropped from the overview doc. Its unit test moves along with it.

This control validates through a visually hidden "error delegate" radio input, so the delegate styles (__wrapper-with-error-delegate, __error-delegate) move into the DataViews stylesheet too, renamed from the components-validated-control namespace to dataviews-validated-control.

Testing Instructions

  1. Run the unit tests: npm run test:unit -- packages/dataviews/src/components/validated-form-controls/test/
  2. Optionally, start Storybook with npm run storybook:dev, open DataViews → DataForm → Validation, and verify validation on the toggle group field: submitting with no option selected shows the required error, choosing an option other than Option 1 shows the custom rule error with the red highlight on the control, and choosing Option 1 clears it.

Use of AI Tools

This PR was authored with the assistance of AI tools and reviewed by the author.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Components, [Package] DataViews.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

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 props-bot label.

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: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>

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

@github-actions github-actions Bot added [Package] Components /packages/components [Package] DataViews /packages/dataviews labels Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Size Change: +282 B (0%)

Total Size: 7.71 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 459 kB +111 B (+0.02%)
build/scripts/components/index.min.js 256 kB -108 B (-0.04%)
build/scripts/edit-site/index.min.js 333 kB +56 B (+0.02%)
build/scripts/editor/index.min.js 530 kB +66 B (+0.01%)
build/scripts/media-utils/index.min.js 153 kB +110 B (+0.07%)
build/styles/components/style-rtl.css 16.4 kB -8 B (-0.05%)
build/styles/components/style-rtl.min.css 13.8 kB -8 B (-0.06%)
build/styles/components/style.css 16.5 kB -8 B (-0.05%)
build/styles/components/style.min.css 13.8 kB -8 B (-0.06%)
build/styles/edit-site/style-rtl.css 21.7 kB +10 B (+0.05%)
build/styles/edit-site/style-rtl.min.css 17.8 kB +11 B (+0.06%)
build/styles/edit-site/style.css 21.7 kB +11 B (+0.05%)
build/styles/edit-site/style.min.css 17.8 kB +12 B (+0.07%)
build/styles/editor/style-rtl.css 31.8 kB +8 B (+0.03%)
build/styles/editor/style-rtl.min.css 27.1 kB +9 B (+0.03%)
build/styles/editor/style.css 31.9 kB +9 B (+0.03%)
build/styles/editor/style.min.css 27.1 kB +9 B (+0.03%)

compressed-size-action

@github-actions

Copy link
Copy Markdown

Flaky tests detected in 63997f6.
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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/31518839054
📝 Reported tests:

three users concurrently edit a large post with diverse blocks in /test/e2e/specs/editor/collaboration/collaboration-stress.spec.ts, passed after 1 failed attempt.
TimeoutError: locator.waitFor: Timeout 17500ms exceeded.
Call log:
  - waiting for getByRole('button', { name: /Collaborators list/ }) to be visible

    at map (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/fixtures/collaboration-utils.ts:192:7)
    at CollaborationUtils.waitForMutualDiscovery (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/fixtures/collaboration-utils.ts:187:10)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-stress.spec.ts:416:28

.dataviews-validated-control__wrapper-with-error-delegate {
position: relative;

// For ToggleGroupControl

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.

Image

@jorgefilipecosta
jorgefilipecosta force-pushed the update/vendor-toggle-group-control-into-dataviews branch from 4ff9e18 to 8a6ec2e Compare August 12, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Package] DataViews /packages/dataviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants