From 36098e8c7414deba6854da4a20bfa35901b89130 Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Fri, 23 May 2025 13:24:03 -0400 Subject: [PATCH] feat(explore): Update confidence footer copy Closes EXP-299 --- .../explore/charts/confidenceFooter.spec.tsx | 20 +++++++++----- .../views/explore/charts/confidenceFooter.tsx | 27 +++++++++++-------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/static/app/views/explore/charts/confidenceFooter.spec.tsx b/static/app/views/explore/charts/confidenceFooter.spec.tsx index c44435e8591319..ea5950500f8821 100644 --- a/static/app/views/explore/charts/confidenceFooter.spec.tsx +++ b/static/app/views/explore/charts/confidenceFooter.spec.tsx @@ -19,10 +19,14 @@ describe('ConfidenceFooter', () => { {wrapper: Wrapper} ); - expect(screen.getByTestId('wrapper')).toHaveTextContent('Based on 100 samples'); + expect(screen.getByTestId('wrapper')).toHaveTextContent( + 'Extrapolated based on 100 span samples' + ); await userEvent.hover(screen.getByText('100')); expect( - await screen.findByText(/You may not have enough samples for high accuracy./) + await screen.findByText( + /You may not have enough span samples for a high accuracy extrapolation of your query./ + ) ).toBeInTheDocument(); }); it('renders for full scan with grouping', async () => { @@ -37,11 +41,13 @@ describe('ConfidenceFooter', () => { ); expect(screen.getByTestId('wrapper')).toHaveTextContent( - 'Top 5 groups based on 100 samples' + 'Top 5 groups extrapolated based on 100 span samples' ); await userEvent.hover(screen.getByText('100')); expect( - await screen.findByText(/You may not have enough samples for high accuracy./) + await screen.findByText( + /You may not have enough span samples for a high accuracy extrapolation of your query./ + ) ).toBeInTheDocument(); }); }); @@ -58,7 +64,9 @@ describe('ConfidenceFooter', () => { {wrapper: Wrapper} ); - expect(screen.getByTestId('wrapper')).toHaveTextContent('Based on 100 samples'); + expect(screen.getByTestId('wrapper')).toHaveTextContent( + 'Extrapolated based on 100 span samples' + ); }); it('renders for full scan with grouping', () => { render( @@ -72,7 +80,7 @@ describe('ConfidenceFooter', () => { ); expect(screen.getByTestId('wrapper')).toHaveTextContent( - 'Top 5 groups based on 100 samples' + 'Top 5 groups extrapolated based on 100 span samples' ); }); }); diff --git a/static/app/views/explore/charts/confidenceFooter.tsx b/static/app/views/explore/charts/confidenceFooter.tsx index aba85393d503f9..fd37b2f114e008 100644 --- a/static/app/views/explore/charts/confidenceFooter.tsx +++ b/static/app/views/explore/charts/confidenceFooter.tsx @@ -22,8 +22,8 @@ function confidenceMessage({sampleCount, confidence, topEvents, isSampled}: Prop const isTopN = defined(topEvents) && topEvents > 1; if (!defined(sampleCount)) { return isTopN - ? t('* Chart for top %s groups extrapolated from \u2026', topEvents) - : t('* Chart extrapolated from \u2026'); + ? t('* Top %s groups extrapolated based on \u2026', topEvents) + : t('* Extrapolated based on \u2026'); } const noSampling = defined(isSampled) && !isSampled; @@ -33,7 +33,7 @@ function confidenceMessage({sampleCount, confidence, topEvents, isSampled}: Prop if (confidence === 'low') { if (isTopN) { return tct( - 'Top [topEvents] groups based on [tooltip:[sampleCountComponent] samples]', + 'Top [topEvents] groups extrapolated based on [tooltip:[sampleCountComponent] span samples]', { topEvents, tooltip: lowAccuracyFullSampleCount, @@ -42,20 +42,23 @@ function confidenceMessage({sampleCount, confidence, topEvents, isSampled}: Prop ); } - return tct('Based on [tooltip:[sampleCountComponent] samples]', { + return tct('Extrapolated based on [tooltip:[sampleCountComponent] span samples]', { tooltip: lowAccuracyFullSampleCount, sampleCountComponent, }); } if (isTopN) { - return tct('Top [topEvents] groups based on [sampleCountComponent] samples', { - topEvents, - sampleCountComponent, - }); + return tct( + 'Top [topEvents] groups extrapolated based on [sampleCountComponent] span samples', + { + topEvents, + sampleCountComponent, + } + ); } - return tct('Based on [sampleCountComponent] samples', { + return tct('Extrapolated based on [sampleCountComponent] span samples', { sampleCountComponent, }); } @@ -71,11 +74,13 @@ function _LowAccuracyFullTooltip({ - {t('You may not have enough samples for high accuracy.')} + {t( + 'You may not have enough span samples for a high accuracy extrapolation of your query.' + )}

{t( - 'You can try adjusting your query by removing filters or increasing the time interval.' + "You can try adjusting your query by narrowing the date range, removing filters or increasing the chart's time interval." )}