Skip to content

Commit f3ef358

Browse files
authored
fix(explore): Warning icon vertical alignment (#103122)
1 parent cb2b331 commit f3ef358

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

static/app/views/explore/components/chart/placeholder.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import styled from '@emotion/styled';
22

3+
import {IconWarning} from 'sentry/icons';
4+
35
const _OffsetContainer = styled('span')`
46
position: relative;
57
top: 2px;
@@ -24,3 +26,11 @@ export function Placeholder({width}: PlaceholderProps) {
2426
</_OffsetContainer>
2527
);
2628
}
29+
30+
export function WarningIcon() {
31+
return (
32+
<_OffsetContainer data-test-id="warning-placeholder">
33+
<IconWarning size="sm" />
34+
</_OffsetContainer>
35+
);
36+
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import {Tooltip} from 'sentry/components/core/tooltip';
22
import Count from 'sentry/components/count';
3-
import {IconWarning} from 'sentry/icons';
43
import {t, tct} from 'sentry/locale';
54
import type {Confidence} from 'sentry/types/organization';
65
import {defined} from 'sentry/utils';
76
import {
87
Container,
98
usePreviouslyLoaded,
109
} from 'sentry/views/explore/components/chart/chartFooter';
11-
import {Placeholder} from 'sentry/views/explore/components/chart/placeholder';
10+
import {
11+
Placeholder,
12+
WarningIcon,
13+
} from 'sentry/views/explore/components/chart/placeholder';
1214
import type {ChartInfo} from 'sentry/views/explore/components/chart/types';
1315
import type {RawCounts} from 'sentry/views/explore/useRawCounts';
1416

@@ -125,13 +127,11 @@ function ConfidenceMessage({
125127

126128
const downsampledTooltip = <DownsampledTooltip noSampling={noSampling} />;
127129

128-
const warning = <IconWarning size="sm" />;
129-
130130
if (isTopN) {
131131
return tct(
132132
'[warning] Extrapolated from [matchingLogsCount] for top [topEvents] groups after scanning [tooltip:[downsampledLogsCount] of [allLogsCount]]',
133133
{
134-
warning,
134+
warning: <WarningIcon />,
135135
topEvents,
136136
matchingLogsCount,
137137
downsampledLogsCount,
@@ -144,7 +144,7 @@ function ConfidenceMessage({
144144
return tct(
145145
'[warning] Extrapolated from [matchingLogsCount] after scanning [tooltip:[downsampledLogsCount] of [allLogsCount]]',
146146
{
147-
warning,
147+
warning: <WarningIcon />,
148148
matchingLogsCount,
149149
downsampledLogsCount,
150150
allLogsCount,

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import styled from '@emotion/styled';
22

33
import {Tooltip} from 'sentry/components/core/tooltip';
44
import Count from 'sentry/components/count';
5-
import {IconWarning} from 'sentry/icons';
65
import {t, tct} from 'sentry/locale';
76
import type {Confidence} from 'sentry/types/organization';
87
import {defined} from 'sentry/utils';
98
import usePrevious from 'sentry/utils/usePrevious';
10-
import {Placeholder} from 'sentry/views/explore/components/chart/placeholder';
9+
import {
10+
Placeholder,
11+
WarningIcon,
12+
} from 'sentry/views/explore/components/chart/placeholder';
1113
import type {RawCounts} from 'sentry/views/explore/useRawCounts';
1214

1315
type Props = {
@@ -67,6 +69,7 @@ function confidenceMessage({
6769
const lowAccuracyFullSampleCount = <_LowAccuracyFullTooltip noSampling={noSampling} />;
6870

6971
// The multi query mode does not fetch the raw span counts
72+
// so make sure to have a backup when this happens.
7073
if (!defined(rawSpanCounts)) {
7174
const matchingSpansCount =
7275
sampleCount > 1
@@ -145,13 +148,11 @@ function confidenceMessage({
145148
});
146149
}
147150

148-
const warning = <IconWarning size="sm" />;
149-
150151
if (isTopN) {
151152
return tct(
152153
'[warning] Extrapolated from [matchingSpansCount] for top [topEvents] groups after scanning [tooltip:[downSampledSpansCount] of [allSpansCount]]',
153154
{
154-
warning,
155+
warning: <WarningIcon />,
155156
topEvents,
156157
matchingSpansCount,
157158
downSampledSpansCount,
@@ -164,7 +165,7 @@ function confidenceMessage({
164165
return tct(
165166
'[warning] Extrapolated from [matchingSpansCount] after scanning [tooltip:[downSampledSpansCount] of [allSpansCount]]',
166167
{
167-
warning,
168+
warning: <WarningIcon />,
168169
matchingSpansCount,
169170
downSampledSpansCount,
170171
allSpansCount,

0 commit comments

Comments
 (0)