Skip to content
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

Add srcset to Single Product gallery thumbnail images #49112

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Jul 3, 2024

Changes proposed in this Pull Request:

Fixes #48431.

This PR adds a srcset attribute to thumbnail images displayed in the Single Product page for products that have multiple images or variable products with different images for each variation.

How to test the changes in this Pull Request:

  1. Create a product with several images.
  2. Visit the product in the frontend.
  3. Verify the thumbnail images aren't blurred. If you aren't sure, you can open your browser devtools (F12), inspect the image and verify it has a srcset attribute.
Before After
Captura de pantalla de 2024-07-03 17-48-18 Captura de pantalla de 2024-07-03 17-48-33

(Note: you might to open the PRs in a new tab to see the difference)

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Changelog Entry Comment

Comment

@Aljullu Aljullu added team: Kirigami & Origami WC Store Editing (FSE) block: product image gallery Issues related to the Product Image Gallery block. labels Jul 3, 2024
@Aljullu Aljullu self-assigned this Jul 3, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jul 3, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 2024

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

Copy link
Contributor

github-actions bot commented Jul 3, 2024

Size Change: 0 B

Total Size: 2.5 MB

compressed-size-action

@Aljullu Aljullu requested review from a team and WunderBart and removed request for a team July 3, 2024 17:56
Copy link
Contributor

github-actions bot commented Jul 3, 2024

Hi @WunderBart,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@Aljullu Aljullu force-pushed the fix/48431-blurry-thumbnail-images branch from 098f43d to a7537e0 Compare July 5, 2024 14:38
Copy link
Contributor

@WunderBart WunderBart left a comment

Choose a reason for hiding this comment

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

Tested locally, product thumbnails have the srcset attribute and they always stay sharp. Nice improvement, thanks! 🚀

@Aljullu Aljullu merged commit 416db85 into trunk Jul 8, 2024
26 checks passed
@Aljullu Aljullu deleted the fix/48431-blurry-thumbnail-images branch July 8, 2024 15:23
@github-actions github-actions bot added this to the 9.2.0 milestone Jul 8, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Jul 8, 2024
@nigeljamesstevenson nigeljamesstevenson added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Jul 10, 2024
mikejolley pushed a commit that referenced this pull request Jul 10, 2024
* Add srcset to Single Product gallery thumbnail images

* Add changelog file
thealexandrelara pushed a commit that referenced this pull request Jul 18, 2024
* Add srcset to Single Product gallery thumbnail images

* Add changelog file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
block: product image gallery Issues related to the Product Image Gallery block. needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris team: Kirigami & Origami WC Store Editing (FSE)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thumbnail images in the Product Image Gallery should have a srcset attribute
3 participants