internetarchive / internetarchive/openlibrary
Book cover not displayed immediately after adding to a list
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
### Problem
When a book is added to a list from a book/edition page, the newly added list entry initially displays the generic book placeholder icon instead of the book's cover.
Refreshing the page causes the actual book cover to appear.
When you refresh it actually shows the book icon
### Reproducing the bug
1. Steps to reproduce
2. Open a book that has a cover.
3. Click Want to Read drop down and in `My Reading Lists:` Add the book to any existing list.
4. Observe the list entry shown immediately after adding the book.
5. Refresh the page.
6. Compare the list entry before and after the refresh.
### Expected behavior
- The book cover should be displayed immediately after adding the book to a list, without requiring a page refresh.
### Actual behavior
#### Immediately after adding the book:
- A generic book icon is shown.
#### After refreshing the page:
- The actual book cover appears.
### Proposed improvements
- Render/use the book's cover when the list entry is inserted, instead of initially using the generic placeholder.
- Preserve the existing placeholder behavior when a book genuinely has no cover.
### Acceptance criteria
- [ ] Adding a book to a list immediately displays its cover when available.
- [ ] Books without covers continue to display the default book icon.
- [ ] The cover is vertically aligned with the list text.
- [ ] Refreshing the page does not change the visual representation of the newly added list item.
- [ ] Existing list add/remove behavior continues to work.
### Context
- Browser (Chrome, Safari, Firefox, etc): Brave
- OS (Windows, Mac, etc): Fedora
- Logged in (Y/N): Y
- Environment (prod, dev, local): prod
### Breakdown
Implementation Details (for maintainers)
#### Requirements Checklist
* [ ]
#### Related files
*
#### Stakeholders
*
#### Instructions for Contributors
- Please [run these commands](https://docs.openlibrary.org/developers/tools/git.html#working-on-your-branch) to ensure your repository is up to date **before** [creating a new branch](https://docs.openlibrary.org/developers/tools/git.html#making-changes-and-creating-a-pull-request) to work on this issue and **each time after** pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Contributor guide
Assessment
This issue has not been assessed yet.