Community
Participate
Working Groups
The favorites list in the navigator is not sorted. It may be that they are sorted in the order that they are added. Shouldn't the favorites be sorted alphabetically?
See pull request https://github.com/eclipse/orion.client/pull/13 The solution I implemented is to run a sort after any change to the favorites and stored searches in favorites.js. It would certainly be nicer to not have to explicitly sort, but rather ensure that the arrays are implicitly sorted on each change (similar to a SortedSet in Java), but since there does not appear to be a simple way of doing this in javascript I think my current approach is sufficient. I did not write any tests for this, but can if you would like me to. I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use.
thanks, I'll take a look!
Forgot to mention that I was going to look at this. :) Pull request: https://github.com/eclipse/orion.client/pull/14 I decided to implement the sort from within the favorites service (rather than in the UI). This ensures that all clients of the favorites service receive favorites in the same order. An argument can be made that it is the clients job to do the sorting since each client may want to do something different with the favorites, but I think this is likely to lead to code duplication since alphabetical ordering seems like the most likely ordering for all clients. I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use.
thanks, Andrew! I agree with you that for now we may as well do it one place in the service. There are many places in the UI where it would be nice to let the user sort (navigator, favorites, commits, etc.) but until we do that, we should at least have a reasonable/meaningful default. I cherrypicked the commit and then followed it with a commit that removed the function "favoriteExists" as I assume this will arrive with the fix for bug 349785. If it's not there, I'll add it back.
(In reply to comment #4) > I cherrypicked the commit and then followed it with a commit that removed the > function "favoriteExists" as I assume this will arrive with the fix for bug > 349785. If it's not there, I'll add it back. sorry, Andrew (Andy?). I saw the "still can add duplicate favorites" bug go by today and thought that you had reopened the original bug about duplicates. So I figured I'd commit this one first and wait for the fix to the other. Now I see that you opened a different bug, so I could have committed them in the order you submitted, in which case that function would have already been added.