You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
TLDR JavaScript is dumb.
Currently we handle sorting in the sidebar by passing a
sortAs
function tocreateTwoLevelViewJSX
. 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.The text was updated successfully, but these errors were encountered: