Connector: Ensure connection card accessibility#47969
Connector: Ensure connection card accessibility#47969coder-karen wants to merge 6 commits intotrunkfrom
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis 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. 🤷 |
There was a problem hiding this comment.
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.,
alertdialogrole, autofocus) and related button/link interactions. - Tweaks CSS focus styling to better align with
:focus-visiblebehavior.
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
focusWhenReadymentions using a blur-before-open pattern on modal triggers to avoid the Gutenbergaria-hiddenfocus warning, but the confirmation modal triggers (Disconnect site/Disconnect account) don't blur before callingsetPendingConfirm(). 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,
} );
};
projects/packages/connection/changelog/fix-connector-card-accessibility
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ssibility Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes CONNECT-216
Proposed changes
alertDialog.Other information
Related product discussion/links
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.