DataViews: vendor ValidatedToggleControl - #81492
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
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.
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. |
1 similar comment
|
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.
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. |
There was a problem hiding this comment.
Pull request overview
Vendors ValidatedToggleControl into DataViews, eliminating its dependency on the Components private API while preserving validation behavior.
Changes:
- Adds the internal DataViews validated toggle wrapper and tests.
- Updates DataForm to use the local component.
- Removes the Components private export and Storybook story.
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/toggle-control.tsx |
Implements the vendored wrapper. |
packages/dataviews/src/components/validated-form-controls/test/toggle-control.tsx |
Moves validation accessibility tests. |
packages/dataviews/src/components/validated-form-controls/index.ts |
Exports the internal wrapper. |
packages/dataviews/src/components/dataform-controls/toggle.tsx |
Replaces private API usage. |
packages/dataviews/CHANGELOG.md |
Records the internalization. |
packages/components/src/validated-form-controls/components/stories/toggle-control.story.tsx |
Removes the obsolete story. |
packages/components/src/validated-form-controls/components/index.ts |
Removes the Components export. |
packages/components/src/private-apis.ts |
Removes private API registration. |
packages/components/CHANGELOG.md |
Documents private API removal. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| export * from './content-editable-control'; | ||
| export * from './textarea-control'; | ||
| export * from './toggle-control'; | ||
| export * from './toggle-group-control'; |
There was a problem hiding this comment.
Before merging this one, I'd like to confirm that a copy should not be kept in components (see).
|
Tested and this works like |
Part of #81230
Follow-up to #81391, #81433, #81434, #81435, #81449, #81450, #81451
What?
Vendors
ValidatedToggleControlinto@wordpress/dataviewsas an internal component, and removes it from the@wordpress/componentsprivate APIs.Why?
See #81230
How?
packages/dataviews/src/components/validated-form-controls/toggle-control.tsx, wrapping the publicToggleControlfrom@wordpress/componentswith the already-vendoredControlWithError. Behavior is preserved exactly.Testing Instructions
npm run test:unit -- packages/dataviews/src/components/validated-form-controls/test/toggle-control.tsx— passes.npm run storybook:dev, then open DataViews → DataForm → Validation.aria-describedby.Use of AI Tools
Authored with the assistance of Claude Code (Claude Fable 5). All changes were reviewed and verified by the author.