Skip to content

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

Closed

Description

@onny

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

Activity

  1. jancborchardt commented on Oct 30, 2012

    @jancborchardt
    Contributor

    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.

  2. DeepDiver1975 commented on Oct 31, 2012

    @DeepDiver1975
    Contributor

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

  3. goeck commented on Oct 31, 2012

    @goeck
    Contributor

    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

  4. karlitschek commented on Oct 31, 2012

    @karlitschek
    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.

  5. goeck commented on Oct 31, 2012

    @goeck
    Contributor

    @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...

  6. tanghus commented on Oct 31, 2012

    @tanghus
    Contributor

    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

  7. Julian1998 commented on Oct 31, 2012

    @Julian1998
    Contributor

    I will try this @DeepDiver1975

  8. DeepDiver1975 commented on Oct 31, 2012

    @DeepDiver1975
    Contributor

    Ok- I'll sponsor @Julian1998

  9. DeepDiver1975 commented on Nov 5, 2012

    @DeepDiver1975
    Contributor

    @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.

  10. jancborchardt commented on Nov 5, 2012

    @jancborchardt
    Contributor

    @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.

  11. DeepDiver1975 commented on Nov 5, 2012

    @DeepDiver1975
    Contributor

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

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

  12. jancborchardt commented on Dec 14, 2012

    @jancborchardt
    Contributor

    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.

  13. DeepDiver1975 commented on Dec 14, 2012

    @DeepDiver1975
    Contributor

    @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

  14. 26 remaining items

  15. self-assigned this
    on Feb 18, 2014
  16. added this to the milestone on Mar 6, 2014
  17. Bugsbane commented on Mar 9, 2014

    @Bugsbane

    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.

  18. PVince81 commented on Apr 3, 2014

    @PVince81
    Contributor

    @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 ?

  19. goeck commented on Apr 4, 2014

    @goeck
    Contributor

    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)

  20. PVince81 commented on Apr 4, 2014

    @PVince81
    Contributor

    @goeck I just started working on it: #8041

  21. PVince81 commented on Apr 11, 2014

    @PVince81
    Contributor

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

  22. PVince81 commented on May 12, 2014

    @PVince81
    Contributor

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

  23. Bugsbane commented on Aug 30, 2014

    @Bugsbane

    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?

  24. PVince81 commented on Aug 31, 2014

    @PVince81
    Contributor

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

  25. Bugsbane commented on Aug 31, 2014

    @Bugsbane

    Ok, done over at #10788

  26. locked as resolved and limited conversation to collaborators on Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions