Updated block validation integration#68
Conversation
|
Hey @dknauss, I'm adding a playground preview to the Block Accessibility Checks plugin then releasing v4.0.0, once that is done this PR can be properly reviewed. Biggest changes are naming conventions, and how the external block integrates with the settings page, as this got a refactor to leverage DataViews.
|
There was a problem hiding this comment.
Pull request overview
Updates the plugin’s Block Accessibility Checks (BAC) integration to align with BAC v4’s breaking API changes, ensuring bibliography block validation runs again and previously-dropped checks are registered/validated.
Changes:
- Migrates PHP-side BAC registration to
ba11yc_register_block_check()(v4 shape) and updates related PHPUnit integration assertions. - Renames the JS validation filter hook to
ba11yc.validateBlockand ports the two missing checks intosrc/validation.js. - Removes the legacy
window.BlockAccessibilityChecksintegration path and updates E2E detection accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| bibliography-builder.php | Switches BAC check registration to v4 function + args shape; adds registrations for the two recovered checks. |
| src/validation.js | Implements v4 filter-based validation and adds validation logic for recovered checks; renames hook to dot-separated form. |
| src/validation.test.js | Updates unit tests for the new filter name and adds coverage for the recovered checks. |
| src/index.js | Removes the v3 registerBACChecks() call path. |
| src/lib/block-accessibility-checks.js | Removes legacy v3 window-global integration implementation (now comments only). |
| src/lib/block-accessibility-checks.test.js | Replaces legacy integration tests with a placeholder marker test. |
| tests/phpunit/A11yIntegrationTest.php | Updates PHPUnit integration expectations for v4 registration call shape and expanded check set. |
| tests/e2e/a11y.spec.js | Updates BAC presence detection to use the v4 data store instead of window.BlockAccessibilityChecks. |
| package-lock.json | Lockfile churn from dependency graph changes during the update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks Troy! BAC v4 is live now, and this PR is exactly the right direction for the new API — at least, my bots like it. :-) We pushed a small maintainer follow-up to address the review items and get CI unstuck:
Thanks for taking the time to wire Borges into the BAC v4 changes. 🙏 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #68 +/- ##
==========================================
+ Coverage 80.80% 81.01% +0.21%
==========================================
Files 44 43 -1
Lines 3084 3113 +29
Branches 523 522 -1
==========================================
+ Hits 2492 2522 +30
Misses 185 185
+ Partials 407 406 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

Summary
What changed?
window.BlockAccessibilityChecks path removed — src/lib/block-accessibility-checks.js gutted; the registerBACChecks() call removed from src/index.js.
Why was this change needed?
Block Accessibility Checks v4 ships a clean-break API. This PR updates the Bibliography Builder plugin to stay compatible — no behavior changes, same 4 checks, same severity defaults.
Validation
npm run lint:jspassesnpm run lint:csspassesnpm run lint:i18npasses when source strings or translation docs changenpm run testpassesnpm run buildsucceedsChecklist