RESOLVED FIXED Bug 90361
Web Inspector: Make DirectoryContentView sortable
https://bugs.webkit.org/show_bug.cgi?id=90361
Summary Web Inspector: Make DirectoryContentView sortable
Taiju Tsuiki
Reported 2012-07-02 00:32:37 PDT
DirectoryContentView should have sortable columns.
Attachments
Patch (4.63 KB, patch)
2012-07-02 00:39 PDT, Taiju Tsuiki
no flags
Patch (8.74 KB, patch)
2012-07-02 22:10 PDT, Taiju Tsuiki
no flags
Taiju Tsuiki
Comment 1 2012-07-02 00:39:50 PDT
Vsevolod Vlasov
Comment 2 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?
Taiju Tsuiki
Comment 3 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.
Vsevolod Vlasov
Comment 4 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.
Taiju Tsuiki
Comment 5 2012-07-02 22:10:34 PDT
Taiju Tsuiki
Comment 6 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.
WebKit Review Bot
Comment 7 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>
WebKit Review Bot
Comment 8 2012-07-03 02:17:46 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.