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

[CLOSED] Sort Workingset #1935

Open
core-ai-bot opened this issue Aug 29, 2021 · 8 comments
Open

[CLOSED] Sort Workingset #1935

core-ai-bot opened this issue Aug 29, 2021 · 8 comments

Comments

@core-ai-bot
Copy link
Member

Issue by TomMalbran
Wednesday Oct 31, 2012 at 06:04 GMT
Originally opened as adobe/brackets#1999


This adds to the working set context menu 3 sorting methods and an automatic sort option. When the automatic sort option and a valid sort method are selected, the working set will be sorted when a file is added to it.

This pull also adds an API to easily add new sort methods by using the register function in SortUtils. This function would receive a compare function, used to sort the workingSet, an optional list of events that will be called for the automatic sort (the automatic sort will be disable if the list is empty) and an optional automatic function that will be called when the automatic events are triggered.


TomMalbran included the following code: https://github.com/adobe/brackets/pull/1999/commits

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Wednesday Oct 31, 2012 at 17:24 GMT


Reviewing

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Wednesday Oct 31, 2012 at 21:48 GMT


Initial review complete. Great work!

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Thursday Nov 01, 2012 at 00:57 GMT


Thanks. Made changes and added some questions.

Note: Some comments ended up in the outdated diff.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Nov 01, 2012 at 18:22 GMT


I think I see where I misunderstood...maybe.

What I really was expecting was sorting by the order files were added to the working set. MRU was originally intended for the Next/Previous Document commands. It doesn't seem to work here for sorting the working set. It seems like with auto-sort on, new documents always get added to the top. When off, new documents get added to the bottom. This MRU+auto-sort-off seems roughly equivalent to the current behavior without sorting.

Would it make more sense to offer a "Sort by Newest" or "Sort by Added"? I would actually prefer the to see documents get added to the working set to appear at the top instead of the bottom.

Also, I noticed that no default sorting option is set and once you set a sorting option you can't unset it. I propose you change MRU to "Sort by Added" and make it the default option. What do you think?

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Nov 01, 2012 at 18:46 GMT


Review complete. See my comments about MRU. If you agree, maybe we can simply remove MRU and implement the proposed option as a follow-up pull request.

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Thursday Nov 01, 2012 at 19:05 GMT


After trying it I didn't found MRU sort that useful either. But as it was proposed here: adobe/brackets#1788 so I added it. The list is permanently changing as it doesn't just add to the top, if you open documents in the working set and then add a new one, this documents would also jump t the top.

"Sort by Added/Newest/Opened" could work. I could have a working set list saved and changing it on every document that is opened and use it to then sort the working set.

You can unset it, because once you set it and then click it again, I would never know if the user wants to sort again with that method or disable it. It doesn't really need to get disable, since when you don't have the automatic sort option enable it does nothing. But it could get disable if the user manually sorts the working set or adds files without the automatic sort enable.

The default sort seems that would only work to enable the automatic sort without needing to first enable any sort method. Since it shouldn't sort the working set at the beginning if the user doesn't click on that option.

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Friday Nov 02, 2012 at 07:21 GMT


I made all the fixed required and changed MRU sort for a new Added sort and made it the default option. I had to add a new array in DocumentManager to save AddedOrder, and then used this in the sort function.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Friday Nov 02, 2012 at 17:32 GMT


Looks great! Merging.

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