-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Let a user search books within their shelves #3118
Let a user search books within their shelves #3118
Conversation
Great stuff @rosschapman awesome to have someone working on this.
The So what is a Hopefully that makes sense. |
(I just went in and added spaces in places where you mentioned an option number and GitHub thought it was a reference to an issue, it had me baffled for a second 😂) |
(@mouse-reeve 🙈 😅 githuh markdown fail) |
@hughrun Thank you, that's the context I needed to understand that part. 💪 |
@hughrun @mouse-reeve this is ready for an initial look, thanks! Going to think through some baseline test coverage in the meantime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice!
Works well, just a small change needed, and a question about terminology, as noted.
@hughrun I tried a different approach of showing a hint when the results are empty. See: 4a4046a. (Also renamed things from "search" to "filter" so it's more obvious to developers looking at this code that we are filtering -- as in, search within my books -- rather than searching -- search for a book. |
This is a much better idea than my suggestion 😄 Looks great! My only suggestion at this point is that in some ways you now have the opposite problem. Previously there was no way to clear the filter if the results were empty. Now it tells the user two opposing things: that we couldn't find any books using their filter, and that the filter has been applied - but then we're showing them an unfiltered list (i.e. the filter has NOT been applied, which is deliberate). I can see that this may confuse some users. Is there a way to do this where the filters/search term isn't passed back through to the view if the search set is empty, so we can say "we couldn't find anything" and automatically clear the filter? |
@hughrun for some reason it made sense in my head to still show all books without a match. But yeah, with only the placement of a small hint above it seems confusing. What about my latest commit which updates the template to show the not found message in the same place as the books list, while also keeps the Filters panel and Clear Filters option in view: |
Btw, it seems the template logic for setting the panel to "open" is a little wonky since it depends a |
That would be nice, but if it's too hard I don't think it matters too much. Your latest screenshot looks good, let me know when you're happy to call it "ready" and I'll take a proper final look later. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great other than a teeny change as per my comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! Thank you, looks good to me
Description
Search within your own books! 🔍 👤 📚
For issue background and details: #2079
Goals
min_confidence
of 0-- or by exact match (against identifiers, see Let a user search books within their shelves #3118 (comment))What's changed?
In preparation for this work, the assumption was that we might reuse the /search route and update the Search view with the new code. But it quickly became obvious that the Shelf view was a better place to add search behavior for the Your Books pages.
search()
To leverage existing system search behavior to search within a user's shelves, the
search()
function parameters have been extended with a kwarg forbooks
of typeQuerySet
. Now book search can be invoked on a preloaded query or not.To differentiate from the global, federated book search and be consistent with the filtering controls that exist for other list interfaces, I've reused the
filter_panels
componentsTests
View cases are being worked out over at: rosschapman#1
Screenshots
PRD and implementation notes (for posterity)