Extensions List: Sorting #126

Closed
opened 2024-05-14 12:28:01 +02:00 by Pablo Vazquez · 9 comments

The current list of extensions is sorted by their average score, we could additionally offer more ways to sort extensions based on properties such as the following.

Sort by:

  • Newest First (-date_approved)
  • Oldest First (date_approved)
  • Recently Updated (-date_modified)
  • Most Reviewed (-total_ratings_count)
  • Rating (-average_score)
  • Downloads (-download_count)
  • Title (A-Z) (-name)
  • Title (Z-A) (name)

Implementation

  • Back-end
  • Front-end (add to Home and List views)
The current list of extensions is sorted by their average score, we could additionally offer more ways to sort extensions based on properties such as the following. Sort by: - [x] Newest First (`-date_approved`) - [x] Oldest First (`date_approved`) - [x] Recently Updated (`-date_modified`) - [ ] Most Reviewed (`-total_ratings_count`) - [x] Rating (`-average_score`) - [x] Downloads (`-download_count`) - [x] Title (A-Z) (`-name`) - [x] Title (Z-A) (`name`) #### Implementation - [x] Back-end - [x] Front-end (add to Home and List views)
Pablo Vazquez added the
Priority
Low
Type
Feature
labels 2024-05-14 12:28:01 +02:00

The front-end with a possible layout / design is prepared on the filter-sort branch:

extensions-website-add-ons-sort-by-example.png

Alternatively, we can display Sort by input and tags listing in a row, by making the tags listing horizontally scrollable. (This would make the feature more compact, but the items at the end of the list would be less exposed.)

I'm not sure we should add filtering and sorting features to the home page, as the the items shown there are already a subset of all listings.

The front-end with a possible layout / design is prepared on the `filter-sort` branch: ![extensions-website-add-ons-sort-by-example.png](/attachments/88f19adc-8133-4fb4-a021-20f0a2fcefdd) Alternatively, we can display _Sort by_ input and tags listing in a row, by making the tags listing horizontally scrollable. (This would make the feature more compact, but the items at the end of the list would be less exposed.) I'm not sure we should add filtering and sorting features to the home page, as the the items shown there are already a subset of all listings.
Oleg-Komarov self-assigned this 2024-05-27 18:13:59 +02:00
Owner

I've added the counts for tags and support for sort_by, except for ratings count option - this requires a new field on the model that would be updated every time a rating is created or changes is_listed status.
Default sorting now is "newest first".

If we really need sorting by number of ratings from the start, we can add it, but I would question the need for this:
I see the use case when comparing alternative items in the same category, e.g. when shopping, but in our case I'm not sure why a user would want to sort by most or least reviewed extensions.
I don't have a very strong opinion against adding this, but if we don't really need it, let's not add more complexity to the system.

We should also consider #145 to improve the sort by rating as a follow up (requires a change to RatingMixin.recalculate_average_score and a data migration to update stored values). I think it's better to implement it once we merge this initial change.

@martonlente I think we should review the UI element for sort by: it should be obvious how the list is sorted (and it is always sorted in some way, passed as sort_by to the template) without clicking the button. I've added it in an ugly way for now, please give it some love :)

I've added the counts for tags and support for sort_by, except for ratings count option - this requires a new field on the model that would be updated every time a rating is created or changes is_listed status. Default sorting now is "newest first". If we really need sorting by number of ratings from the start, we can add it, but I would question the need for this: I see the use case when comparing alternative items in the same category, e.g. when shopping, but in our case I'm not sure why a user would want to sort by most or least reviewed extensions. I don't have a very strong opinion against adding this, but if we don't really need it, let's not add more complexity to the system. We should also consider #145 to improve the sort by rating as a follow up (requires a change to RatingMixin.recalculate_average_score and a data migration to update stored values). I think it's better to implement it once we merge this initial change. @martonlente I think we should review the UI element for sort by: it should be obvious how the list is sorted (and it is _always_ sorted in some way, passed as `sort_by` to the template) without clicking the button. I've added it in an ugly way for now, please give it some love :)
Author
Owner

I've added the counts for tags and support for sort_by

Awesome!

Default sorting now is "newest first".

For now it's fine so it shows the site is alive, but unless we have a section in the list for "featured" or "Community Favourites" or so, I think it's better to have average_score, once #145 is implemented?

I don't have a very strong opinion against adding this, but if we don't really need it, let's not add more complexity to the system.

I think that's fine.

I've added it in an ugly way for now, please give it some love :)

I've pushed a few small tweaks to the branch:
sort by

@Oleg-Komarov do you think the branch as it is should be ready for merge with main from the back-end point of view?

> I've added the counts for tags and support for sort_by Awesome! > Default sorting now is "newest first". For now it's fine so it shows the site is alive, but unless we have a section in the list for "featured" or "Community Favourites" or so, I think it's better to have `average_score`, once #145 is implemented? > I don't have a very strong opinion against adding this, but if we don't really need it, let's not add more complexity to the system. I think that's fine. > I've added it in an ugly way for now, please give it some love :) I've pushed a few small tweaks to the branch: ![sort by](/attachments/548be05d-fa44-4072-a3c8-273b81bc1d3c) @Oleg-Komarov do you think the branch as it is should be ready for merge with main from the back-end point of view?
Owner

For now it's fine so it shows the site is alive, but unless we have a section in the list for "featured" or "Community Favourites" or so, I think it's better to have average_score, once #145 is implemented?

Not sure I understand: how would that section be different from sorting by rating and when/where would it be displayed?

do you think the branch as it is should be ready for merge with main from the back-end point of view?

Yes, it is complete (I would prefer the rating ordering to be in a separate PR) and should be good to go. We planned that Marton would take a final look at it on Monday, but if you want, you can go ahead.

> For now it's fine so it shows the site is alive, but unless we have a section in the list for "featured" or "Community Favourites" or so, I think it's better to have average_score, once #145 is implemented? Not sure I understand: how would that section be different from sorting by rating and when/where would it be displayed? > do you think the branch as it is should be ready for merge with main from the back-end point of view? Yes, it is complete (I would prefer the rating ordering to be in a separate PR) and should be good to go. We planned that Marton would take a final look at it on Monday, but if you want, you can go ahead.
Contributor

From a user's standpoint, the default sorting method of 'newest first' might not be the most intuitive. Users primarily visit these platforms to discover useful content. Considering an item's popularity or rating as a measure of its usefulness seems more logical.

There are better ways to showcase new add-ons, such as creating a dedicated section on the home page below the most popular items.

From a user's standpoint, the default sorting method of 'newest first' might not be the most intuitive. Users primarily visit these platforms to discover useful content. Considering an item's popularity or rating as a measure of its usefulness seems more logical. There are better ways to showcase new add-ons, such as creating a dedicated section on the home page below the most popular items.
Owner

This makes sense, I've changed the default sorting to rating on all lists (home page, add-ons/themes).

This makes sense, I've changed the default sorting to rating on all lists (home page, add-ons/themes).
Owner

I've also pushed a migration to add indexes for these sorting options.

I've also pushed a migration to add indexes for these sorting options.
Owner

Opened a PR: #159

Opened a PR: #159

The related filter-sort branch, and PR #159 was merged to main, as such, I'm closing the issue.

The related `filter-sort` branch, and PR #159 was merged to `main`, as such, I'm closing the issue.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/extensions-website#126
No description provided.