Skip to content

DataViews: vendor ValidatedCheckboxControl - #81435

Merged
oandregal merged 1 commit into
trunkfrom
update/vendor-checkbox-control-into-dataviews
Aug 11, 2026
Merged

DataViews: vendor ValidatedCheckboxControl#81435
oandregal merged 1 commit into
trunkfrom
update/vendor-checkbox-control-into-dataviews

Conversation

@oandregal

@oandregal oandregal commented Aug 11, 2026

Copy link
Copy Markdown
Member

Part of #81230
Follow-up to #81391

What?

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

Why?

See #81230.

How?

The ValidatedCheckboxControl 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 CheckboxControl export instead of private APIs. The component, its story, its test, and its private API export are removed from the components package. Its unit test moves along with it.

Testing Instructions

  1. Run the unit tests: npm run test:unit -- packages/dataviews/src/components/validated-form-controls/test/checkbox-control.tsx
  2. Optionally, start Storybook with npm run storybook:dev and verify that validation on a DataForm checkbox field (e.g. a required checkbox) still shows the error message as before.

Use of AI Tools

This PR was authored with Claude Code (Claude Fable 5) and reviewed by the author.

@oandregal
oandregal requested a review from gigitux as a code owner August 11, 2026 12:29
Copilot AI balanced review requested due to automatic review settings August 11, 2026 12:29
@oandregal
oandregal requested review from a team, ajitbohra and ntsekouras as code owners August 11, 2026 12:29
@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

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

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

@oandregal
oandregal force-pushed the update/vendor-checkbox-control-into-dataviews branch from 7be115c to c1627c7 Compare August 11, 2026 12:29

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.

Pull request overview

Moves ValidatedCheckboxControl into DataViews, eliminating its private Components API dependency.

Changes:

  • Vendors the validated checkbox wrapper and tests in DataViews.
  • Updates DataForm to use the internal component.
  • Removes the former Components implementation, story, and private export.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/dataviews/src/components/validated-form-controls/test/checkbox-control.tsx Relocates checkbox validation tests.
packages/dataviews/src/components/validated-form-controls/index.ts Exports the internal wrapper.
packages/dataviews/src/components/validated-form-controls/checkbox-control.tsx Vendors the checkbox validation wrapper.
packages/dataviews/src/components/dataform-controls/checkbox.tsx Uses the internal wrapper directly.
packages/dataviews/CHANGELOG.md Records the internalization.
packages/components/src/validated-form-controls/components/stories/checkbox-control.story.tsx Removes the obsolete story.
packages/components/src/validated-form-controls/components/index.ts Removes the former component export.
packages/components/src/private-apis.ts Removes the private API entry.
packages/components/CHANGELOG.md Records the private API removal.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@oandregal
oandregal force-pushed the update/vendor-checkbox-control-into-dataviews branch from c1627c7 to e468037 Compare August 11, 2026 12:31
@oandregal oandregal added the [Type] Code Quality Issues or PRs that relate to code quality label Aug 11, 2026
@oandregal oandregal self-assigned this Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Size Change: +229 B (0%)

Total Size: 7.71 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 457 kB +82 B (+0.02%)
build/scripts/components/index.min.js 256 kB -44 B (-0.02%)
build/scripts/edit-site/index.min.js 333 kB +55 B (+0.02%)
build/scripts/editor/index.min.js 530 kB +107 B (+0.02%)
build/scripts/media-utils/index.min.js 153 kB +29 B (+0.02%)

compressed-size-action

@@ -1,49 +0,0 @@
import { useState } from '@wordpress/element';

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.

Should we keep the story somewhere, or do we think there is already enought coverage in Dataforms stories and this story is not worth it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I thought this would be already absorbed by what we have. Comparing this vs this.

@oandregal
oandregal force-pushed the update/vendor-checkbox-control-into-dataviews branch from e468037 to cd3bc66 Compare August 11, 2026 16:03

@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!

@github-actions

Copy link
Copy Markdown

Flaky tests detected in cd3bc66.
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/31510386197
📝 Reported tests:

can remove menu items in /test/e2e/specs/editor/blocks/navigation-list-view.spec.js, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → POST http://localhost:8889/wp-json/wp/v2/navigation
    - user-agent: Playwright/1.62.1 (x64; ubuntu 24.04) node/20.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 1e72130df4
    - content-type: application/json
    - content-length: 695
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1786637353%7CLYdr2QOBrkaaeuwVtQkohjg1XLjvplQxRj4V7wIMXgK%7C49b78a416c0112d887049206e41a08abc9e91f6d46fc445107d3acb61c8fb391; wp-settings-time-1=1786464554

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:112:39)
    at RequestUtils.createRecord (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/records.ts:20:14)
    at RequestUtils.createNavigationMenu (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/menus.ts:63:14)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/navigation-list-view.spec.js:224:22

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@oandregal
oandregal force-pushed the update/vendor-checkbox-control-into-dataviews branch from cd3bc66 to a17169c Compare August 11, 2026 19:44
@oandregal
oandregal merged commit 4c3f3f4 into trunk Aug 11, 2026
60 checks passed
@oandregal
oandregal deleted the update/vendor-checkbox-control-into-dataviews branch August 11, 2026 20:23
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Aug 11, 2026
shail-mehta pushed a commit that referenced this pull request Aug 12, 2026
Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
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 [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