Add metrics to Flows tab usage

Release-Notes: skip
Bug: Google b/431942227
Change-Id: Idf4ba8f8f3baaa7f25cb1002a87256fec9f278d4
diff --git a/polygerrit-ui/app/constants/reporting.ts b/polygerrit-ui/app/constants/reporting.ts
index 1577936..6d7eced 100644
--- a/polygerrit-ui/app/constants/reporting.ts
+++ b/polygerrit-ui/app/constants/reporting.ts
@@ -174,6 +174,10 @@
   AI_AGENT_SUGGESTIONS_SHOWN = 'ai-agent-suggestions-shown',
   // AI agent suggestions are promoted to a draft comment by user.
   AI_AGENT_SUGGESTION_TO_COMMENT = 'ai-agent-suggestion-to-comment',
+
+  FLOWS_TAB_RENDERED = 'flows-tab-rendered',
+  CREATE_FLOW_DIALOG_OPENED = 'create-flow-dialog-opened',
+  FLOW_CREATED = 'flow-created',
 }
 
 /**
diff --git a/polygerrit-ui/app/elements/change/gr-flows/gr-create-flow.ts b/polygerrit-ui/app/elements/change/gr-flows/gr-create-flow.ts
index f0c8bfb..86ea9fa 100644
--- a/polygerrit-ui/app/elements/change/gr-flows/gr-create-flow.ts
+++ b/polygerrit-ui/app/elements/change/gr-flows/gr-create-flow.ts
@@ -55,6 +55,7 @@
 import {queryAndAssert, unique} from '../../../utils/common-util';
 import {fireAlert} from '../../../utils/event-util';
 import {MdOutlinedSelect} from '@material/web/select/outlined-select.js';
+import {Interaction} from '../../../constants/reporting';
 
 const MAX_AUTOCOMPLETE_RESULTS = 10;
 
@@ -374,6 +375,10 @@
     ];
   }
 
+  protected override firstUpdated() {
+    this.reportingService.reportInteraction(Interaction.FLOWS_TAB_RENDERED);
+  }
+
   override willUpdate(changedProperties: PropertyValues) {
     if (changedProperties.has('changeNum')) {
       this.getFlowActions();
@@ -458,6 +463,9 @@
         <gr-button
           aria-label="Create Flow"
           @click=${() => {
+            this.reportingService.reportInteraction(
+              Interaction.CREATE_FLOW_DIALOG_OPENED
+            );
             this.createModal?.showModal();
           }}
         >
@@ -833,6 +841,7 @@
       }),
     };
     await this.getFlowsModel().createFlow(flowInput);
+    this.reportingService.reportInteraction(Interaction.FLOW_CREATED);
     this.stages = [];
     this.currentCondition = '';
     this.currentAction = '';