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

Remember last sorted column for each tab (Downloads, Uploads, Search Files, etc) #2170

Closed
redactedscribe opened this issue Sep 2, 2022 · 10 comments · Fixed by #2825
Closed
Milestone

Comments

@redactedscribe
Copy link
Contributor

redactedscribe commented Sep 2, 2022

Describe the solution you'd like

When I user the Search Files tab in particular, each time I perform a search I manually sort the results by the Speed column (which takes two clicks: first slowest to fastest, then the more logical fastest to slowest). Would it be possible for each subsequent search to then be automatically sorted by the Speed column and fastest to slowest?

I guess this isn't already being done because new results are always being appended to the bottom as they come in. Maybe results could be continually sorted by the actively sorted column? This however would have the effect of the list jumping around as new searches come in and are, for example, inserted above the point at which you are currently scrolled to, but maybe there is a way to mitigate this?

Other tabs may also benefit from this feature, and I think the sorted columns should persist across sessions.

Any thoughts?

Nicotine 3.2.5

@mathiascode
Copy link
Member

See #373 (comment)

It's been a while since I last looked at the issue, so I may revisit it at some point.

@slook
Copy link
Member

slook commented Sep 2, 2022

This idea would work for the Downloads and Uploads, but the method of identifying the user's sort order preference based on column header clicks in the Search Files and Browse Shares views is more complex because of the multiple page tabbed interface.

It might feel like a strange UX to select a sort order in one tab but then switch to another secondary tab, then it might be expected that the remembered sort order would be that which was last viewed, but infact that would not necessarily be the case as the tabs are often switched after performing a sort operation.

Therefore, it might be a more consistent UX to have options in the Preferences for the user to explicitly define the default sort order for the views which have multiple tabs (Shared Files, Browse Shares), and then it would seem logical to have all the default sort options in there as well.

Thus, with explicit options in the Preferences any ad-hoc column sorting operations would be treated as temporary, in order to allow the user to retain their preferred sorting views across sessions without fear of permanently messing things up.

Or perhaps, there could be a context menu item to save the default column layout/sort order "Save default layout" which applies the current column arrangement/width/order/sort settings to all currently open tabs and for all future tabs that are opened.

@redactedscribe
Copy link
Contributor Author

It's been so long that I found myself rewriting the same issue. I think it's more well thought out than my original issue.


When clicking the Speed column header (or any other numerical column) on the Search Files tab, it sorts from smallest to largest on the first click, and then the opposite way on the second click.

In almost all cases, one has to click twice to get the typically desired sort order: Largest to smallest (i.e. fastest to slowest speed). You could argue the same is desirable for the columns Size, Bitrate, and possibly Length. Where this doesn't make sense is for the In Queue column and arguably the ID column.

Perhaps the column sorting logic could be adjusted?

  • One option is to invert the default sort order for all numerical columns for the sake of the first set of columns I mentioned (which I think are probably used more often). Though I'd be likely happy enough with this, the quality of the solution isn't great in my opinion.
  • The more sound option is to make it so that the last sort order of a column is remembered, either per session, or across them (which would be ideal): Currently, if we click on the Speed header (sorted slowest to fastest) and then on any other, e.g. Folder, and then back on Speed, Speed gets re-sorted (now fastest to slowest). Instead, when going from any other column back to Speed for example, if the Speed column was sorted as it was previously, requiring an additional click to then invert the sorting, this could solve the issue. How? Every time I click on Speed, it'll be the sorted by the order that I usually prefer. This would apply to other columns, e.g. the ID column (smallest to largest; the inverse sort order of Speed).

@slook
Copy link
Member

slook commented Jan 15, 2024

@redactedscribe Your feature request has been added to the next release candidate. It would be very helpful if you could test the latest build and report back if everything is working as expected for you:
https://github.com/nicotine-plus/nicotine-plus/blob/master/doc/TESTING.md

@redactedscribe
Copy link
Contributor Author

Other than the PR settling for remembering the sort order for columns in only some of the tabs (i.e. not Search, unfortunate in my opinion), the column which the list is sorted by, and its sort order, do appear to be remembered across sessions correctly. A welcome addition, thanks 👍


The somewhat minor issue remains with having to click some columns twice (as I have already attempted to describe above, possibly poorly):

All columns are sorted in an ascending order (so: 0-9/A-Z) by default.

A) If you look at for example Microsoft's File Explorer, each column has its own default sort order (the sort order for its initial click). Clicking Name will sort A-Z (assuming not already sorted by Name), but clicking Size will sort 9-0 (descending). Nicotine+ sorts every column in an ascending order which just means requiring an extra click to sort (most) numerical columns in the typically desirable, descending 9-0 order ("most", because for example in the case of the In Queue column, 0-9 could arguably make more sense). This is what I tried to describe in my first bullet point in my previous comment.

B) I failed to explain myself well in my second bullet point: You could go further than simply defining how Nicotine+ should sort the initial clicks of currently unsorted columns: If columns each remembered their sort order (per session), then when they are clicked again (after having sorted the list by a different column), sort the column by the last remembered order. An example: Sort Note column on the Buddies tab by Z-A, then sort by e.g. the Speed column, then sort by Note again: Its order would still be Z-A, not always reverting to the default of A-Z.

So there's a few options for how I see these two ideas being applied:

  1. A + B: Devs take the time to define what the individual default sort orders for each column should be (potentially laborious), and columns remember their last sort order per session. A new session uses the default sort order for the initial click.
  2. A only: No remembering of last sort orders. Just friendlier defaults defined.
  3. B only (per session): No need to define any defaults, all columns all sort in an ascending order as they do currently. For each session, once the user has sorted a column, remember its last order so that when they sort by that column again, it sorts by the last sort, rather than always defaulting to ascending. This means the initial clicks per session may not be ideal (ascending), but once the user has inverted the sort, if they want to sort by that column again, it's in the order they'd likely prefer.
  4. B only (across sessions): Remembering the last sort orders of each column across sessions would mean clicking on a column is typically always in the order you expect (excluding the very first time you ever click a column since no state has yet been saved for its last sort order).

As mentioned, it's minor, but it does remain a little clunky having to click certain columns twice to sort by what seems the logical order. Based on what I wrote, I'm thinking B only (across sessions) would work best: Users define the "default" column sort orders through general use of the software. Perhaps with a "Reset all column sort orders" under Preferences > User Interface.

Thanks.

@mathiascode
Copy link
Member

If we're going to implement this, I'm leaning towards A only, but Gtk.TreeView doesn't support changing the default order when clicking a column header. We would have to hack around it somehow.

@mathiascode
Copy link
Member

Columns with numerical sort values are now sorted in descending order on the first click. Please try the latest build and let me know how it works for you.

As you mentioned, there are a few exceptions where this new behavior doesn't make sense (e.g. In Queue). Please list all of them, and I'll see if I can add overrides for these columns.

@redactedscribe
Copy link
Contributor Author

Firstly, I can't test the columns on the Uploads tab: I have no uploads, and no columns are visible in that state.

I think it's probably best to keep the numerical columns without exceptions (other than in the most obvious of cases such as In Queue, and Queue on the Downloads and Uploads(?) tab). I say this because it could end up feeling to a user like there is no rhyme or reason behind a numerical column's default sorting choice if the default is too subjective, and then clicking between different numerical columns would become a matter of clicking once on some and twice on others if defaults don't align with expectations; it should be expected that numerical columns sort descending (with rare exception), and alphanumerical columns ascending.

The only other numerical column which could have an exception is the Duration column since File Explorer (and likely other file managers), as well as media players, often have shortest to longest as the default sort for "Length".

It may not be easily possible, but when sorting Last Seen (on the Buddies tab) in a descending order (its default, i.e. most recently seen to least), buddies with no last-seen value (blank) are listed above the most recent buddies. These blank last-seen buddies should be at the very bottom (after "Never seen" I presume). I suggest this because when ordering a list of files by, for example, Quality, all audio files with a quality value are listed first, then files with no value (blank) at the bottom (e.g. jpg, log).

The above blanks-before-values probably manifests in other columns too, e.g. Note on the Buddies tab. My expectation is that if I click this column, it'd be ascending (which it is), with buddies with no note value at the bottom. If this was remedied with a broad fix, I'm not sure of the side effects on other columns. Maybe leave this as-is.

Other than that, I don't have any further suggestions. Numerical columns in all tabs appear to sort 9-0 by default, which feels like a small QoL win.

@mathiascode
Copy link
Member

It may not be easily possible, but when sorting Last Seen (on the Buddies tab) in a descending order (its default, i.e. most recently seen to least), buddies with no last-seen value (blank) are listed above the most recent buddies. These blank last-seen buddies should be at the very bottom (after "Never seen" I presume). I suggest this because when ordering a list of files by, for example, Quality, all audio files with a quality value are listed first, then files with no value (blank) at the bottom (e.g. jpg, log).

This one is subjective in my opinion. Does it make more sense to show the most recently seen (i.e. online) users first, or after the least recently seen ones?

The above blanks-before-values probably manifests in other columns too, e.g. Note on the Buddies tab. My expectation is that if I click this column, it'd be ascending (which it is), with buddies with no note value at the bottom. If this was remedied with a broad fix, I'm not sure of the side effects on other columns. Maybe leave this as-is.

Not sure if this behavior can be changed easily.

Other than that, I don't have any further suggestions. Numerical columns in all tabs appear to sort 9-0 by default, which feels like a small QoL win.

Good to hear.

@redactedscribe
Copy link
Contributor Author

This one is subjective in my opinion. Does it make more sense to show the most recently seen (i.e. online) users first, or after the least recently seen ones?

Right. I guess I didn't ask myself why they're blank. They're online, right? In that case I agree with you. Online first, then most recently seen.

@mathiascode mathiascode added this to the 3.3.0 milestone Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants