Show Want to Read button on trending pages#12833
Open
Anuragp22 wants to merge 1 commit into
Open
Conversation
Pass include_dropper=True to the SearchResultsWork macro in trending.html so the reading-log dropper renders, matching work_search, author, and list pages. Trending feeds Solr work docs (with edition_key) via add_solr_works and the dropper loads async, so no server-side changes are needed. Closes internetarchive#12810
Member
|
Thanks for the contribution, @Anuragp22! 🤖 Copilot has been assigned for an initial review. @mekarpeles is assigned to this PR and currently has:
PR triage checklist (maintainers / Pam)
Note This comment was automatically generated by Pam, Open Library's Project AI Manager, on behalf of @mekarpeles. Pam is designed to provide status visibility, perform basic project management functions and relevant codebase research, and provide actionable feedback so contributors aren't left waiting. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes missing reading-log UI on Trending pages by enabling the existing “Want to Read” dropper in the shared SearchResultsWork rendering path. This aligns /trending/* with other listing pages which already pass include_dropper=True.
Changes:
- Pass
include_dropper=Trueto themacros.SearchResultsWork(...)call intrending.htmlso the reading-log dropper renders for each work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12810
Add the Want to Read button to trending pages. [fix]
Technical
Trending pages render each book through the
SearchResultsWorkmacro but did not passinclude_dropper=True, so the reading-log dropper (the Want to Read button) never rendered. Every other listing page (work_search.html,type/author/view.html,type/list/view_body.html,macros/FulltextResults.html) passes it. This addsinclude_dropper=Trueto the macro call intrending.html. Trending feeds Solr work documents viaBookshelves.add_solr_works(which includeedition_keyandlogged_edition) and the dropper loads asynchronously, so no server-side changes are required.Testing
Visit /trending/now while logged in: a Want to Read dropper appears on each book, matching search results and list pages. When logged out it renders in its disabled state, consistent with other listing pages.
Screenshot
Pending: current master does not start locally (see #12827), so a running screenshot could not be captured. The change mirrors the established use of
include_dropperon other listing templates.Stakeholders
@mekarpeles