Skip to content

Commit c0d2d43

Browse files
Zylphrexandrewshie-sentry
authored andcommitted
fix(explore): Pluralization on explore chart footer (#89385)
The footer can say `1 groups` which is grammatically incorrect. Instead, let's not treat it as a top n chart when there's only 1 group.
1 parent 0dca7e6 commit c0d2d43

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

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

+29-29
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function ConfidenceFooter(props: Props) {
1818
}
1919

2020
function confidenceMessage({sampleCount, confidence, topEvents, isSampled}: Props) {
21-
const isTopN = defined(topEvents) && topEvents > 0;
21+
const isTopN = defined(topEvents) && topEvents > 1;
2222
if (!defined(sampleCount)) {
2323
return isTopN
2424
? t('* Chart for top %s groups extrapolated from \u2026', topEvents)
@@ -27,36 +27,36 @@ function confidenceMessage({sampleCount, confidence, topEvents, isSampled}: Prop
2727

2828
const noSampling = defined(isSampled) && !isSampled;
2929

30-
const lowAccuracySampleCount = (
31-
<Tooltip
32-
title={
33-
<div>
34-
{t('You may not have enough samples for high accuracy.')}
35-
<br />
36-
<br />
37-
{t(
38-
'You can try adjusting your query by removing filters or increasing the time interval.'
39-
)}
40-
<br />
41-
<br />
42-
{t(
43-
'You can also increase your sampling rates to get more samples and accurate trends.'
44-
)}
45-
</div>
46-
}
47-
disabled={noSampling}
48-
maxWidth={270}
49-
>
50-
<InsufficientSamples>
51-
<Count value={sampleCount} />
52-
</InsufficientSamples>
53-
</Tooltip>
54-
);
55-
5630
if (confidence === 'low') {
31+
const lowAccuracySampleCount = (
32+
<Tooltip
33+
title={
34+
<div>
35+
{t('You may not have enough samples for high accuracy.')}
36+
<br />
37+
<br />
38+
{t(
39+
'You can try adjusting your query by removing filters or increasing the time interval.'
40+
)}
41+
<br />
42+
<br />
43+
{t(
44+
'You can also increase your sampling rates to get more samples and accurate trends.'
45+
)}
46+
</div>
47+
}
48+
disabled={noSampling}
49+
maxWidth={270}
50+
>
51+
<InsufficientSamples>
52+
<Count value={sampleCount} />
53+
</InsufficientSamples>
54+
</Tooltip>
55+
);
56+
5757
if (isTopN) {
58-
return tct('Sample count for top [groupText]: [sampleCount]', {
59-
groupText: topEvents > 1 ? tct('[topEvents] groups', {topEvents}) : t('group'),
58+
return tct('Sample count for top [topEvents] groups: [sampleCount]', {
59+
topEvents,
6060
sampleCount: lowAccuracySampleCount,
6161
});
6262
}

0 commit comments

Comments
 (0)