Skip to content

controllers/crates: default to sort by recent downloads #7889

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

Merged
merged 3 commits into from
Jul 6, 2024

Conversation

punkeel
Copy link
Contributor

@punkeel punkeel commented Jan 7, 2024

"Browse All Crates" is the most prominent link in the menu bar, displayed on all pages. Before this change, this link would present the user with (mostly) irrelevant crates, as it was sorted alphabetically: crates like a, a-, a0, etc.

With this change, the list is now sorted to present the most downloaded crates first.

/keywords/:term already defaults to that same order.

Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

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

seems like a good idea to me, thanks! :)

@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-frontend 🐹 labels Jan 7, 2024
@Turbo87
Copy link
Member

Turbo87 commented Jan 7, 2024

@punkeel it looks like a couple of tests are failing though. could you take a look?

@eth3lbert
Copy link
Contributor

eth3lbert commented Feb 20, 2024

Digging into the failure a bit further, to make the test pass, you need to:

  1. Make the response reflect the sorting method: Add support for sorting by recent-downloads in the mirage/route-handlers/crates.js file.
  2. Update the corresponding assert value: Since the default sorting method has now changed to recent-downloads, we need to update crates sort, All-Time and Recent values in the tests/acceptance/crates-test.js file accordingly.

punkeel and others added 2 commits July 6, 2024 13:44
"Browse All Crates" is the most prominent link in the menu bar, displayed on all pages. Before this change, this link would present the user with (mostly) irrelevant crates, as it was sorted alphabetically: crates like `a`, `a-`, `a0`, etc.

With this change, the list is now sorted to present the most downloaded crates first.

`/keywords/:term` already defaults to that same order.
Copy link

codecov bot commented Jul 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.06%. Comparing base (b6ddda3) to head (39a2ff0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7889      +/-   ##
==========================================
+ Coverage   89.04%   89.06%   +0.02%     
==========================================
  Files         278      278              
  Lines       27987    27987              
==========================================
+ Hits        24922    24928       +6     
+ Misses       3065     3059       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Turbo87 Turbo87 merged commit a6763cb into rust-lang:main Jul 6, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants