Skip to content

Components: replace VisuallyHidden from components with UI version#50403

Open
simison wants to merge 1 commit into
trunkfrom
update/form-option-visuallyhidden-to-ui
Open

Components: replace VisuallyHidden from components with UI version#50403
simison wants to merge 1 commit into
trunkfrom
update/form-option-visuallyhidden-to-ui

Conversation

@simison

@simison simison commented Jul 10, 2026

Copy link
Copy Markdown
Member

Part of #48160

Proposed changes

  • Replaces VisuallyHidden component from @wordpress/components (storybook) with @wordpress/ui version (storybook).

Later on, I'll enable a linter which will complain about using the old component (#48487)

Related product discussion/links

Does this pull request change what data or activity we track or use?

Testing instructions

  • Smoke test touched UIs; no changes visible.

@simison simison added [Status] Needs Review This PR is ready for review. [Type] Janitorial labels Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the update/form-option-visuallyhidden-to-ui branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/form-option-visuallyhidden-to-ui
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/form-option-visuallyhidden-to-ui

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

Comment on lines +48 to +57
<VisuallyHidden
render={
<span>
{
/* translators: accessibility text */
__( '(opens in a new tab)', 'jetpack-components' )
}
</span>
}
</VisuallyHidden>
/>

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.

I'd recommend only including attributes in render if it's inherently tied to the element / component in the render and not part of the root component's own interface. Since VisuallyHidden accepts children, I'd pass it there, which would also simplify this a bit.

We could probably do a better job of documenting rules about where consumers should apply props when using render. Though for VisuallyHidden in particular, we do document this composition example.

<VisuallyHidden render={ <span /> }>
	{
		/* translators: accessibility text */
		__( '(opens in a new tab)', 'jetpack-components' )
	}
</VisuallyHidden>

(Same comment applies below)

Comment on lines 388 to 392
<Text
className={ clsx( styles.deltaValue, styles.deltaPlaceholder ) }
style={ { color: deltaColor } }
aria-label={ __( 'No comparison data', 'jetpack-charts' ) }
>

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.

aria-label should not be used on presentational content like a <span />. I think the previous approach was correct.

The generic role is intended for use as the implicit role of generic elements in host languages (such as HTML div or span)

https://www.w3.org/TR/wai-aria-1.2/#generic

5.2.8.6 Roles which cannot be named (Name prohibited): [...] generic

https://www.w3.org/TR/wai-aria-1.2/#namefromprohibited

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants