RefactorInsight icon indicating copy to clipboard operation
RefactorInsight copied to clipboard

Suggestions for improving `RefactoringHistoryToolbar`

Open juliabeliaeva opened this issue 3 years ago • 0 comments

I've noticed potential issues with the RefactoringHistoryToolbar:

  1. New instance of VcsLogUi is created on every double click on the leaf node with RefactoringInfo, this is not good performance-wise.
  2. Each time RefactoringHistoryAction is executed, new ui components are created, even though ui for the same element may exist already. RefactoringHistoryToolbar#showContent even 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.

juliabeliaeva avatar Aug 28 '20 12:08 juliabeliaeva