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

File browser: Sort by size/name/date #164

Closed
onny opened this issue Oct 30, 2012 · 47 comments
Closed

File browser: Sort by size/name/date #164

onny opened this issue Oct 30, 2012 · 47 comments

Comments

@onny
Copy link

onny commented Oct 30, 2012

Hey,
I would like to sort files in the file browser by size/name/date.
For example: I have a folder containing protocols and unfortunately because of their name, they're not sorted in chronological order. I would like to sort them by clicking on the column description "Size" by descending and ascending order. Every folder should have it's own sorting preferences which OwnCloud remembers.

Best regards,
onny

@ghost ghost assigned icewind1991 Oct 30, 2012
@jancborchardt
Copy link
Member

Yes, great suggestion, also with remembering the sort order. The only interface change should be an either up or down pointing caret on the heading of the sort index column then. Starting with »Name« and pointing down.

@DeepDiver1975
Copy link
Member

Perfect Junior Job to me.
@Julian1998 do you want to take care of this?

@goeck
Copy link
Contributor

goeck commented Oct 31, 2012

I suggested this last year, but nobody seemed to care. The more I am happy that this now gets burning. I think this will flavour up the files UI.

+1 from me

@karlitschek
Copy link
Contributor

Would be a great feature. @goeck "Not care" is a bit harsh. We can only fix a limited number of bugs and implement a limited number of features at the same time. :-) A patch is always welcome.

@goeck
Copy link
Contributor

goeck commented Oct 31, 2012

@karlitschek sorry, wasn't my intent to bash around here. Just ment, that nothing happened, even some comment. Anyway, I am confident that now we have a brand new base to work that thing. :-)
I know the time problem, that's why my commits are quite few these days...

@tanghus
Copy link
Contributor

tanghus commented Oct 31, 2012

For the person taking it as a Junior Job, the following is a blazing fast way to sort a table. Replace '.nametext' with e.g. '.filesize' or whatever the classname is for the specific element, and of course use something else than localCompare() to compare numeric or date values.

var $fileList = $('#fileList')
var rows = $fileList.find('tr').get();

rows.sort(function(a, b) {
    return $(a).find('.nametext').text().trim().toUpperCase().localeCompare($(b).find('.nametext').text().trim().toUpperCase());
});

$.each(rows, function(index, row) {
    $fileList.append(row);
});

Edited to use the right selector and cache it it to avoid DOM lookups. /cc @Julian1998

@Julian1998
Copy link
Contributor

I will try this @DeepDiver1975

@ghost ghost assigned DeepDiver1975 Oct 31, 2012
@DeepDiver1975
Copy link
Member

Ok- I'll sponsor @Julian1998

@DeepDiver1975
Copy link
Member

@tanghus
Thanks for the snippet above.
I wonder if we really should do the sorting in the browser.
My solution would be to sort on database level and push sorted results to the browser.
As soon as the user chooses another columns/direction the result set will be reloaded from the server.

@jancborchardt
How do we want to 'pimp' the files view in case there are hundreds of files?
Paginate? endless scroll?
I'm asking as this can have impacts on the sorting implementation.

@jancborchardt
Copy link
Member

@DeepDiver1975 endless scroll, but with »lazy loading« if it’s over a certain limit, say 50 files (or whenever performance is impacted). That means only load as many entries as the viewport can show, and then some. When people scroll down, start loading more. Then when it’s scrolled more, load more. To people it should seem instantaneous.

@DeepDiver1975
Copy link
Member

@jancborchardt
THX - this means we need to sorting the stuff on the database level.

@Julian1998 go go go - learn SQL! ;-)

@jancborchardt
Copy link
Member

Just as a note – once this is possible we could change the default sort order from the current alphabetical to a more relevant sorting by date. Recently edited files/folders tend to be more relevant, and that way they are sorted on top and very visible by default.

@DeepDiver1975
Copy link
Member

@icewind1991 within the new filesystem implementation: is sorting already possible?
We stopped digging into the backend code due to the new filesystem to come. THX

@MTRichards
Copy link
Contributor

Just adding that sorting the files in the web interface by Name (up or down), by date modified and by size with clicks on the top menu items would go a long way towards usability. Can we resurrect this?

@DeepDiver1975
Copy link
Member

I think the whole files app needs some love for OC6.
Maybe open a new issue to collect all requirements we have an prepare a plan to make it real for OC6.

@jancborchardt @icewind1991

@hwinkel
Copy link

hwinkel commented Mar 18, 2013

+1 for that, with a long list of files OC becomes unusable without sorting. I never expected a fundamental feature like this is not in OC.

@jancborchardt
Copy link
Member

@hwinkel as always the ideas are not the problem, but rather someone to implement them. Do you want to get your hands dirty here and contribute? Would be cool, and let us know if you need any help! :)

@hwinkel
Copy link

hwinkel commented Mar 18, 2013

You can't imagine how dirty my hands are ;-) I rather would go to become a commercial customer of OC5.0 as working on this. Dont get me wrong, but we are looking to use OC as the system it is, We as a software company have so much other things to do, but would like to use OC as part of our IT, ;)

@jancborchardt
Copy link
Member

@hwinkel I’d then encourage you to become a customer, then we can get more people to work on implementing features like this and #2424. :)
And please don’t get me wrong, keep the feedback & requests coming!

@hwinkel
Copy link

hwinkel commented Mar 18, 2013

Sure, I'll test OC 5.0 for a couple of days now, found a longish list of problems already and going to report them here step by step i.e. #2431. We are usualy a company becoming paying customers for OpenSource Software. But some critical problems should be solved first. BTW: how this problems are handled for paying customers?

@jancborchardt
Copy link
Member

@hwinkel cool, thanks! We solve problems according to capacity, or if someone from the community sends a pull request. For paying customers, specific issues can be solved faster of course, because that’s what they pay for among other things. But best mail [email protected], you’ll get more information there.

@Niduroki
Copy link
Member

I'm wondering: How are folders dealt with when sorting?
E.g. if I sort by name and my folders all start with z they'll be at the end of the list, this will be saved.
What if I want the folders at the top of the list again, like it is now?

@raghunayyar you'll be working on the files app eventually. Is this on your list?

@jancborchardt
Copy link
Member

Folders should always be sorted above files, because they are different than files in a view. Mixing up folders and files is confusing. Regardless if you sort by name, date or whatnot, files and folders in a specific view should be sorted in themselves. That is

  • Afolder
  • Bfolder
  • Cfolder
  • Afile
  • Bfile
  • Cfile

Becomes sorted the other way around:

  • Cfolder
  • Bfolder
  • Afolder
  • Cfile
  • Bfile
  • Afile

Apart from the sake of this example, reverse-alphabet sorting is completely useless.

@raghunayyar
Copy link
Member

@Kondou-ger not at the moment, but we can certainly have iterations in the files app :)

@Niduroki
Copy link
Member

@raghunayyar I may help with this. :)

If this won't be done in SQL I may also finally use my knowledge on sorting algorithms that I gained in school and haven't really used yet \o/

(We should definitely use heap-sort for this :super-effective: :P
this way I can also use my binary tree knowledge, yay!)

@Niduroki
Copy link
Member

Niduroki commented Sep 7, 2013

@DeepDiver1975 @icewind1991

@DeepDiver1975
Copy link
Member

@ursawarrior
this is most probably a js job - feel free to follow @tanghus proposal #164 (comment)

Would be great to have this in oc6 on basis of the current files app because the rewrite as mentioned above will not happen that soon

@Bugsbane
Copy link

@ursawarrior - any progress happening with this?

@hutber
Copy link

hutber commented Dec 18, 2013

Any updates on sorting options? Its my single biggest feature request :)?

@Bugsbane
Copy link

I have a feeling, people are looking at this and thinking Ursawarrior has taken this on, but... we haven't heard anything from ursa in months. Do they have a fork here on GitHub? Then we can see if there are any commits happening...

@Bugsbane
Copy link

I can't see any branch by Ursa... :| Hopefully they're working locally...

@PVince81
Copy link
Contributor

I'm working on making the files more JS'y, so adding sort would be in scope once i'm done.
Let's keep this issue open just for that.

@Bugsbane
Copy link

Bugsbane commented Mar 9, 2014

I'm really hoping that we can eventually get something flexible enough to cover all the various places that ownCloud lists files, such as the pictures and documents apps as well as the basic files view, so the ux and code is consistent throughout.

Either way, just getting this moving would be fantastic, as right now I'm having to dig trough hundreds of files daily, to find the most recently uploaded file, and it's a real pain.

@PVince81
Copy link
Contributor

PVince81 commented Apr 3, 2014

@Bugsbane unfortunately the code is not the same at the moment between different file views, so sorting will at first be limited to files/trashbin/public page.

@owncloud/designers what "sort arrow" should be used for the header columns ? Is there an existing example ?

@goeck
Copy link
Contributor

goeck commented Apr 4, 2014

Hey Vincent,
regarding the arrow design question: I really like the way roundcube
webmailer shows the tables and available sorting methods. It also shows,
which kind of sorting is activated thereby.

See http://roundcube.net/images/screens/mailview.jpg

Is this feature really getting alive soon? I'd be crazy happy.

Kind regards
Stefan

Am 2014-04-03 21:22, schrieb Vincent Petry:

@Bugsbane [1] unfortunately the code is not the same at the moment between different file views, so sorting will at first be limited to files/trashbin/public page.

@owncloud/designers what "sort arrow" should be used for the header columns ? Is there an existing example ?

Reply to this email directly or view it on GitHub [2].

Links:

[1] https://github.com/Bugsbane
[2] #164 (comment)

@PVince81
Copy link
Contributor

PVince81 commented Apr 4, 2014

@goeck I just started working on it: #8041

@PVince81
Copy link
Contributor

Implemented in this pull request: #8041
Please have a look and test 😄

@PVince81
Copy link
Contributor

The code is on master / OC 7 pre-alpha as per the above PR.
Closing.

@Bugsbane
Copy link

Thanks for implementing this @PVince81 ! This goes a long, loooong way towards improving the usability of the files app.

Any chance of implementing the parts mentioned about sorting order using by date by default (most recent at the top), and the request to have each folder remember the last used sort order (by that user)?

Specifically:
"Every folder should have it's own sorting preferences which OwnCloud remembers." @onny

"we could change the default sort order from the current alphabetical to a more relevant sorting by date. Recently edited files/folders tend to be more relevant, and that way they are sorted on top and very visible by default." @jancborchardt

Should I file a separate issue for this?

@PVince81
Copy link
Contributor

@Bugsbane yes, please raise a separate issue for this.

@Bugsbane
Copy link

Ok, done over at #10788

aditmeno pushed a commit to aditmeno/Aeolus that referenced this issue Apr 2, 2015
add generic stream wrapper developed by icewind as 3rdparty dependency
@lock lock bot locked as resolved and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests