From 44d1dba163c1fbb571437906b1ec220701612037 Mon Sep 17 00:00:00 2001 From: Josh Ferge Date: Mon, 10 Nov 2025 11:37:30 -0500 Subject: [PATCH 1/4] feat(autofix): Track instructions_provided on Code It Up clicks Add analytics to capture whether a user provided instructions when clicking "Code it up". This tracks if the user either: - Has instructions typed in the input field - Has already added human instruction steps to the solution Follows the same pattern as autofix.root_cause.find_solution event. Fixes AIML-1530 --- static/app/components/events/autofix/autofixSolution.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/app/components/events/autofix/autofixSolution.tsx b/static/app/components/events/autofix/autofixSolution.tsx index 10cb0151d5a7b2..2adc4c05a7ac6a 100644 --- a/static/app/components/events/autofix/autofixSolution.tsx +++ b/static/app/components/events/autofix/autofixSolution.tsx @@ -486,6 +486,11 @@ function AutofixSolutionDisplay({ }); }; + // Check if instructions were provided (either typed or already added to solution) + const hasInstructions = + instructions.trim().length > 0 || + solutionItems.some(item => item.timeline_item_type === 'human_instruction'); + useEffect(() => { setSolutionItems( solution.map(item => ({ @@ -650,6 +655,9 @@ function AutofixSolutionDisplay({ onClick={handleCodeItUp} analyticsEventName="Autofix: Code It Up" analyticsEventKey="autofix.solution.code" + analyticsParams={{ + instruction_provided: hasInstructions, + }} title={t('Implement this solution in code with Seer')} > {t('Code It Up')} From caa20c7fe39ca95a032c2851b7d4023f9a1e71d5 Mon Sep 17 00:00:00 2001 From: Josh Ferge Date: Mon, 10 Nov 2025 11:40:12 -0500 Subject: [PATCH 2/4] Simplify instruction detection to match root cause pattern Only check if there are instructions in the input field at the time of clicking, matching the pattern used in autofix.root_cause.find_solution --- static/app/components/events/autofix/autofixSolution.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/static/app/components/events/autofix/autofixSolution.tsx b/static/app/components/events/autofix/autofixSolution.tsx index 2adc4c05a7ac6a..5190d71aa84b1d 100644 --- a/static/app/components/events/autofix/autofixSolution.tsx +++ b/static/app/components/events/autofix/autofixSolution.tsx @@ -486,10 +486,7 @@ function AutofixSolutionDisplay({ }); }; - // Check if instructions were provided (either typed or already added to solution) - const hasInstructions = - instructions.trim().length > 0 || - solutionItems.some(item => item.timeline_item_type === 'human_instruction'); + const hasInstructions = instructions.trim().length > 0; useEffect(() => { setSolutionItems( From a40389ee93bacc672d51ea98ca4fe8a48f43a3be Mon Sep 17 00:00:00 2001 From: Josh Ferge Date: Mon, 10 Nov 2025 11:45:13 -0500 Subject: [PATCH 3/4] Fix: Track instructions from both input field and added steps The hasInstructions check now properly accounts for instructions that were previously added via the Add button. When users add instructions to solutionItems and then click 'Code It Up', those instructions are included in the submitted solution, so we should track instruction_provided as true. Checks both: - Instructions currently typed in the input field - Human instruction items already added to solutionItems --- static/app/components/events/autofix/autofixSolution.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/app/components/events/autofix/autofixSolution.tsx b/static/app/components/events/autofix/autofixSolution.tsx index 5190d71aa84b1d..e3d86c07a946f1 100644 --- a/static/app/components/events/autofix/autofixSolution.tsx +++ b/static/app/components/events/autofix/autofixSolution.tsx @@ -486,7 +486,10 @@ function AutofixSolutionDisplay({ }); }; - const hasInstructions = instructions.trim().length > 0; + // Check if instructions were provided (either typed in input or already added to solution) + const hasInstructions = + instructions.trim().length > 0 || + solutionItems.some(item => item.timeline_item_type === 'human_instruction'); useEffect(() => { setSolutionItems( From 2fe17e5dcd5f4601f949681f196b02f0190904e6 Mon Sep 17 00:00:00 2001 From: Josh Ferge Date: Mon, 10 Nov 2025 11:48:02 -0500 Subject: [PATCH 4/4] Only count active human instructions in analytics Filter out deactivated instructions when checking instruction_provided. Users can toggle instructions off via the UI, and inactive instructions are not included in the submitted solution, so they shouldn't be counted as provided in analytics. --- static/app/components/events/autofix/autofixSolution.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/app/components/events/autofix/autofixSolution.tsx b/static/app/components/events/autofix/autofixSolution.tsx index e3d86c07a946f1..c968e59b2cb568 100644 --- a/static/app/components/events/autofix/autofixSolution.tsx +++ b/static/app/components/events/autofix/autofixSolution.tsx @@ -486,10 +486,12 @@ function AutofixSolutionDisplay({ }); }; - // Check if instructions were provided (either typed in input or already added to solution) + // Check if instructions were provided (either typed in input or already added to solution and active) const hasInstructions = instructions.trim().length > 0 || - solutionItems.some(item => item.timeline_item_type === 'human_instruction'); + solutionItems.some( + item => item.timeline_item_type === 'human_instruction' && item.is_active !== false + ); useEffect(() => { setSolutionItems(