Skip to content

Announce accessibility analysis refresh completion - #1838

Open
benitoalba wants to merge 1 commit into
equalizedigital:developfrom
benitoalba:fix/1761-announce-refresh-completion
Open

Announce accessibility analysis refresh completion#1838
benitoalba wants to merge 1 commit into
equalizedigital:developfrom
benitoalba:fix/1761-announce-refresh-completion

Conversation

@benitoalba

@benitoalba benitoalba commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #1761

Summary

  • Announce the result of a user-triggered Accessibility Analysis refresh through wp.a11y.speak.
  • Return the refresh outcome from the sidebar data store so success and failure messages match the request result.
  • Load wp-a11y with the sidebar bundle and add JavaScript and PHP regression coverage.

Why

The Refresh action updated the sidebar asynchronously but did not expose a completion status to assistive technologies. Screen reader users therefore had no confirmation that refreshed results were available.

Testing

  • npm run test:jest -- --runInBand — 956 tests passed.
  • docker compose exec -T phpunit vendor/bin/phpunit — 874 tests, 1,867 assertions, 15 skipped.
  • npm run lint:js -- src/sidebar/components/SidebarTitleMenu.js src/sidebar/store/accessibility-checker-store.js tests/jest/sidebar/SidebarTitleMenu.test.js tests/jest/sidebar/accessibility-checker-store.test.js — passed.
  • docker compose exec -T phpunit vendor/bin/phpcs admin/class-enqueue-admin.php tests/phpunit/Admin/EnqueueAdminTest.php — passed.
  • npm run build — passed.
  • git diff --check — passed.
  • Manual verification in Microsoft Edge with NVDA 2026.1.1 — Speech Viewer recorded “Accessibility analysis refreshed.” after activating Refresh.

Checklist

  • PR is linked to the main issue in the repo.
  • Tests are added that cover changes.

Summary by CodeRabbit

  • Accessibility

    • Refresh results now provide spoken success or failure announcements.
    • Added support for WordPress accessibility messaging in the editor sidebar.
  • Bug Fixes

    • Refresh operations now accurately report whether they succeeded, failed, or encountered an error.
    • Refresh is safely skipped when no post is selected.
  • Tests

    • Added coverage for refresh outcomes and accessibility announcements.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The sidebar refresh action now returns a success status, announces successful or failed refreshes through @wordpress/a11y, and declares wp-a11y as a script dependency. Jest and PHPUnit coverage validates refresh outcomes, announcements, missing post IDs, and dependency registration.

Changes

Refresh accessibility status

Layer / File(s) Summary
Refresh result propagation
src/sidebar/store/accessibility-checker-store.js, tests/jest/sidebar/accessibility-checker-store.test.js
refetchData resolves boolean outcomes for initial and background refreshes, with tests covering success, failure, rejection, and initial loading.
Refresh announcement integration
src/sidebar/components/SidebarTitleMenu.js, admin/class-enqueue-admin.php, tests/jest/sidebar/SidebarTitleMenu.test.js, tests/phpunit/Admin/EnqueueAdminTest.php
SidebarTitleMenu announces refresh status using speak, while the sidebar script declares wp-a11y and tests verify both behaviors.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: pattonwebz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR adds screen reader announcements for refresh success and failure, matching issue #1761's status message requirement.
Out of Scope Changes check ✅ Passed The code changes are focused on the refresh announcement flow, dependency wiring, and supporting tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: announcing accessibility analysis refresh completion for screen reader users.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pattonwebz

Copy link
Copy Markdown
Member

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@benitoalba
benitoalba marked this pull request as ready for review July 17, 2026 22:07
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@pattonwebz

Copy link
Copy Markdown
Member

Hey @benitoalba this looks good to me on a quick scan. I see you just swapped it out of draft state as well, do you think this is good to test?

@benitoalba

Copy link
Copy Markdown
Contributor Author

Yes, it’s ready to test from my side. All the local automated and manual checks listed in the PR description are passing, including the NVDA verification. Please let me know if you’d like me to test any additional scenarios.

@pattonwebz

Copy link
Copy Markdown
Member

@benitoalba this looks good to me. I just tested it and it all appears to work fine.

I did run into an edge case when testing caused by a denounce timer that would incorrectly cancel the wrong promise meaning a small chance of the wrong announcement being fired. It is a pre-existing issue though so no need to fix it in this PR - I made a followup issue that I will tackle before we do the next release.

I think this will be good to merge in after I test it a little more and will probably go out in the next release.

Thanks for the contribution, also nice addition of the tests! 😄

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility Analysis Refresh Does Not Announce Completion Status

2 participants