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

Bugfix/wrong size attributes in image with border #30139

Merged
merged 6 commits into from
Sep 30, 2020
Merged

Bugfix/wrong size attributes in image with border #30139

merged 6 commits into from
Sep 30, 2020

Conversation

GrimLink
Copy link
Member

@GrimLink GrimLink commented Sep 21, 2020

Description (*)

This PR removes most changes from commit #4e085c7

Commit #4e085c7 tried to fix images getting distorted.
By setting a boolean for the image_with_border.phtml.
This boolean would set the width and height attribute, to the invalid html max-width and max-height attribute.
While this did fix the images not getting distorted.
This did reintroduced the use of invalid html attributes.

This commit unsets the boolean, use of invalid html attributes and fixes the images getting distorted, via the CSS instead.

Manual testing scenarios (*)

  1. Remove the boolean enable_lazy_loading_for_images_without_borders
  2. Remove the max-width and max-height and the if statement holding this.
  3. Add the value width: auto to the .product-image-photo (This also possible via object-fit: scale-down)

This PR also removes the redundant max-width and height from the .product-image-photo.
Since these values are already set globally, on the image, via the reset styles.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Bugfix/wrong size attributes in image with border #30186: Bugfix/wrong size attributes in image with border

@m2-assistant
Copy link

m2-assistant bot commented Sep 21, 2020

Hi @GrimLink. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@GrimLink
Copy link
Member Author

@magento run all tests

@mrtuvn
Copy link
Contributor

mrtuvn commented Sep 22, 2020

Can you verify previous commit purpose related with this doc https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html. Seem they try to add new variable for solve problem

This is done to prevent small images from being stretched and distorted.

Also i think doc should be update for clarify user to use correct image size.

@GrimLink
Copy link
Member Author

@mrtuvn I can confirm that the previous commit is related to the doc https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#lazy_loading

But I don't understand why the previous commit was seen as valid 😖

This same issue also plagued the images in the minicart.
And those images did not have the native lazy loading on it.
This was also fixed by unsetting the width and height on the image size.

The width and height are recommended for the native lazy loading and to prevent layout jank.
But unsetting them is not wrong.
As the images are rendered in a aspect-ratio that all ready reserves the image space.

But I will check how to also update the doc with this changed.
Thank for letting me know of this doc section 😉

@mrtuvn
Copy link
Contributor

mrtuvn commented Sep 22, 2020

@GrimLink pull request prefix MC- meaning this made by internal core team so you probably will not see issue or pull request open. I'm not sure more details about it . You can ping author here for asking
author related PR: @adifucan
CC: @krzksz can you leave some comment for review this

Copy link
Contributor

@krzksz krzksz left a comment

Choose a reason for hiding this comment

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

If I understand this correctly and previous change was some hacky workaround that we can remove while fixing the issue with those few lines of CSS then I'm happy to approve this.

Let's just resolve those failing tests that @mrtuvn mentioned.

@ghost ghost moved this from Pending Review to Changes Requested in Pull Requests Dashboard Sep 22, 2020
@ghost ghost assigned krzksz Sep 22, 2020
@krzksz
Copy link
Contributor

krzksz commented Sep 22, 2020

@magento run Functional Tests B2B,Functional Tests CE,Functional Tests EE,Static Tests

@krzksz
Copy link
Contributor

krzksz commented Sep 22, 2020

@magento run Static Tests

@GrimLink
Copy link
Member Author

@krzksz I am not sure how to als update the docs https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/themes/theme-images.html#lazy_loading
Can you point me in the right direction on how to do this?

@krzksz
Copy link
Contributor

krzksz commented Sep 22, 2020

@magento run all tests

@krzksz
Copy link
Contributor

krzksz commented Sep 22, 2020

@GrimLink Hey, you can find the repository here: https://github.com/magento/devdocs

When making PR there you should be able to reference this one to make sure they are processed together.

@krzksz
Copy link
Contributor

krzksz commented Sep 22, 2020

@magento run Functional Tests B2B,WebAPI Tests

Copy link
Contributor

@adifucan adifucan left a comment

Choose a reason for hiding this comment

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

@sidolov sidolov added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Sep 22, 2020
@krzksz krzksz added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Sep 23, 2020
@krzksz
Copy link
Contributor

krzksz commented Sep 23, 2020

I don't think it is possible to cover this scenario with automatic tests.

@magento-engcom-team
Copy link
Contributor

Hi @krzksz, thank you for the review.
ENGCOM-8251 has been created to process this Pull Request
✳️ @krzksz, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Delta
Copy link
Contributor

✔️ QA passed
Result:
✔️ Small images are not stretched/distorted and displayed as before
image
image

@engcom-Delta
Copy link
Contributor

@magento create issue

@engcom-Delta engcom-Delta added the QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope label Sep 25, 2020
@engcom-Delta
Copy link
Contributor

Note: Automation tests are passed

@engcom-Delta engcom-Delta moved this from Testing in Progress to Merge in Progress in Pull Requests Dashboard Sep 25, 2020
@gabrieldagama
Copy link
Contributor

@magento give me new instance with edition ee

@magento-deployment-service
Copy link

Hi @gabrieldagama. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@m2-assistant
Copy link

m2-assistant bot commented Sep 30, 2020

Hi @GrimLink, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@ghost ghost moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Design/Frontend Area: Frontend Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Component: Catalog Priority: P3 May be fixed according to the position in the backlog. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Risk: low Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Pull Requests Dashboard
  
Recently Merged
Development

Successfully merging this pull request may close these issues.

[Issue] Bugfix/wrong size attributes in image with border
8 participants