internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.1k stars 1.33k forks source link

"Read more" button should not be added if it takes up as much space as the hidden text #9329

Open cdrini opened 3 months ago

cdrini commented 3 months ago

Problem

Evidence / Screenshot

image image

Relevant URL(s)

E.g. https://openlibrary.org/books/OL8978501M/Robin_Hood

Reproducing the bug

  1. Go to https://openlibrary.org/books/OL8978501M/Robin_Hood

Context

Notes from this Issue's Lead

Proposal & constraints

Perhaps we can update the + 1 here: https://github.com/internetarchive/openlibrary/blob/73b70f6b997c401caf2fe8078a6296c8f3167ee5/openlibrary/plugins/openlibrary/js/readmore.js#L58

To instead be the height of the .read-more__toggle--more button. We might need to capture that height in the constructor though, before the read more button is potentially hidden!

Related files

https://github.com/internetarchive/openlibrary/blob/73b70f6b997c401caf2fe8078a6296c8f3167ee5/openlibrary/plugins/openlibrary/js/readmore.js

Stakeholders

@RayBB

Note: Before making a new branch or updating an existing one, please ensure your branch is up to date.

CodeMaverick2 commented 2 months ago

@RayBB I would like to work on this issue

RayBB commented 2 months ago

@CodeMaverick2 assigned to you :)