Skip to content
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

Make search sort option sticky by type #9932

Open
2 tasks
mekarpeles opened this issue Oct 3, 2024 · 2 comments
Open
2 tasks

Make search sort option sticky by type #9932

mekarpeles opened this issue Oct 3, 2024 · 2 comments
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Needs: Community Discussion This issue is to be brought up in the next community call. [managed] Needs: Response Issues which require feedback from lead Priority: 3 Issues that we can consider at our leisure. [managed] Theme: Search Issues related to search UI and backend. [managed] Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed]

Comments

@mekarpeles
Copy link
Member

mekarpeles commented Oct 3, 2024

Proposal

Right now, there are sort droppers on...

(a) search page,
Screenshot 2024-10-03 at 7 42 59 AM

(b) author pages,
Screenshot 2024-10-03 at 7 43 29 AM

and (c) list pages
Screenshot 2024-10-03 at 7 44 03 AM

Every time one refreshes the page, these droppers return to their default selected value.

We'd like to use locaStorage to keep track of the last selected sort option per type (i.e. we should store a different selectedSorts value for searchPage, authorPage, listPage, e.g.

selectedSorts = { searchPage: null, authorPage: null, listPage: null }

We use localStorage similarly elsewhere in our JS:

/** String value that's persisted to localstorage */

Justification

Several librarians, including @seabelis and @mheiman, have told us that now that all sort links are in a dropper, it's becoming more challenging to re-select the sort option they want every time they redo a search.

Breakdown

Requirements Checklist

  • Selecting a sort option should update the selected result for that type in localstorage
  • If a value exists in localstorage and a patron performs a search for a given type, the corresponding localstorage value should be fetched and used / put into the search form as sort= <input type="hidden" name="sort" value="$(whatever-localstorage-value)>

Related files


Instructions for Contributors

Please run these commands to ensure your repository is up to date before creating a new branch 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.

@mekarpeles mekarpeles added Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed] Theme: Search Issues related to search UI and backend. [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Good First Issue Easy issue. Good for newcomers. [managed] Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] and removed Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] labels Oct 3, 2024
@cdrini cdrini added Needs: Community Discussion This issue is to be brought up in the next community call. [managed] and removed Good First Issue Easy issue. Good for newcomers. [managed] labels Oct 3, 2024
@cdrini
Copy link
Collaborator

cdrini commented Oct 3, 2024

Heads up marking this as needs community discussions since I think the proposed solution would be confusing. Would love for folks to discuss it during the next design call! I will be away, but here are the main concerns:

  1. Users will be confused who might try searching for something and try the e.g. random sort. Then next time they search a few days later, all their results will be random!
  2. Sorting is often used for a specific type of search, and generally doesn't specify a user preference.
  3. I can't find any other website that makes the sorting option sticky. It's not a common UX pattern. (eg TPL, LibraryThing, Amazon)

I liked @seabelis proposal of adding a checkbox to make the search filters/sort sticky. That seems like the best of both worlds. Gives librarians/expert users a way to toggle stickiness when they're working on a certain task, and gives the larger majority of users who use Open Library not for bulk editing the experience that's standard across the rest of the web.

@bitnapper
Copy link

I'd prefer another arrangement for the dropdown if that is possible:

image

Also a cahnge from Show only ebooks? to [x] eBooks only

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Needs: Community Discussion This issue is to be brought up in the next community call. [managed] Needs: Response Issues which require feedback from lead Priority: 3 Issues that we can consider at our leisure. [managed] Theme: Search Issues related to search UI and backend. [managed] Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed]
Projects
None yet
Development

No branches or pull requests

3 participants