code100x / daily-code

https://projects.100xdevs.com/
833 stars 1.02k forks source link

bug: Tracks Not Sorted Correctly When Changing Categories or Sorting Options on Landing Page #676

Open Amit-K-007 opened 1 month ago

Amit-K-007 commented 1 month ago

Description:

On the Landing page, course tracks are displayed with options to filter by category and sort by various parameters. However, there are several issues with how the tracks are sorted when categories or sorting options are changed.

Steps to Reproduce:

  1. Open the homepage where the courses are listed.
  2. By default, tracks are displayed in "newest first" order.
  3. Change the category from the filter options.
    Issue: The tracks do not maintain the "newest first" order after changing the category (latest tracks should appear first by default).
  4. Select a sorting option, such as "descending". The tracks are sorted correctly in descending order.
  5. Change the category again.
    Issue: The tracks appear in random order, and the same sorting option is still selected in the dropdown (here, "descending").
  6. Attempt to re-select the "descending" sorting option.
    Issue: The "descending" option cannot be re-selected unless another sorting option is chosen first.

Expected Behavior:

Bug Demo:

https://github.com/user-attachments/assets/e534e934-42fb-41e0-aee9-9c8dae13a063