Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sortAs is completely broken #12

Open
raxod502 opened this issue May 11, 2020 · 0 comments
Open

sortAs is completely broken #12

raxod502 opened this issue May 11, 2020 · 0 comments

Comments

@raxod502
Copy link
Member

TLDR JavaScript is dumb.

Currently we handle sorting in the sidebar by passing a sortAs function to createTwoLevelViewJSX. The function returns an array, because any reasonable programming language would let you use an array as a sort key, and compare lexicographically. Unfortunately, it turns out that JavaScript just converts both arrays to strings and then compares those. This is obviously completely broken and it's a total fluke that it doesn't break any noticeable use case in the app. Unfortunately, it's incredibly inconvenient to thread the sort logic all the way through the stack, which is what you have to do to work around this. But it needs to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant