openedx / frontend-app-course-authoring

The micro-frontend for course authoring in Open edX. Frontend interfaces that currently live in Studio/CMS should eventually live here.
GNU Affero General Public License v3.0
12 stars 65 forks source link

Sort Library Components #1038

Open bradenmacdonald opened 1 month ago

bradenmacdonald commented 1 month ago

✅ In Scope:

  1. Update the backend so that the search index stores the creation, modification, and publication date for each library component.
  2. Implement the sort widget shown in the UI in Figma: sort-example
    • For now, it only needs to work on the "Components" tab.
    • It needs to support these options: a. Title, A-Z b. Title, Z-A c. newest d. oldest e. recently published f. recently modified
  3. The sort widget should be visible on all tabs, and it should "remember" the current sort option when changing tabs.
  4. The sort option should be reflected in the URL, e.g. ?sort=created but should not create a new history entry, so pressing BACK in the browser goes back to the previous page, not the previous sort option.
ChrisChV commented 1 month ago

For now, it only needs to work on the "Components" tab.

@bradenmacdonald As I see it, this functionality is going to be added in Home tab in https://github.com/openedx/frontend-app-course-authoring/issues/1039, right? If so I think #1048 and #1049 will be done in Home in #1039 too.

bradenmacdonald commented 1 month ago

@ChrisChV

As I see it, this functionality is going to be added in Home tab in https://github.com/openedx/frontend-app-course-authoring/issues/1039, right? Yes.

If so I think https://github.com/openedx/frontend-app-course-authoring/issues/1048 and https://github.com/openedx/frontend-app-course-authoring/issues/1049 will be done in Home in https://github.com/openedx/frontend-app-course-authoring/issues/1039 too.

Sure, that makes sense. Though we may implement it for all tabs at once, rather than implementing each tab separately. After all the tabs are very similar.

pomegranited commented 1 week ago

Hi @jmakowski1123 CC @bradenmacdonald

e. recently published

Should selecting this option also filter out any components which have not been published? If we don't filter, un-published components will appear at the bottom of the list, but this might be confusing if no components have been published yet.

pomegranited commented 1 week ago

Hi @jmakowski1123 CC @bradenmacdonald

Since we're also doing keyword search, I kept the default sorting as keyword search relevance. To make this clear to users (and make my code simpler), I chose to show this option to users at the top of the list of sort options:

image

jmakowski1123 commented 2 hours ago

Hi @jmakowski1123 CC @bradenmacdonald

e. recently published

Should selecting this option also filter out any components which have not been published? If we don't filter, un-published components will appear at the bottom of the list, but this might be confusing if no components have been published yet.

Correct, the Recently Published filter should remove any content that is not yet published.

jmakowski1123 commented 2 hours ago

Hi @jmakowski1123 CC @bradenmacdonald

Since we're also doing keyword search, I kept the default sorting as keyword search relevance. To make this clear to users (and make my code simpler), I chose to show this option to users at the top of the list of sort options:

image

  • Is this ok to do?
  • Is "Most Relevant" the label to use?

I think it seems redundant to indicate to users that the default sorting is by most relevant - I think that will be assumed. And if a user wants to override that, they can choose which sort they want, which I think is also intuitive. I would suggest to not include the "Most relevant" as a sort option, and rather assume that users will understand that this is the default behavior.