RefactorInsight
RefactorInsight copied to clipboard
Suggestions for improving `RefactoringHistoryToolbar`
I've noticed potential issues with the RefactoringHistoryToolbar:
- New instance of
VcsLogUiis created on every double click on the leaf node withRefactoringInfo, this is not good performance-wise. - Each time
RefactoringHistoryActionis executed, new ui components are created, even though ui for the same element may exist already.RefactoringHistoryToolbar#showContenteven finds the old content, but still replaces the old ui with the new one, instead of just refreshing it.
I think that that the code could be improved by extracting a class that represents one single tab with refactorings for a single element, let's call this RefactoringHistoryTab. This RefactoringHistoryTab would have one Tree instance, and one VcsLogUi (created on demand). The RefactoringHistoryAction would either find an existing RefactoringHistoryTab and focus it, or create a new one if nothing was found.