-
Notifications
You must be signed in to change notification settings - Fork 0
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] Two indistinguishable events for different cases of working set reordering #2007
Comments
Comment by TomMalbran Both events are different. Maybe the naming wasn't the best thought.
Combining them without knowing from which type of sort it was triggered would give problems with the automatic sort disable, the DOM update and the scroll into view. The first problem can be fixed and wouldn't add much more operations needed as mentioned in: adobe/brackets#2058. The DOM re-update for the drag and drop sort might be ok. But, the scroll into view might bring problems. If you drag and drop unselected items while the selected one not being in the view, might make it feel weird if the view scrolls to show that item after dropping. In a long working set view list where scrollbars appear, it might feel weird if the selected item ends outside the view after sorting, knowing that it would always be in the view before sorting. I am not sure how this last part can be solved without knowing what action produced the event. Combining them and passing a boolean with the information if it was drag and drop or not, would make the combination really easy. |
Comment by redmunds Tom tried to merge these 2 events into 1, but the code became more complicated, and still didn't quite work. The 2 events have clearly distinguished purposes (it was just the poorly chosen names of the events that were "indistinguishable"), so the events were renamed |
Comment by peterflynn
It would be much better if there was a single |
Comment by peterflynn Nominating for Sprint 28 since, if we're going to change the events again, we shouldn't leave the new-old ones in place for too long... |
Comment by TomMalbran I understand your point now. The idea is not to merge them, but to have both actions trigger 1 event. The initial request to fix it, used the same event, and everything worked, but there was one small issue. When you use the menu to sort the elements, the command first sorts the files internally and then triggers an event to update the DOM list. When dragging and dropping elements, you are already updating the DOM and then updating the internal structure. So the solution was to trigger the event after the drop was done, but then as it was the same event as before, it re-updated the DOM which isn't required. What about having 1 event |
Comment by njx Removing from sprint 28. Low priority. |
Comment by peterflynn Fixed by landing Tom's PR -- closing. |
Issue by peterflynn
Wednesday Nov 07, 2012 at 22:23 GMT
Originally opened as adobe/brackets#2076
DocumentManager dispatches either "workingSetReorder" or "workingSetSort" when the order of entries in the working set changes. Neither event gives any further info, so views must respond to both identically: by blowing away and rebuilding their entire rendition of the working set.
We should either:
(a) Merge the two events so views only need one listener.
(b) Provide more context for "workingSetSort" so optimized handling is possible, justifying having a second event.
I'd prefer (a) since it simplifies our code and APIs and is less error prone (can't forget to listen to one case). And because there's no evidence that we'll need the optimizations that would be enabled by (b).
The text was updated successfully, but these errors were encountered: