Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Nov 16, 2023

Summary

Add fixed sorting mode for "folder before files" and "favorites before other" - meaning those should if configured sorted before even for descending.

Checklist

@nickvergessen

This comment was marked as resolved.

@blizzz blizzz mentioned this pull request Nov 16, 2023
@susnux
Copy link
Contributor Author

susnux commented Nov 16, 2023

@nickvergessen resolved - waiting for reviews.

@nickvergessen nickvergessen removed their request for review November 16, 2023 11:24
@susnux susnux changed the title fix(files): Ensure folders and favorites are sorted first regardless or sorting mode fix(files): Ensure folders and favorites are sorted first regardless of sorting mode Nov 16, 2023
this.isAscSorting ? 'asc' : 'desc',
this.isAscSorting ? 'asc' : 'desc',
]
return [identifiers, orders] as const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as const ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes otherwise the type would be (v => bool | string)[] using const the type is [v => bool, string] making it obvious that this only returns an array with exactly two elements. So that we can deconstruct it for orderBy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before after
Screenshot_20231116_142714 Screenshot_20231116_143023

…or sorting order

Also fixes `mtime` being wrong sorted, as high mtime means recently edited -> lower

Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux requested a review from artonge November 16, 2023 13:25
@susnux
Copy link
Contributor Author

susnux commented Nov 16, 2023

/compile amend/

Signed-off-by: nextcloud-command <[email protected]>
@blizzz blizzz added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 16, 2023
@susnux susnux merged commit 82e08f1 into master Nov 16, 2023
@susnux susnux deleted the fix/files-sorting branch November 16, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish bug feature: files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Nc 28 beta 3: sorting favorites on top broken

7 participants