@RequiresBackgroundThread
    private @Nullable Runnable refreshView() {
      if (myDisposed || !myProject.isInitialized() || ApplicationManager.getApplication().isUnitTestMode()) return null;

      Span span = TRACER.spanBuilder(ChangesView.ChangesViewRefreshBackground.getName()).startSpan();
      try {
        ChangeListManagerImpl changeListManager = ChangeListManagerImpl.getInstanceImpl(myProject);
        List<LocalChangeList> changeLists = changeListManager.getChangeLists();
        List<FilePath> unversionedFiles = changeListManager.getUnversionedFilesPaths();

        boolean shouldShowUntrackedLoading = unversionedFiles.isEmpty() &&
                                             !myProject.getService(InitialVfsRefreshService.class).isInitialVfsRefreshFinished() &&
                                             changeListManager.isUnversionedInUpdateMode();

        boolean skipSingleDefaultChangeList = Registry.is("vcs.skip.single.default.changelist") ||
                                              !changeListManager.areChangeListsEnabled();
        TreeModelBuilder treeModelBuilder = new TreeModelBuilder(myProject, myView.getGrouping())
          .setChangeLists(changeLists, skipSingleDefaultChangeList, getChangeDecoratorProvider())
          .setLocallyDeletedPaths(changeListManager.getDeletedFiles())
          .setModifiedWithoutEditing(changeListManager.getModifiedWithoutEditing())
          .setSwitchedFiles(changeListManager.getSwitchedFilesMap())
          .setSwitchedRoots(changeListManager.getSwitchedRoots())
          .setLockedFolders(changeListManager.getLockedFolders())
          .setLogicallyLockedFiles(changeListManager.getLogicallyLockedFolders())
          .setUnversioned(unversionedFiles);
        if (myChangesViewManager.myState.myShowIgnored) {
          List<FilePath> ignoredFilePaths = changeListManager.getIgnoredFilePaths();
          treeModelBuilder.setIgnored(ignoredFilePaths);
        }
        if (shouldShowUntrackedLoading) {
          treeModelBuilder.insertSubtreeRoot(new ChangesBrowserUnversionedLoadingPendingNode());
        }

        for (ChangesViewModifier extension : ChangesViewModifier.KEY.getExtensions(myProject)) {
          try {
            extension.modifyTreeModelBuilder(treeModelBuilder);
          }
          catch (ProcessCanceledException e) {
            throw e;
          }
          catch (Throwable t) {
            Logger.getInstance(ChangesViewToolWindowPanel.class).error(t);
          }
        }

        DefaultTreeModel treeModel = treeModelBuilder.build(true);

        ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
        indicator.checkCanceled();

        boolean[] wasCalled = new boolean[1]; // ensure multiple merged refresh requests are applied once
        return () -> {
          if (wasCalled[0]) return;
          wasCalled[0] = true;
          refreshViewOnEdt(treeModel, changeLists, unversionedFiles, indicator.isCanceled());
        };
      }
      finally {
        span.end();
      }
    }
@RequiresBackgroundThread
    private @Nullable Runnable refreshView()