regular-table icon indicating copy to clipboard operation
regular-table copied to clipboard

added standalone multisort implementation to file_browser example

Open telamonian opened this issue 5 years ago • 2 comments

Adds a standalone implementation of multisort to the file_browser.html example. Slightly simplified, but mostly equivalent to the one recently removed from events.js:

image

telamonian avatar Jun 02 '20 14:06 telamonian

Multicolumn sort now tree-aware:

image

~Got a bit messy, but is fully functional. I'll try and clean it up~

Cleanup done. Tree-aware multisort implementation still significantly more complex than multisort implementation for flat lists. The sort-in-place pattern becomes impractical, and you need a touch of recursion to deal gracefully with the arbitrary depth tree.

Which made me consider: does V8 do tail call optimization?

telamonian avatar Jun 02 '20 21:06 telamonian

I added sorting tests to file_browser.test.js. The tests for sorting a flat filebrowser all pass. The tests for sorting a filebrowser tree with several expanded nodes work in principle, but are currently failing due to an issue with scrollTo (see note in code here).

@texodus Not sure exactly what the problem is, but the scrollTo issue/test failures are sensitive to the exact value of viewport height. Any thoughts?

telamonian avatar Jun 07 '20 04:06 telamonian