[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

SortWidget: sort alphabetically #11705

Merged
merged 3 commits into from
Apr 30, 2024
Merged

SortWidget: sort alphabetically #11705

merged 3 commits into from
Apr 30, 2024

Conversation

hius07
Copy link
Member
@hius07 hius07 commented Apr 23, 2024

1


This change is Reviewable

@jonnyl2
Copy link
Contributor
jonnyl2 commented Apr 23, 2024

Thanks for adding this. Had a quick test and what stood out was that it is case sensitive; a-z comes after A-Z. Should probably be case insensitive?

@Frenzie
Copy link
Member
Frenzie commented Apr 23, 2024

I think that's @NiLuJe's cue. xD

(See https://en.wikipedia.org/wiki/Natural_sort_order for some background.)

@hius07
Copy link
Member Author
hius07 commented Apr 23, 2024

Case insensitive (actually depends on the default global DALPHA_SORT_CASE_INSENSITIVE that is truthy).

2

@NiLuJe
Copy link
Member
NiLuJe commented Apr 23, 2024

I think that's @NiLuJe's cue. xD

:D

IIRC, we do have a natsort-ish variant in the FM sorting hat, and while that usually didn't really matter in SortWidget, the one example being shown here (e.g., Collections) might be the one where it... does ;).

@hius07
Copy link
Member Author
hius07 commented Apr 23, 2024

we do have a natsort-ish variant in the FM sorting hat

Exactly, let's reuse it:

local FileChooser = require("ui/widget/filechooser")
local sort_func = FileChooser:getSortingFunction(FileChooser.collates[collate], reverse_collate)

@Commodore64user
Copy link
Contributor
Commodore64user commented Apr 27, 2024

Wouldn’t it be better to have just two choices (a to z and natural sort) and a reverse sorting option? It would be more in-line with the way it works on file browser.

@Frenzie
Copy link
Member
Frenzie commented Apr 27, 2024

(As well as file managers in general.)

@Commodore64user
Copy link
Contributor
Commodore64user commented Apr 27, 2024

In fact, why not just have the natural sorting one? (Same for the other file manager/browser)

@Frenzie
Copy link
Member
Frenzie commented Apr 27, 2024

Performance. The dumb one is significantly faster.

@hius07
Copy link
Member Author
hius07 commented Apr 27, 2024

Wouldn’t it be better to have just two choices (a to z and natural sort) and a reverse sorting option?

It's a one-time operation, not a long-lasting setting like in FM.
I press one button and get the result.

@hius07 hius07 merged commit 8ff846b into koreader:master Apr 30, 2024
2 of 3 checks passed
@hius07 hius07 deleted the sort-alphabet branch April 30, 2024 10:30
@hius07 hius07 added this to the 2024.05 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants