Merge "Add collapse functionality for AI fixes"
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 9b54db3..504ee63 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
@@ -68,6 +68,8 @@
@state() repo?: RepoName;
+ @state() hasEdit = false;
+
@state()
changeNum?: NumericChangeId;
@@ -110,6 +112,14 @@
);
subscribe(
this,
+ () => this.getChangeModel().revisions$,
+ revisions =>
+ (this.hasEdit = Object.values(revisions).some(
+ info => info._number === EDIT
+ ))
+ );
+ subscribe(
+ this,
() => this.getUserModel().diffPreferences$,
diffPreferences => {
if (!diffPreferences) return;
@@ -339,6 +349,7 @@
repo: this.repo!,
patchNum: EDIT,
basePatchNum,
+ forceReload: !this.hasEdit,
})
);
fire(this, 'apply-user-suggestion', {});