Description
Part of RFC 1824, rust-lang/rust#41616.
The decision made in RFC 1824 was to change the default ordering for crates within keywords and categories to be the number of downloads in the last 90 days rather than the number of downloads for all time.
An implementation question unresolved in that RFC: should we change the current sort option "Downloads" to always be "Downloads in the last 90 days" and remove the ability to sort by all-time downloads at all (Option 1), or should we add a new option to all sorting menus for downloads in the last 90 days and keep the option to sort by all-time downloads (Option 2)?
What needs to be done for either option:
For pages like crates in the category "Data structures" or crates with the keyword "ffi" (and notably NOT for a search result page which should remain sorted by relevance by default, or the Browse All Crates page, which should remain sorted alphabetically by default):
- Change the default ordering from all-time downloads to downloads in the last 90 days only. Actual implementation will depend on which option we go with, but the diesel query being built here will need to be modified at some point.
What needs to be done if we go with Option 1 (replacing sorting by all-time downloads with sorting by downloads in the last 90 days):
- Change the label of the sort, everywhere, from "Downloads" to "Recent Downloads" or similar (fix CSS if necessary to continue to look nice wider)
- Change the number of downloads displayed with each crate, everywhere, to be the number of downloads in the last 90 days so that the numbers match the sort
- Keep the
sort=downloads
query parameter, and just change what it does to the diesel query here and here
What needs to be done if we go with Option 2 (adding sorting by downloads in the last 90 days to the sorting options and keeping sorting by all-time downloads as well):
- Add the label "Recent Downloads" or similar to all the sorting options, everywhere (fix CSS if necessary to continue to look nice wider)
- Either switching the display of the number of downloads next to each crate to the number of all-time downloads depending on which sort option you've chosen, or alternatively always displaying both the number of downloads in the last 90 days and the number of all time downloads next to every crate, labeled as such.
- Create a new query parameter
sort=recent-downloads
or similar and add code to test for that value and handle it in diesel here and here
Also add tests no matter what we go with.
Please weigh in if you have opinions on which option we go with!
If you'd like to work on this and there haven't been any comments, you get to pick which option we go with! Please ask me if you have any questions :)