Skip to content

Commit d9abf86

Browse files
authored
style(logs): Update chart footer copy (#96774)
1 parent 74a7b21 commit d9abf86

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

static/app/views/explore/logs/confidenceFooter.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import styled from '@emotion/styled';
2+
13
import {Tooltip} from 'sentry/components/core/tooltip';
24
import Count from 'sentry/components/count';
35
import {t, tct} from 'sentry/locale';
@@ -22,6 +24,7 @@ export function ConfidenceFooter({
2224
return (
2325
<Container>
2426
<ConfidenceMessage
27+
isLoading={isLoading}
2528
confidence={chartInfo.confidence}
2629
dataScanned={chartInfo.dataScanned}
2730
isSampled={chartInfo.isSampled}
@@ -33,6 +36,7 @@ export function ConfidenceFooter({
3336
}
3437

3538
interface ConfidenceMessageProps {
39+
isLoading: boolean;
3640
confidence?: Confidence;
3741
dataScanned?: 'full' | 'partial';
3842
isSampled?: boolean | null;
@@ -45,14 +49,13 @@ function ConfidenceMessage({
4549
dataScanned,
4650
confidence,
4751
topEvents,
52+
isLoading,
4853
isSampled,
4954
}: ConfidenceMessageProps) {
5055
const isTopN = defined(topEvents) && topEvents > 1;
5156

52-
if (!defined(sampleCount)) {
53-
return isTopN
54-
? t('* Top %s groups extrapolated based on \u2026', topEvents)
55-
: t('* Extrapolated based on \u2026');
57+
if (!defined(sampleCount) || isLoading) {
58+
return <Placeholder />;
5659
}
5760

5861
const noSampling = defined(isSampled) && !isSampled;
@@ -62,13 +65,13 @@ function ConfidenceMessage({
6265
// For logs, if the full data was scanned, we can assume that no
6366
// extrapolation happened and we should remove mentions of extrapolation.
6467
if (isTopN) {
65-
return tct('Top [topEvents] groups based on [sampleCountComponent] logs', {
68+
return tct('Log count for top [topEvents] groups: [sampleCountComponent]', {
6669
topEvents,
6770
sampleCountComponent,
6871
});
6972
}
7073

71-
return tct('Based on [sampleCountComponent] logs', {
74+
return tct('Log count: [sampleCountComponent]', {
7275
sampleCountComponent,
7376
});
7477
}
@@ -142,3 +145,10 @@ function LowAccuracyFullTooltip({
142145
</Tooltip>
143146
);
144147
}
148+
149+
const Placeholder = styled('div')`
150+
width: 180px;
151+
height: ${p => p.theme.fontSize.md};
152+
border-radius: ${p => p.theme.borderRadius};
153+
background-color: ${p => p.theme.backgroundTertiary};
154+
`;

0 commit comments

Comments
 (0)