Skip to content
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

Shuffle sometimes forgets sort order when changing filters #472

Open
Bilge opened this issue Jan 4, 2023 · 4 comments
Open

Shuffle sometimes forgets sort order when changing filters #472

Bilge opened this issue Jan 4, 2023 · 4 comments

Comments

@Bilge
Copy link

Bilge commented Jan 4, 2023

Shuffle version
v6.1.0

Describe the bug
Shuffle sometimes forgets sort order when changing filters.

Reproduction link
One day

To Reproduce
Try it here: https://club.steam250.com/tags#AJMAAQI

Expected behavior
Do not forget.

Screenshots
In this video, we see two button groups: sort buttons on the left and filter buttons on the right. The sort order is set to frequency, which is the number displayed inside each tag. The sort order is always reverse, i.e. highest frequency (largest number) to lowest. By playing around with the filters a bit, we can eventually coerce Shuffle into conveniently forgetting it is supposed to sort in reverse frequency order.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox
  • Version 108.0.1 (64-bit)
@Bilge Bilge changed the title Shuffle sometimes forgets reverse sort order when changing filters Shuffle sometimes forgets sort order when changing filters Jan 4, 2023
@Bilge
Copy link
Author

Bilge commented Jan 5, 2023

Added note to clarify Shuffle only forgets the sort order when the filter is set to an empty array (though not always).

@Bilge
Copy link
Author

Bilge commented Jan 5, 2023

The sort buttons just call sort({by}) and the filter buttons just call filter(array). That is, we never pass SortOptions to filter(). Probably this issue could be worked around by keeping track of the current SortOptions in my implementation and repeating them in filter() calls, but it is supposed this should be handled by the library already (were it not buggy). The documentation is not clear on whose responsibility it is to persist the SortOptions when performing filtering and sorting simultaneously.

@Bilge
Copy link
Author

Bilge commented Jul 22, 2023

Even forcefully (re)setting the SortOptions when changing the filters does not fix the issue: when Shuffle decides it's going to ignore the sort options, it is absolutely adamant that it is going to ignore the sort options in this animation tick, whether we redeclare them or not. Moreover, it does not matter whether we redeclare the sort options before or after changing the filters.

Nevertheless, redeclaring the sort options manually some ticks later still works.

@Bilge
Copy link
Author

Bilge commented Jul 22, 2023

I don't really feel like the original video was very clear, so I made a new one. Also the note about empty arrays is completely irrelevant.

In this clip we see the sort order is ignored the first time a filter group is added, but corrected when it is removed and re-added or when another filter is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants