cover icon indicating copy to clipboard operation
cover copied to clipboard

column sorting is not preserved between page loads in HTML formatting

Open florence opened this issue 9 years ago • 7 comments

with the HTML sorter if I sort the index by some column, visit a page, then go back the sorting reverts to the default setting. It should really do the other thing.

florence avatar Aug 06 '15 14:08 florence

Right, its just a bunch of static html pages; nothing is preserved or communicated between pages. The quick way is to inject stuff into the window location and then use the referer instead of the raw page. That feels kinda gross and hacky. I'd prefer to do some kind of SPA-like thing. But I'm incredibly hesitant to actually write that in raw javascript.

rpless avatar Aug 06 '15 15:08 rpless

I think I'm okay with jank URL hacks/referer hacks. As long as the average user doesn't think the UI is hacky its fine. And I worry about maintainability of having some kind of raw JS SPA. The window.location hack is much simpler.

florence avatar Aug 06 '15 15:08 florence

The other option is require a front-end framework as a dependency.

rpless avatar Aug 06 '15 15:08 rpless

I don't really have a problem with that as long as we include it with cover (so that the HTML view still works without internet access).

florence avatar Aug 06 '15 16:08 florence

Did the default sorting column ever change?

florence avatar Sep 04 '15 17:09 florence

No. What were we going to sort on? Percentage? You can replace this line https://github.com/florence/cover/blob/master/cover/private/html/assets/app.js#L66, with sortTable('coverage-percentage', floatCompareAsc) to make percentage the default.

rpless avatar Sep 04 '15 17:09 rpless

Changed in afe8ad666c251cde87502a63a86ef2465274169a

florence avatar Sep 04 '15 21:09 florence