Skip to content

Tiled Gallery: Fix accessibility / AMP related block validation issues #43345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

coder-karen
Copy link
Contributor

@coder-karen coder-karen commented May 2, 2025

In progress

Potentially fixes several Tiled Gallery PRs
( to be updated)
Potentially fixes VULCAN-90 (and VULCAN-4, VULCAN-35, VULCAN-27)

Current issues:

  • In removing data-amp-layout, we will now have an issue with dynamic widths and images resizing when Tiled Gallery blocks are added to Layout / Column and similar blocks. This was originally added in PR 18791 (though the issue it was originally aiming to fix is still present - if we re-add `data-amp-layout then there are block validation issues there).
  • Unrelated to this PR, but on Simple there appears to be a new issue saving custom links. This should ideally be resolved here as well, once the cause is known.

Proposed changes:

  • Primarily, this PR aims to fix existing Tiled Gallery block deprecation notices in several instances: when copying a post / page on Simple, in the post / page / site editor console generally, when adding the block to a Pattern and viewing that pattern via the site editor, when adding a block as a subsite admin (when part of a multisite), then saving and refreshing the page.
  • It also partially addresses an accessibility issue reported recently (ensuring images with alt tags don't also have aria-labels (and that the aria labels are more appropriate) - except when Carousel is enabled.
  • The common theme in all environments where validation issues were present, were that the sites were part of a multisite network (for example Simple).
  • (to be updated)

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

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

Testing instructions:

To be completed.

On a self-hosted test site, with this PR applied (locally), or on a WoA or Jurassic Ninja test site with the Jetpack Beta tester plugin, and this PR applied. As a note, the reported issues predominantly affect Simple sites and multisites, so prioritize testing those (see further down):

  • Create a Tiled Gallery. Set link type to anything, with carousel enabled (/wp-admin/admin.php?page=jetpack#writing). * There should be no block validation issues. Both in the editor and front-end, behaviour should be as expected.
  • On the front-end you should be able to click on the post title then press tab to tab onto the images, and click enter to open them in Carousel - image markup should include tabindex of 0, role of button, and an aria-label. In the editor the image markup should not include an aria-label, role or tabindex.
  • Disable Carousel, and images on the front-end should have no tabindex, aria-label or role. If link is set to none, you won't be able to click on the images (it won't do anything). For any of the other link options, the link should work. There should still be no aria-label, tabindex or role - as the image is no longer the clickable element but instead is wrapped in an anchor tag.
  • Add a Tiled Gallery within a Column block and save, then refresh the page. There should be no block validation issues.
  • Ensure general functionality works as expected, as before.
  • You should also be able to observe a 'fix' on the front-end - if you click on the title of the post or page then tab onto an image in the Tiled Gallery, you will be able to tab to the images and hit enter if Carousel is enabled, even if the 'link' for the Tiled Gallery was set to none. On trunk you won't be able to.
  • Duplicate a post or page with a Tiled Gallery block. On saving, there should be no block validation errors..

Multisites:

  • Using Jurassic Ninja specialops (`?specialops=true#), create a multisite, and within that multisite network create a substitute.
  • On that subsite, create a subsite admin (not a super-admin).
  • Logged in as that user, follow the same steps as above.

Simple:

  • As above (to enable Carousel visit /wp-admin/options-media.php)
  • Open up the site Editor (you'll need a block theme such as Twenty Twenty Five active). Open up 'Patterns', and create a new Pattern with a Tiled Gallery block. Save and return to the patterns page, then search for that Tiled Gallery block (name it Tiled Gallery for example to be able to search for it by name). You should be able to see the block in the pattern preview with no validation errors showing.

@coder-karen coder-karen added [Type] Bug When a feature is broken and / or not performing as intended [Status] In Progress [Block] Tiled Gallery labels May 2, 2025
@coder-karen coder-karen self-assigned this May 2, 2025
Copy link
Contributor

github-actions bot commented May 2, 2025

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), and enable the fix/tiled-gallery-accessibility-related-validation-issues branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/tiled-gallery-accessibility-related-validation-issues

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

Copy link
Contributor

github-actions bot commented May 2, 2025

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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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.

@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label May 2, 2025
Copy link

jp-launch-control bot commented May 2, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/extensions/blocks/tiled-gallery/tiled-gallery.php 0/89 (0.00%) 0.00% 4 💔

25 files are newly checked for coverage. Only the first 5 are listed here.

File Coverage
projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v7/gallery-image/save.js 0/13 (0.00%) 💔
projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v7/layout/index.js 0/10 (0.00%) 💔
projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v7/save.js 0/6 (0.00%) 💔
projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v8/gallery-image/save.js 0/13 (0.00%) 💔
projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v8/layout/index.js 0/10 (0.00%) 💔

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

@coder-karen coder-karen force-pushed the fix/tiled-gallery-accessibility-related-validation-issues branch 2 times, most recently from be38926 to f53ea90 Compare May 5, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Tiled Gallery [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant