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

fix(web): sort folders #15691

Merged
merged 1 commit into from
Jan 26, 2025
Merged

fix(web): sort folders #15691

merged 1 commit into from
Jan 26, 2025

Conversation

C-Otto
Copy link
Contributor

@C-Otto C-Otto commented Jan 26, 2025

fixes #13145

@mertalev
Copy link
Contributor

It's better to handle this in the query itself rather than in the client. #12214 is quite old and needs a rebase, but it handles sorting among other things.

@C-Otto
Copy link
Contributor Author

C-Otto commented Jan 26, 2025

That won't work because Object.keys and Object.entries are used, which don't retain the order of the items passed in. There's already a "sort" operation in the existing web code, which doesn't work for this reason. Sorting in the backend has the same effect: none.

@mertalev
Copy link
Contributor

That won't work because Object.keys and Object.entries are used, which don't retain the order of the items passed in. There's already a "sort" operation in the existing web code, which doesn't work for this reason. Sorting in the backend has the same effect: none.

I'm pretty sure it did work at the time that I wrote it. It's possible that the current client code does things that would make it behave differently, though.

@C-Otto
Copy link
Contributor Author

C-Otto commented Jan 26, 2025

As you can see in the linked issue's screenshots, there currently is no sorting.

@alextran1502
Copy link
Contributor

Hello, have you tested with the test case of the following folder name or tag name to see if they are sorted naturally?

1-folder
2-folder
11-folder
12-folder

@C-Otto
Copy link
Contributor Author

C-Otto commented Jan 26, 2025

image

@alextran1502
Copy link
Contributor

So, it looks like the natural order isn't working here. Did it sort in natural order before the changes?

@C-Otto
Copy link
Contributor Author

C-Otto commented Jan 26, 2025

It works, as shown on the screenshot? What kind of "natural order" do you think of? Before, there was no sorting at all, just random.

@alextran1502
Copy link
Contributor

So I think natural order as in

1 -> 2 -> 11 -> 12

In the screenshot it is showing

1 -> 11 -> 2 -> 12

@C-Otto
Copy link
Contributor Author

C-Otto commented Jan 26, 2025

We're dealing with strings here, though. Different game, different rules :)

@alextran1502 alextran1502 merged commit e864811 into main Jan 26, 2025
40 checks passed
@alextran1502 alextran1502 deleted the fix-sort-folders branch January 26, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Folder view sorts months alphabetically
3 participants