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

Circulars Sort Results by Relevance #1829

Merged
merged 31 commits into from
Feb 14, 2024

Conversation

tylerbarna
Copy link
Member

Currently, searching for circulars sorts by circular ID (ie newest to oldest), but it's also possible to sort by relevance; I'm unsure if it would be better to sort by relevance once we implement the NLP search functionality

Searching 'GRB' and sorting by ID:
image

Searching 'GRB' and sorting by relevance:
image

There's some balance to be made between showing the most relevant results and also weighting the most recent results, since they're arguably the circulars users are more likely to search for.

Another option would be to default to relevance and have the option to sort by circular ID if a toggle is set; this could be accomplished using the sortable tables, which I've been experimenting with in #1816

Copy link
Member

@lpsinger lpsinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice idea. Would you please add a dropdown menu that switches between sort by circular ID and relevance?

also renamed some of the sort variables
very very rough version of a UI button for selecting the sort method. defaults to sorting by circularID but can be changed to relevance. partial implementation of a sort order, but that needs to be implemented in the button.
@tylerbarna tylerbarna marked this pull request as ready for review January 24, 2024 18:47
@tylerbarna
Copy link
Member Author

I tried to do something similar to the date range filtering button, and the component is pretty similar as a result. I wanted to try to have it so there was a button to change the order of the results to be ascending instead of descending, but that isn't fully functional at the moment.
image

Also need to figure out a better looking menu; I used the DetailsDropdownContent component, but I'm not entirely sure if that's the best option here; would be nice to try to figure out a way to use the Select component while still being able to have it appear as a standard button.

image

Copy link
Member

@lpsinger lpsinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Remove commented out code
  • Use radio buttons instead of links
  • Don't manually construct the query string; the values of the radio buttons will automatically be included in the form request on submission
  • Let's not add support for selecting sort order right now; there's no reason to support sorting by decreasing relevance.

@tylerbarna
Copy link
Member Author

switched to radio buttons
image

@tylerbarna
Copy link
Member Author

It occurs to me that it would be useful to have some sort of listener that automatically collapses any divs if the user clicks away from them to prevent menus from drawing over each other like this

image

tylerbarna and others added 2 commits February 12, 2024 14:06
made sortOptions keyed by value and then switched the way the mapping worked when generating the radio buttons as a result. Changed label for Circular ID option to date. backend still uses circularID, however
@tylerbarna
Copy link
Member Author

the failing check seems to be a network error?

tylerbarna and others added 3 commits February 14, 2024 11:17
sort selection input is now sanitized such that the SortSelector function checks that the provided value in the url is a key of the sortOptions object. If it is not, the value defaults to sorting by the date.
@lpsinger lpsinger merged commit 8139725 into nasa-gcn:main Feb 14, 2024
6 checks passed
jak574 pushed a commit to swyatt7/gcn.nasa.gov that referenced this pull request Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants