Skip to content

Connector: Ensure connection card accessibility#47969

Open
coder-karen wants to merge 6 commits intotrunkfrom
fix/connector-card-accessibility
Open

Connector: Ensure connection card accessibility#47969
coder-karen wants to merge 6 commits intotrunkfrom
fix/connector-card-accessibility

Conversation

@coder-karen
Copy link
Copy Markdown
Contributor

Fixes CONNECT-216

Proposed changes

  • This PR ensures the following:
    • When modals appear, keyboard focus is moved to the default focusable control
    • The 'connection details' link shows focus when focus is applied (eg. via tabbing)
    • The confirmation modal roles are set as alertDialog.
  • Noting here as well (there is mention in the relevant function docblock too), there are some workarounds due to a core / Gutenberg bug, the trade-off to removing those would be browser console warnings when opening the modals / clicking close.

Other information

Related product discussion/links

  • n/a

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

No.

Testing instructions

To test, add the WordPress Beta Tester plugin to a test site with Jetpack installed and active as well. With the Beta Tester, enable release candidates, and ensure the latest RC is active on the site.

  • On the test site, with this branch applied, visit the Connectors page via Settings > Connectors.
  • You should see the WordPress.com card at the top. Click on 'Details', and then click anywhere within the modal. Using tab, tab to each modal. Focus should be evident when tabbing.
  • For each, when focus is on the link, enter to open the modal. Focus should now be on the default focusable control - for the confirmation modals this is 'cancel'. Click enter again to confirm, and focus should now be back on the 'disconnect' links in those cases.
  • For the connection details link, hitting enter should apply focus to the close icon.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

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 fix/connector-card-accessibility branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/connector-card-accessibility
bin/jetpack-downloader test jetpack-mu-wpcom-plugin fix/connector-card-accessibility

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
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

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!

@coder-karen coder-karen changed the title Connector: Ensure connection card accesibility Connector: Ensure connection card accessibility Apr 7, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control bot commented Apr 7, 2026

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

@coder-karen coder-karen marked this pull request as ready for review April 7, 2026 13:58
@coder-karen coder-karen requested a review from a team as a code owner April 7, 2026 13:58
@coder-karen coder-karen requested review from Copilot and removed request for a team April 7, 2026 13:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves keyboard accessibility and focus management for the WordPress.com connector card UI on the WP core Connectors page.

Changes:

  • Adds focus management helpers/refs to restore focus after modals close and to control initial focus behavior.
  • Updates modal configuration (e.g., alertdialog role, autofocus) and related button/link interactions.
  • Tweaks CSS focus styling to better align with :focus-visible behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
projects/packages/connection/src/connectors/js/connectors-card.js Adds focus-handling utilities/refs and updates modal behaviors/props for better keyboard accessibility.
projects/packages/connection/src/connectors/css/connectors-card.css Adjusts focus styling to preserve visible focus for keyboard users while suppressing mouse focus outlines.
projects/packages/connection/changelog/fix-connector-card-accessibility Adds a changelog entry describing the accessibility improvements.
Comments suppressed due to low confidence (1)

projects/packages/connection/src/connectors/js/connectors-card.js:520

  • The docblock for focusWhenReady mentions using a blur-before-open pattern on modal triggers to avoid the Gutenberg aria-hidden focus warning, but the confirmation modal triggers (Disconnect site / Disconnect account) don't blur before calling setPendingConfirm(). Consider blurring the trigger element (e.g., via the click event) before opening the confirmation modal, the same way the details link does, so the workaround applies consistently and avoids console warnings.
	const handleDisconnect = () => {
		confirmTriggerRef.current = disconnectSiteRef.current;
		setPendingConfirm( {
			title: __( 'Disconnect site', 'jetpack-connection' ),
			message: __(
				'Are you sure you want to disconnect from WordPress.com? This will affect all plugins using this connection.',
				'jetpack-connection'
			),
			onConfirm: executeDisconnect,
		} );
	};

coder-karen and others added 2 commits April 7, 2026 16:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ssibility

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@coder-karen coder-karen added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Apr 9, 2026
@coder-karen coder-karen requested a review from bindlegirl April 9, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants