Bug 90361 - Web Inspector: Make DirectoryContentView sortable
Summary: Web Inspector: Make DirectoryContentView sortable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Taiju Tsuiki
URL:
Keywords:
Depends on: 89961
Blocks: 68203
  Show dependency treegraph
 
Reported: 2012-07-02 00:32 PDT by Taiju Tsuiki
Modified: 2012-07-03 02:17 PDT (History)
12 users (show)

See Also:


Attachments
Patch (4.63 KB, patch)
2012-07-02 00:39 PDT, Taiju Tsuiki
no flags Details | Formatted Diff | Diff
Patch (8.74 KB, patch)
2012-07-02 22:10 PDT, Taiju Tsuiki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Taiju Tsuiki 2012-07-02 00:32:37 PDT
DirectoryContentView should have sortable columns.
Comment 1 Taiju Tsuiki 2012-07-02 00:39:50 PDT
Created attachment 150371 [details]
Patch
Comment 2 Vsevolod Vlasov 2012-07-02 02:28:25 PDT
Comment on attachment 150371 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150371&action=review

Please make sure directories are correctly sorted.

> Source/WebCore/inspector/front-end/DirectoryContentView.js:139
> +        if (x._entry.isDirectory)

This means directories order would be undefined. We should sort them by name instead.

> Source/WebCore/inspector/front-end/DirectoryContentView.js:146
> +        return (x._metadata ? x._metadata.size || 0 : 0) - (y._metadata ? y._metadata.size || 0 : 0);

Is size defined for directories?

> Source/WebCore/inspector/front-end/DirectoryContentView.js:151
> +        return (x._metadata ? x._metadata.modificationTime : 0) - (y._metadata ? y._metadata.modificationTime : 0);

Is modification time defined for directories?
Comment 3 Taiju Tsuiki 2012-07-02 03:24:43 PDT
Comment on attachment 150371 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150371&action=review

>> Source/WebCore/inspector/front-end/DirectoryContentView.js:139
>> +        if (x._entry.isDirectory)
> 
> This means directories order would be undefined. We should sort them by name instead.

I meant, all directories have same type.
Should we also sort other same-mimetype files by name?

>> Source/WebCore/inspector/front-end/DirectoryContentView.js:146
>> +        return (x._metadata ? x._metadata.size || 0 : 0) - (y._metadata ? y._metadata.size || 0 : 0);
> 
> Is size defined for directories?

No, it doesn't have size, currently.
Should we assign dummy value to directory size? It seems make thing simpler.

>> Source/WebCore/inspector/front-end/DirectoryContentView.js:151
>> +        return (x._metadata ? x._metadata.modificationTime : 0) - (y._metadata ? y._metadata.modificationTime : 0);
> 
> Is modification time defined for directories?

Yes, directories have modification time. It'll be updated when its content is created or removed.
Comment 4 Vsevolod Vlasov 2012-07-02 04:36:44 PDT
(In reply to comment #3)
> (From update of attachment 150371 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=150371&action=review
> 
> >> Source/WebCore/inspector/front-end/DirectoryContentView.js:139
> >> +        if (x._entry.isDirectory)
> > 
> > This means directories order would be undefined. We should sort them by name instead.
> 
> I meant, all directories have same type.
> Should we also sort other same-mimetype files by name?
> 
> >> Source/WebCore/inspector/front-end/DirectoryContentView.js:146
> >> +        return (x._metadata ? x._metadata.size || 0 : 0) - (y._metadata ? y._metadata.size || 0 : 0);
> > 
> > Is size defined for directories?
> 
> No, it doesn't have size, currently.
> Should we assign dummy value to directory size? It seems make thing simpler.
> 
> >> Source/WebCore/inspector/front-end/DirectoryContentView.js:151
> >> +        return (x._metadata ? x._metadata.modificationTime : 0) - (y._metadata ? y._metadata.modificationTime : 0);
> > 
> > Is modification time defined for directories?
> 
> Yes, directories have modification time. It'll be updated when its content is created or removed.
I think there two basic requirements:
 - directories should always precede files
 - "equal" entries should be sorted by name
You might want to use some file manager for the reference.
Comment 5 Taiju Tsuiki 2012-07-02 22:10:34 PDT
Created attachment 150533 [details]
Patch
Comment 6 Taiju Tsuiki 2012-07-02 22:20:19 PDT
Comment on attachment 150371 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150371&action=review

>>>> Source/WebCore/inspector/front-end/DirectoryContentView.js:139
>>>> +        if (x._entry.isDirectory)
>>> 
>>> This means directories order would be undefined. We should sort them by name instead.
>> 
>> I meant, all directories have same type.
>> Should we also sort other same-mimetype files by name?
> 
> I think there two basic requirements:
>  - directories should always precede files
>  - "equal" entries should be sorted by name
> You might want to use some file manager for the reference.

Updated.

The ordering is differ for each file manager. That looks ubuntu style.
Comment 7 WebKit Review Bot 2012-07-03 02:17:40 PDT
Comment on attachment 150533 [details]
Patch

Clearing flags on attachment: 150533

Committed r121748: <http://trac.webkit.org/changeset/121748>
Comment 8 WebKit Review Bot 2012-07-03 02:17:46 PDT
All reviewed patches have been landed.  Closing bug.