From 9657ea919fbbe1445147cae3d1902d24ce4413c1 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:48:42 +0100 Subject: [PATCH] chore(ai-help): include question number in metrics (#10096) Allows distinguishing initial from follow-up questions. Co-authored-by: Leo McArdle --- client/src/plus/ai-help/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/plus/ai-help/index.tsx b/client/src/plus/ai-help/index.tsx index b4bdf1a12bfb..ac6975cdcd31 100644 --- a/client/src/plus/ai-help/index.tsx +++ b/client/src/plus/ai-help/index.tsx @@ -384,8 +384,13 @@ export function AIHelpInner() { className="ai-help-input-form" onSubmit={(event) => { event.preventDefault(); + const questionNumber = + 1 + + messages.filter((m) => m.role === MessageRole.User).length; gleanClick( - `${AI_HELP}: submit ${isExample ? "example" : "question"}` + `${AI_HELP}: submit ${ + isExample ? "example" : "question" + } ${questionNumber}` ); if (query.trim()) { submit(query.trim());