I am changing the order of these operations in preparation for other commenting widgets and models where the threads may already be given. The threading will in the next steps move out of the gr-diff completely, while the thread grouping needs to stay because it strongly depends on the diff's viewMode. This change makes some assumptions: * comments belonging to a thread have the same line The previous code had special handling for unsaved draft comments, but even before this change I could not get that to work. Basically, unsaved drafts are stored in local storage, but never added to the comments object. As such, they will disappear when you switch between unified and side-by-side mode, and come back when you create a comment in the same location. I decided not to try to fix this as part of this refactoring, because I am not 100% sure what the desired behavior is. I did remove the code that did not have any affect though. Change-Id: I297291767603c9d82efb969a6cafc36d7f9a210c
48 KiB
48 KiB