elementary / default-settings

Default settings for elementary OS
GNU General Public License v3.0
39 stars 28 forks source link

Sort indicator should show current state #177

Closed marbetschar closed 3 years ago

marbetschar commented 4 years ago

Prerequisites

Describe the bug

The arrow which indicates the sort direction of a column in files should indicate the current sort direction, instead of what will happen on click. I tried to get used to this behaviour over the last couple of months, but it still confuses me:

If we sort by modified date, the behaviour of the sort indicator arrow right now is:

-▼: ORDER BY date_modified ASC -▲: ORDER BY date_modified DESC

Instead, I always seem to expect the opposite:

-▲: ORDER BY date_modified ASC -▼: ORDER BY date_modified DESC

Here's the screenshot, showing the current, unexpected behaviour:

Screenshot from 2020-05-21 11-48-15

Sidenote: IMHO the arrow behaviour should also be inverted for any other column, because ORDER BY file_name ASC for me is equal A-Z, but the actual sorting done in Files is Z-A:

Screenshot from 2020-05-21 11-58-03

jeremypw commented 4 years ago

Files seems to be similar to how other filemanagers behave. In each case the arrow points in the direction of the current sequence beginning -> end. So when the start of the sequence is at the bottom, the arrow points upwards - as shown in both images above. For me, an alphabetic sequence begins at A, a number sequence begins at the least positive and for time it begins at the oldest (i.e. in the direction of time's arrow). However I can appreciate that it is possible to look at time the other way round and begin at the most recent. The terms "ascending" and "descending" are not really helpful as they only have an obvious sense in relation to size.

One difference I notice with Nautilus however is what the default sort order is when you click on an unsorted column header. For alphabet and size, the arrow points downwards but for date it points upwards (i.e. the date nearest to present is at the top). I think there is a good argument for this as presumably the user is more likely to be interested in recent files.

marbetschar commented 4 years ago

I'm not 100% sure if the current behaviour of Files on terms of the sort indicator is similar to Windows Explorer and macOS Finder. I simply noticed I'm confused literally every time I use the sort feature in elementary Files - and that never happened to me before on macOS or Windows.

Usually I sort by modified date, sometimes by file name. My description above is probably not 100% accurate, just tried to wrap in words a possible solution to mitigate my confusion ;)

marbetschar commented 4 years ago

PS: I guess the "beginning of the sequence" in my world is the top-most visible element. So if I sort "upwards" alphabetically I expect the first element in the list of files to start with an "A". But in elementary Files it seems to be the "Z". If I understand your comment correctly, this is because the "beginning of the sequence" is at the bottom - and therefore not visible, if there are a lot of elements.

jeremypw commented 4 years ago

Fair enough - I was only referring to Linux filemanagers. I've not used Windows for a while and MacOS hardly ever.

Like you, if the first element ("A") comes at the top of the list I would regard that as sorting "upwards", but that is nothing to do with the direction on screen. It just means the "smallest" element is at the top of the list. The orientation of the list onscreen happens to be downwards (beginning at top) in Files ListView but in IconView it is left-to-right with wrapping. In other locales or apps it could be something different. It would still be an ascending sort.

jeremypw commented 4 years ago

The direction the arrow points is controlled by the Gtk framework - Files just tells it to set the sort type to GTK_SORT_ASCENDING or GTK_SORT_DESCENDING.

marbetschar commented 4 years ago

@jeremypw I understand there are different viewpoints on this, that's why I waited for a few months to bring this up, hoping to get accustomed to it (similar to the single click which works fine, once one gets the hang of it). But even after months, the sort indicator is still weird/confusing to me personally.

Overall I guess the question comes down to something like:

Whats the most natural way to display the current sort direction in the list - regardless of technical implementation details?

Maybe the reasoning for me is similar like scrolling on a touchpad: Scrolling upwards on a touchpad is a downwards finger movement. Which sounds counterintuitive at first, but it feels way more natural.

But hey, if the majority is fine with the way it is, I'm fine with it too - even if it feels "wrong" to me personally. I guess if this behaviour gets changed, others will then complain it is wrong and needs to be fixed...

danirabbit commented 4 years ago

Yeah I think this is out of scope since it’s a Gtk behavior. It should be presented upstream if this should change

jeremypw commented 4 years ago

Yes, we could in theory implement an option to reverse the normal sort order/indicator relation (like natural scrolling) but there would have to be an overwhelming reason to do so.

It seems that we are in line with other Gtk Linux file managers although I notice that Dolphin (KDE) shows the arrows the other way around (and offers 3 sorting modes).

Tbh, I just click the header until the order is what I want and don't pay much attention to the arrows ;-p

jeremypw commented 4 years ago

Also any such sort option would be better at system level as other apps, such as Music, use the same widget and show the same behaviour.

marbetschar commented 4 years ago

Opened issue at GTK, will close this for now:

https://gitlab.gnome.org/GNOME/gtk/-/issues/2772

marbetschar commented 4 years ago

There is a GTK Setting which enables "inverting" the sort indicator: https://developer.gnome.org/gtk2/unstable/GtkSettings.html#GtkSettings--gtk-alternative-sort-arrows

I agree this should be system wide, so Files is probably not the right place. However, as I don't know where to put this issue I'm just reopening for now. Feel free to move where you see fit.

jeremypw commented 4 years ago

Oh, I wasnt aware of that :-( - it does not seem to be exposed in org/gtk/settings or gnome/desktop/interface by dconf-editor (where may other similar settings are) but it is still in ValaDoc and the .vapi so presumably it is not deprecated.

It is not obvious where in Switchboard it should be exposed though.

jeremypw commented 4 years ago

I have found a way you can get the alternative sort order for yourself:

Create a file settings.ini in ~/.config/gtk-3.0. Then put in the file:

[Settings]
gtk-alternative-sort-arrows = true

Log out and back in. You should then have the reversed arrow directions as desired in any gtk app.

marbetschar commented 4 years ago

@jeremypw that's .... awesome!!! Thank you so much - this really made my day!! 🎉️

Feel free to close the issue if you like ;)

jeremypw commented 4 years ago

Well, I learnt something too! I'll leave it open for now as I am not so sure it is a Gtk issue after all (at least not one they are likely to fix) since they provide this setting. It may be someone will move it into a switchboard plug issue tracker. (I cannot move issues).

danirabbit commented 4 years ago

I'm gonna move this to default-settings for consideration

cassidyjames commented 3 years ago

So, I think the way GTK is showing this is actually… correct, though I can see the confusion. The time one is the sort of confusing one, but in each case the arrow is pointing in the direction of the data flow. So if you are sorting by name (i.e. alphabetically), you see: Filename ▼, and then:

The flow goes top to bottom, so the arrow is pointing from top to bottom. If you reverse the direction so it alphabetical from bottom to top, the arrow is reversed: Filename ▲ and you get:

This seems correct to me. It gets more confusing with time, as it depends on if you're thinking in terms of "timestamp" (older is smaller), or "age" (older is larger). However, the current behavior seems consistent if you think in terms of timestamp. By default, sorting ascending you get: Modified ▼ and:

This is showing the ascending order from top to bottom, so the arrow is pointing from top to bottom. Likewise, the reverse is: Modified ▲ and:

This is showing the modified time in descending order (or from bottom to top), so the arrow is pointing from bottom to top.

Correct me if I'm wrong, but is some of the confusion around the difference between "age" and "time", and/or around the shape of the arrow, where is being interpreted as "large at top and small at bottom" instead of "ascending", and vice-versa for ?

cassidyjames commented 3 years ago

Since there's a local workaround and this would require diverging from GNOME and GTK for us to address, I'm closing it. :smile: I think any further pursuit of getting this swapped should be done upstream with GTK if you feel strongly about it.

cassidyjames commented 3 years ago

It seems they actually reversed this upstream. I've filed an issue to use a more semantic icon name that would allow us to do something more explicit: https://gitlab.gnome.org/GNOME/gtk/-/issues/3577