openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Searches on reading log with no matches incorrectly show "No books on this shelf" screen

Open cdrini opened this issue 1 year ago • 2 comments

Evidence

image

Relevant url?

E.g. https://openlibrary.org/people/ScarTissue/books/already-read?q=foo+bar

Steps to Reproduce

  1. Go to one of your reading log shelves (eg https://openlibrary.org/people/ScarTissue/books/already-read )
  2. Perform a search for something that won't match (eg "foo bar")
  • Expected: Text saying no books matched
  • Actual: text saying "You haven't added any books to this shelf yet." and the search box disappears

Details

  • Logged in (Y/N)? Y
  • Browser type/version? FF
  • Operating system? Win10
  • Environment (prod/dev/local)? prod

Proposal & Constraints

In this case, the search box with the search term should still be visible, and the text should say "No results found in {Already Read}". With an option for searching the entire library "Search all of Open Library for "{query}"?" .

Use a style similar to this page: https://openlibrary.org/search?q=asdfas+fa+sdf+asdf+asd+fasdf&mode=everything

Related files

  • The reading log template: https://github.com/internetarchive/openlibrary/blob/7f8c89f2e5b71ef8cd44866121a459ea9d48eefc/openlibrary/templates/account/reading_log.html#L73-L79

  • "No results" UI / style from this page: https://github.com/internetarchive/openlibrary/blob/41adf1921f1602fb36b37fd0bff472d7c7f9c859/openlibrary/templates/work_search.html#L144-L159

Stakeholders

cdrini avatar Feb 10 '24 16:02 cdrini

Hey @cdrini, I would like to pick up this issue. Can I get assigned?

QuantuM410 avatar Feb 10 '24 18:02 QuantuM410

Hey, I tried fixing it, can you please review it and suggest any improvements that are needed?

Ayush1404 avatar Feb 10 '24 19:02 Ayush1404