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

Fix product description truncation #13124

Conversation

Yassir4
Copy link
Contributor

@Yassir4 Yassir4 commented Feb 5, 2025

What? Why?

The product description should always be truncated if the text exceeds the parent width.
I've tested this using long descriptions with list/code/quote/title to simulate all the possible tags.

Screenshot 2025-02-05 at 10 08 26 Screenshot 2025-02-05 at 10 09 42 Screenshot 2025-02-05 at 10 07 48 Screenshot 2025-02-05 at 10 37 04

What should we test?

As admin
0. Log in as an enterprise shop and create shipping/payment methods, and then create 3 products a product edit the description respectively:

  1. Enter this text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi venenatis metus diam, eget scelerisque nibh auctor non. Vestibulum tempor non dolor id luctus. as a product description.

  2. Enter the same above text as a quote

  3. Enter the first text and change some random text inside to be bold

  4. Create an order cycle and add the products to it. If the order cycle is open, these should be visible in the shopfront.

As customer
5. Visit the shopfront and you should see all the products description truncated.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

@Yassir4 Yassir4 force-pushed the 10685-fix-product-description-truncation branch from 25f59dd to 2753f56 Compare February 5, 2025 10:55
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Thank you!

The style rules make sense but I can't verify the result without testing. We'll look at it on a staging server.

@filipefurtad0 filipefurtad0 self-assigned this Feb 7, 2025
@filipefurtad0 filipefurtad0 added the pr-staged-au staging.openfoodnetwork.org.au label Feb 7, 2025
@filipefurtad0
Copy link
Contributor

Hey @Yassir4 ,

Welcome 🎉
Many thanks for this contribution and the detailed test instructions.

Before this PR

For a desktop device:
image

For an iphone 12:
image

After this PR

For a desktop device:
image

For an iphone 12:
image

Looks great! Merging, thanks again 🙏

@filipefurtad0 filipefurtad0 merged commit 2d6e627 into openfoodfoundation:master Feb 7, 2025
35 checks passed
@filipefurtad0 filipefurtad0 removed the pr-staged-au staging.openfoodnetwork.org.au label Feb 7, 2025
@drummer83
Copy link
Contributor

Hi @Yassir4 and @filipefurtad0,
Did we change anything about the height of that description line?
I'm asking because the "g" looks cropped at the bottom.
It's not critical but it doesn't look very nice...

@Yassir4
Copy link
Contributor Author

Yassir4 commented Feb 8, 2025

Nice Catch @drummer83, I didn't spot that
I didn't explicitly change the height, but I think overflow: hidden on the * selector may have done that.
I will try to fix it in the next PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Product description not correctly truncated
4 participants