From 32b9b9e6daa382d2341faeeede705700d8d96a65 Mon Sep 17 00:00:00 2001 From: Abdullah Khan Date: Wed, 26 Nov 2025 20:09:22 -0500 Subject: [PATCH 1/2] feature(explore-attr-breakdowns): Removing yAxis heuristic from selection hint --- .../cohortComparisonContent.tsx | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/static/app/views/explore/components/attributeBreakdowns/cohortComparisonContent.tsx b/static/app/views/explore/components/attributeBreakdowns/cohortComparisonContent.tsx index 5b55d8e48e73c0..9794ccf57ee301 100644 --- a/static/app/views/explore/components/attributeBreakdowns/cohortComparisonContent.tsx +++ b/static/app/views/explore/components/attributeBreakdowns/cohortComparisonContent.tsx @@ -20,7 +20,6 @@ import {useQueryParamState} from 'sentry/utils/url/useQueryParamState'; import {useDebouncedValue} from 'sentry/utils/useDebouncedValue'; import useAttributeBreakdownComparison from 'sentry/views/explore/hooks/useAttributeBreakdownComparison'; import {useQueryParamsVisualizes} from 'sentry/views/explore/queryParams/context'; -import {prettifyAggregation} from 'sentry/views/explore/utils'; import {Chart} from './cohortComparisonChart'; import {AttributeBreakdownsComponent} from './styles'; @@ -29,7 +28,6 @@ type SortingMethod = 'rrr'; const CHARTS_COLUMN_COUNT = 3; const CHARTS_PER_PAGE = CHARTS_COLUMN_COUNT * 4; -const PERCENTILE_FUNCTION_PREFIXES = ['p50', 'p75', 'p90', 'p95', 'p99', 'avg']; export function CohortComparison({ selection, @@ -107,26 +105,11 @@ export function CohortComparison({ .format('MMM D YYYY h:mm A z'); const endDate = moment.tz(endTimestamp, userTimezone).format('MMM D YYYY h:mm A z'); - // Check if yAxis is a percentile function (only these functions should include "and is greater than or equal to") - const yAxisLower = yAxis.toLowerCase(); - const isPercentileFunction = PERCENTILE_FUNCTION_PREFIXES.some(prefix => - yAxisLower.startsWith(prefix) - ); - - const formattedFunction = prettifyAggregation(yAxis) ?? yAxis; - return { - selection: isPercentileFunction - ? t( - `Selection is data between %s - %s and is greater than or equal to %s`, - startDate, - endDate, - formattedFunction - ) - : t(`Selection is data between %s - %s`, startDate, endDate), + selection: t(`Selection is data between %s - %s`, startDate, endDate), baseline: t('Baseline is all other spans from your query'), }; - }, [selection, yAxis]); + }, [selection]); if (isError) { return ; From d7ef919cc5777cd1b2d8499039c5e6635c750034 Mon Sep 17 00:00:00 2001 From: Abdullah Khan Date: Wed, 26 Nov 2025 20:11:22 -0500 Subject: [PATCH 2/2] feature(explore-attr-breakdowns): Removing yAxis heuristic from selection hint --- .../cohortComparisonContent.tsx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/static/app/views/explore/components/attributeBreakdowns/cohortComparisonContent.tsx b/static/app/views/explore/components/attributeBreakdowns/cohortComparisonContent.tsx index 9794ccf57ee301..f4732754e2b1bd 100644 --- a/static/app/views/explore/components/attributeBreakdowns/cohortComparisonContent.tsx +++ b/static/app/views/explore/components/attributeBreakdowns/cohortComparisonContent.tsx @@ -88,7 +88,7 @@ export function CohortComparison({ setPage(0); }, [filteredRankedAttributes]); - const selectionHint = useMemo(() => { + const selectedRangeToDates = useMemo(() => { if (!selection) { return null; } @@ -100,14 +100,12 @@ export function CohortComparison({ startTimestamp = Math.min(startTimestamp, endTimestamp - 60_000); const userTimezone = getUserTimezone() || moment.tz.guess(); - const startDate = moment - .tz(startTimestamp, userTimezone) - .format('MMM D YYYY h:mm A z'); - const endDate = moment.tz(endTimestamp, userTimezone).format('MMM D YYYY h:mm A z'); + const start = moment.tz(startTimestamp, userTimezone).format('MMM D YYYY h:mm A z'); + const end = moment.tz(endTimestamp, userTimezone).format('MMM D YYYY h:mm A z'); return { - selection: t(`Selection is data between %s - %s`, startDate, endDate), - baseline: t('Baseline is all other spans from your query'), + start, + end, }; }, [selection]); @@ -133,12 +131,18 @@ export function CohortComparison({ ) : ( - {selectionHint && ( + {selectedRangeToDates && ( - {selectionHint.selection} + {t( + 'Selection is data between %s - %s', + selectedRangeToDates.start, + selectedRangeToDates.end + )} + + + {t('Baseline is all other spans from your query')} - {selectionHint.baseline} )} {filteredRankedAttributes.length > 0 ? (