Refresh diff when applying suggestion

Currently when user apply suggestion, there is no UI feedback that
anything changed. If user wants to see changes, user needs to reload
page.

With this change, when user is in diff and apply fix - diff will
be reloaded so user see diff between latest patchset and edit patchset
immediately.

This also fixes loading icon for apply fix button.

Release-Notes: skip
Change-Id: Idb0b24515d8c0ef49e6fa72efe48f39a4fd919a9
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts
index 4814733..29d2bf0 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts
+++ b/polygerrit-ui/app/elements/diff/gr-diff-host/gr-diff-host.ts
@@ -127,6 +127,7 @@
     'line-selected': CustomEvent<LineSelectedEventDetail>;
     // Fired if being logged in is required.
     'show-auth-required': CustomEvent<{}>;
+    'reload-diff': CustomEvent<{path: string | undefined}>;
   }
 }
 
@@ -343,6 +344,11 @@
     this.addEventListener('diff-context-expanded', event =>
       this.handleDiffContextExpanded(event)
     );
+    this.addEventListener('reload-diff', (e: CustomEvent) => {
+      if (e.detail.path === this.path) {
+        this.reload(false);
+      }
+    });
     subscribe(
       this,
       () => this.getBrowserModel().diffViewMode$,
diff --git a/polygerrit-ui/app/elements/shared/gr-suggestion-diff-preview/gr-suggestion-diff-preview.ts b/polygerrit-ui/app/elements/shared/gr-suggestion-diff-preview/gr-suggestion-diff-preview.ts
index b9984a9..d059c7c 100644
--- a/polygerrit-ui/app/elements/shared/gr-suggestion-diff-preview/gr-suggestion-diff-preview.ts
+++ b/polygerrit-ui/app/elements/shared/gr-suggestion-diff-preview/gr-suggestion-diff-preview.ts
@@ -315,7 +315,7 @@
    */
   public applyFixSuggestion(onLatestPatchset = false) {
     if (this.suggestion || !this.fixSuggestionInfo) return;
-    this.applyFix(this.fixSuggestionInfo, onLatestPatchset);
+    return this.applyFix(this.fixSuggestionInfo, onLatestPatchset);
   }
 
   /**
@@ -369,6 +369,7 @@
           forceReload: !this.hasEdit,
         })
       );
+      fire(this, 'reload-diff', {path: this.comment?.path});
       fire(this, 'apply-user-suggestion', {});
     }
   }