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

Fixed overlap between button text and icon #9066

Conversation

Realmbird
Copy link
Contributor

Closes #8899

Fixes overlap between button text and icon

Technical

  • Issue: Audio book read buttons had button text & icon "external link" overlap on smaller screen sizes

  • Cause: Responsive booksPerBreakpoints were not accurate with when less pages should be shown on the page

  • Fix: Changing responsive booksPerBreakpoints was not css like issue had stated

Testing

  1. docker compose up
    // For running site
  2. docker compose exec -e PYTHONPATH=. web bash -c "./scripts/copydocs.py --search 'author_key:OL9411725A' --search-limit 100"
    // Adding data
  3. http://localhost:8080/works/OL36891831W/
  4. Start changing screen width

Screenshot

Screencast from 04-10-2024 01:54:07 PM.webm
Will be screencast to demonstrate that text never overlaps with icon

Stakeholders

@cdrini @RayBB

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.93%. Comparing base (ae62bd8) to head (2edaa06).
Report is 16 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9066   +/-   ##
=======================================
  Coverage   15.93%   15.93%           
=======================================
  Files          89       89           
  Lines        4720     4720           
  Branches      823      823           
=======================================
  Hits          752      752           
  Misses       3457     3457           
  Partials      511      511           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RayBB RayBB added the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Apr 11, 2024
@RayBB
Copy link
Collaborator

RayBB commented Apr 12, 2024

@Realmbird it is on testing now and it is working as expected. I think it fixes the initial concern. However, I want to run it by the design team in the call today. 👍

@Realmbird
Copy link
Contributor Author

Thanks

@RayBB
Copy link
Collaborator

RayBB commented Apr 15, 2024

The design call didn't have time for me to bring this up.

Maybe @cdrini can comment directly.

@RayBB RayBB requested a review from cdrini April 16, 2024 16:18
@RayBB RayBB added Priority: 2 Important, as time permits. [managed] Needs: Review This issue/PR needs to be reviewed in order to be closed or merged (see comments). [managed] and removed Needs: Review This issue/PR needs to be reviewed in order to be closed or merged (see comments). [managed] Needs: Designs labels Apr 16, 2024
@RayBB
Copy link
Collaborator

RayBB commented Apr 17, 2024

@Realmbird we have to wait for @cdrini to comment on this one. He's off Thursday and Friday so it will probably have to wait until next week.

Here are my thoughts though:

  • Your PR does fix the issue
  • However, I'm not sure if those numbers you changed in the JS were set for a specific reason so I'm hesitant to change them.
  • In my opinion, I think it is a better long-term fix to move the image out of the background and have it be right next to the text. But that's just my opinion and changes the design of the button. I assume the original goal was that the external icon stays to the far right while the text stays centered. I'm not sure how attached we are to that design.

@RayBB
Copy link
Collaborator

RayBB commented Apr 19, 2024

@Realmbird
I asked in the design call today.
The feedback I got from @mekarpeles was that maybe we should see if we can make the text/icon scale smaller with the size of the button. We are still not sure if that is feasible and probably want to get feedback from @cdrini before spending too much time on that path.

@Realmbird
Copy link
Contributor Author

Problem with text and icon is current version is a background image for the button, so it can't be scaled well currently

@RayBB
Copy link
Collaborator

RayBB commented Apr 19, 2024

@Realmbird feel free to play around with moving the icon out but ultimately we should wait for Drini's input here. We can try to get his input on the Tuesday call.

@Realmbird
Copy link
Contributor Author

Ok in the mean time gonna work on other issue

@cdrini cdrini removed the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Apr 23, 2024
@mekarpeles mekarpeles added Priority: 3 Issues that we can consider at our leisure. [managed] and removed Priority: 2 Important, as time permits. [managed] labels May 10, 2024
@cdrini
Copy link
Collaborator

cdrini commented May 22, 2024

Howdy folks! I think what we can try is; apologies it will be a little involved!

  1. Decrease the font size of all cta-btn from 16px to 14px. Make only the primary button, the one inside the #read-options element, be 16px.
  2. Make all .cta-btn white-space: nowrap; overflow: hidden; text-overflow: ellipsis; and make .cta-btn--external have a padding-right of 25px ; this should make sure there's enough space for the external icon, and crop the text with an ellipsis if there isn't
  3. Make all buttons have padding: 8px 0 instead of the current padding: 8px ; the button label already has padding, so we're just doubling up on it.
  4. Make all buttons have text-align: center; this is getting lost somewhere for carousels.

That should do it, and give us something like this

image

Here's the css I experimented with ; although yours will likely look different / be in a different spot

image

@cdrini cdrini added Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] and removed Needs: Review This issue/PR needs to be reviewed in order to be closed or merged (see comments). [managed] labels May 22, 2024
@Realmbird
Copy link
Contributor Author

Ok will make changes to css

@Realmbird Realmbird force-pushed the 8899/fix/text_overlap_with_external_icon branch from 2edaa06 to cb6645f Compare May 22, 2024 18:33
@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label May 22, 2024
@Realmbird
Copy link
Contributor Author

@cdrini Added your changes

@Realmbird
Copy link
Contributor Author

Screencast from 05-22-2024 11:22:57 AM.webm
After changes

@@ -66,7 +66,7 @@ export class Carousel {
speed: 300,
slidesToShow: this.config.booksPerBreakpoint[0],
slidesToScroll: this.config.booksPerBreakpoint[0],
responsive: [1200, 1024, 600, 480, 360]
responsive: [1200, 1024, 740, 580, 360]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
responsive: [1200, 1024, 740, 580, 360]
responsive: [1200, 1024, 600, 480, 360]

Lets restore these (I think that's what Drini wanted) then I'll put it on testing so we can see how things look!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing numbers breaks it on firefox it briefly overlaps

@RayBB RayBB added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label May 29, 2024
@Realmbird
Copy link
Contributor Author

@RayBB @cdrini Tried rays changes caused overlap bug to reappear

@Realmbird
Copy link
Contributor Author

Uploading Screenshot from 2024-05-31 12-59-20.png…

@RayBB
Copy link
Collaborator

RayBB commented Jun 3, 2024

@Realmbird that screenshot didn't finish uploading.
@cdrini how do you feel about the PR as is with the responsive size numbers changing?

@RayBB
Copy link
Collaborator

RayBB commented Nov 27, 2024

Closing this to offer up someone else to work on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] Priority: 3 Issues that we can consider at our leisure. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trusted book provider "audiobook" link in carousel on mobile has text overlap with external icon
5 participants