Skip to content

Sort crates by number of downloads in the last 90 days #702

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

Closed
Tracked by #9 ...
carols10cents opened this issue May 2, 2017 · 3 comments
Closed
Tracked by #9 ...

Sort crates by number of downloads in the last 90 days #702

carols10cents opened this issue May 2, 2017 · 3 comments
Labels
C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works E-has-mentor E-help-wanted

Comments

@carols10cents
Copy link
Member

carols10cents commented May 2, 2017

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 :)

@retep998
Copy link
Member

retep998 commented May 2, 2017

I want to preserve the option to sort by all time downloads.

@PritiKumr
Copy link
Contributor

PritiKumr commented Jun 13, 2017

Going forward with option 2 ,preserving ability to sort by all time downloads looks good to me :)

@carols10cents
Copy link
Member Author

Yup, that sounds great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works E-has-mentor E-help-wanted
Projects
None yet
Development

No branches or pull requests

3 participants