controllers/crates: default to sort by recent downloads
"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.
@punkeel it looks like a couple of tests are failing though. could you take a look?
Digging into the failure a bit further, to make the test pass, you need to:
- Make the response reflect the sorting method: Add support for sorting by
recent-downloadsin themirage/route-handlers/crates.jsfile. - Update the corresponding assert value: Since the default sorting method has now changed to
recent-downloads, we need to updatecrates sort,All-TimeandRecentvalues in thetests/acceptance/crates-test.jsfile accordingly.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.