Merge "Fix two tiny issues with autocompletion logging"
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
index 68ab132..6f7e151 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
@@ -945,6 +945,7 @@
   }
 
   private reportHintInteractionSaved() {
+    if (this.autocompleteAcceptedHints.length === 0) return;
     const content = this.messageText.trimEnd();
     const acceptedHintsConcatenated = this.autocompleteAcceptedHints.join('');
     const numExtraCharacters =
@@ -1444,7 +1445,7 @@
     );
     this.reportHintInteraction(
       Interaction.COMMENT_COMPLETION_SUGGESTION_FETCHED,
-      context
+      {...context, hasDraftChanged: this.messageText !== commentText}
     );
     if (!response?.completion) return;
     // Note that we are setting the cache value for `commentText` and getting the value
diff --git a/polygerrit-ui/app/utils/autocomplete-cache.ts b/polygerrit-ui/app/utils/autocomplete-cache.ts
index c8077ab..b1dba44 100644
--- a/polygerrit-ui/app/utils/autocomplete-cache.ts
+++ b/polygerrit-ui/app/utils/autocomplete-cache.ts
@@ -24,6 +24,8 @@
   acceptedSuggestionsCount?: number;
   totalAcceptedCharacters?: number;
   savedDraftLength?: number;
+
+  hasDraftChanged?: boolean;
 }
 
 /**