From 0fe14440592f52bfa9485dc652cb3e080311eb94 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Mon, 6 Oct 2025 16:36:03 -0700 Subject: [PATCH] fix(aci): Hide resolution threshold when automatic Hides the resolution threshold shaded area on the chart if they're using automatic resolution. --- .../hooks/useMetricDetectorThresholdSeries.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/static/app/views/detectors/hooks/useMetricDetectorThresholdSeries.tsx b/static/app/views/detectors/hooks/useMetricDetectorThresholdSeries.tsx index f8b7471d9cd12c..581c0a8f0ab2d8 100644 --- a/static/app/views/detectors/hooks/useMetricDetectorThresholdSeries.tsx +++ b/static/app/views/detectors/hooks/useMetricDetectorThresholdSeries.tsx @@ -224,10 +224,13 @@ export function useMetricDetectorThresholdSeries({ data: [], }; }); - additional.push(...thresholdSeries); - // Add manual resolution line and safe area if present (green) - if (resolution) { + + // Resolution is considered "automatic" when it equals any alert threshold value + const isResolutionManual = Boolean( + resolution && !thresholds.some(threshold => threshold.value === resolution.value) + ); + if (resolution && isResolutionManual) { const resolutionSeries: LineSeriesOption = { type: 'line', markLine: createThresholdMarkLine(theme.green300, resolution.value), @@ -243,7 +246,7 @@ export function useMetricDetectorThresholdSeries({ const valuesForMax = [ ...thresholds.map(threshold => threshold.value), - ...(resolution ? [resolution.value] : []), + ...(resolution && isResolutionManual ? [resolution.value] : []), ]; const maxValue = valuesForMax.length > 0 ? Math.max(...valuesForMax) : undefined; return {maxValue, additionalSeries: additional};