Bug 500512 - Date Sort order should default to newest first, not oldest first
Summary: Date Sort order should default to newest first, not oldest first
Status: ASSIGNED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: 6.10.0
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-21 09:29 UTC by Christian Hartmann
Modified: 2025-03-05 08:19 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Hartmann 2025-02-21 09:29:38 UTC
SUMMARY
---

The default sort order in KDE / XDG file picker is by *Name* is alphabetical.

The default sort order in KDE / XDG file picker is by *Date* is oldest to newest (top down), which is inconsistent with the behavior of ancient ls(1) ($ ls -lt) command and might be inconvenient for many if not most of the users.

Note:
This report is asking for a simple(?) swap of the default sort order (on first click) to most-recent files first.  It is not asking for any configurable [or not] approach to change it to a more complex per directory based solution. 

Note:
The same is likely true for any window or view in Dolphin.

Ref:
https://discuss.kde.org/t/date-sort-order-on-first-click-in-file-picker/30354

STEPS TO REPRODUCE
---

1. use file picker to open or save any file from any application (including those, that use it as XDG component)
2. click on 'Date'
3. sort order is:  *oldest* files first (at top of the list)

note: the behavior depends on what you have done before with this dialog - it seems to start with last sort order used.

OBSERVED RESULT
---

1., 2. and 3. see above

EXPECTED RESULT
---

3. should be: newest files first (at top)


SOFTWARE/OS VERSIONS
Windows: ---
macOS:  ----
KDE Plasma Version: 6.3.0 and earlier
KDE Frameworks Version: 6.10.0 and earlier
Qt Version: 6.8.2
Comment 1 John 2025-02-21 10:36:33 UTC
I can confirm this on Debian 13 (Trixie) with the unstable repository and:

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.11.0
Qt Version: 6.7.2
Kernel Version: 6.12.15-amd64 (64-bit)
Graphics Platform: Wayland

And I agree with the bug reporter!
When sorting by dates it's more useful to see the most recent first.
And one more problem that I see there is using just the term 'Date' which I assume is the modification date.
What if a file was never modified, but just created / copied?
I wish it would be more precise!
Like:
Modified date
Or just:
Modified (like in Dolphin).
Also I see that you cannot change or other the other types of as unlike Dolphin, clicking on columns' headers doesn't work!
Comment 2 Christian Hartmann 2025-02-26 14:42:39 UTC
Sorting by date in WordPress backend also sort most recent first.
Comment 3 Nate Graham 2025-03-04 21:16:42 UTC
This is a bit tricky, because right now "reversed sort order" is a setting that applies globally to all of the sorting methods, not to individual ones.

We have two options that I can see:
1. Change it to save the value of "reversed sorting" per sorting method, not globally, and then reverse only the date sorting method by default.
2. Secretly reverse whatever order gets applied to the date sorting method, without touching the config file at all.

#2 is a lot less complex; I'll submit a patch for that and see what people say.
Comment 4 Bug Janitor Service 2025-03-04 21:25:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1824
Comment 5 Christian Hartmann 2025-03-05 06:57:49 UTC
(In reply to Bug Janitor Service from comment #4)
> A possibly relevant merge request was started @
> https://invent.kde.org/frameworks/kio/-/merge_requests/1824

Although I struggle to understand every line¹ of the patch personally,  I love to see that quick action on the subject!

¹ spec. the part with the bitwise OR op ;)
Comment 6 pallaswept 2025-03-05 08:11:18 UTC
(In reply to Christian Hartmann from comment #5)
> ¹ spec. the part with the bitwise OR op ;)

That sets the sort order by flipping the relevant bit. If it's already set, then it will be cleared by the OR, if it's not, it will be set.

Likewise, I'm super pleased to see this get such immediate attention, thanks Nate. I don't want to complain but... NGL I'm kinda bummed to see this is being excluded for dolphin :( I don't really understand the logic behind this. 

I'm still under the impression (I could be wrong!) that most people, most of the time, want to see the files which they have used recently, first.

Not that I advocate blindly copying other applications, but Windows Explorer sorts by most recent first. I'm not certain as I don't use it, but looking at Apple's docs, it seems Mac's Finder also does. Funnily enough, when I searched the web about Gnome Files (aka Nautilus), without any prompt regarding sort order at all, the AI told me that it sorts in ascending (ie oldest first) order, *and then gave the instructions I would need to reverse that*, so even the search engine with all its data, concluded that people like it better that way and often search to find out how. Here's a link so you can see what I saw. https://search.brave.com/search?q=gnome+files+sort+by+date&source=web&conversation=81ca696d2efc5a5b9f237f&summary=1

The more I try to prove myself wrong on this, the more I fail. Am I missing something?
Comment 7 pallaswept 2025-03-05 08:19:07 UTC
(In reply to pallaswept from comment #6)
> That sets the sort order by flipping the relevant bit. If it's already set,
> then it will be cleared by the OR, if it's not, it will be set.

Hah, I clicked reply, closed the tab, saw the code in the next tab, and went "wait, that's not an XOR". I probably should have read the actual code and not just the comment, I'm sorry. It's an OR, not an XOR, so it sets the bit, rather than flips it. Sorry for rushing that one. I was honestly a bit distracted :)