Skip to content

Commit e83058a

Browse files
authored
fix(preprod): fix positioning of app size tooltip (#103978)
The text previously took up the entire width of the parent so the tooltip showed way off to the side. Shrunk the text and moved to the bottom. <img width="210" height="148" alt="Screenshot 2025-11-25 at 12 09 01 PM" src="https://github.com/user-attachments/assets/4330fd84-a9d6-4017-b6f9-3ec8ae38dfce" />
1 parent e73f05d commit e83058a

File tree

1 file changed

+32
-40
lines changed

1 file changed

+32
-40
lines changed

static/app/views/preprod/buildDetails/main/buildDetailsMetricCards.tsx

Lines changed: 32 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -128,41 +128,32 @@ export function BuildDetailsMetricCards(props: BuildDetailsMetricCardsProps) {
128128

129129
return (
130130
<Flex gap="lg" wrap="wrap">
131-
{metricsCards.map(card => {
132-
const valueContent = (
131+
{metricsCards.map(card => (
132+
<MetricCard
133+
key={card.key}
134+
icon={card.icon}
135+
label={card.title}
136+
labelTooltip={card.labelTooltip}
137+
action={
138+
card.showInsightsButton
139+
? {
140+
icon: <IconSettings size="sm" color="white" />,
141+
tooltip: t('View insight details'),
142+
ariaLabel: t('View insight details'),
143+
onClick: () => {
144+
trackAnalytics('preprod.builds.details.open_insights_sidebar', {
145+
organization,
146+
platform: platformProp ?? null,
147+
project_type: projectType,
148+
source: 'metric_card',
149+
});
150+
onOpenInsightsSidebar();
151+
},
152+
}
153+
: undefined
154+
}
155+
>
133156
<Heading as="h3">
134-
<MetricValue $interactive={Boolean(card.watchBreakdown)}>
135-
{card.value}
136-
</MetricValue>
137-
{card.percentageText ?? ''}
138-
</Heading>
139-
);
140-
141-
return (
142-
<MetricCard
143-
key={card.key}
144-
icon={card.icon}
145-
label={card.title}
146-
labelTooltip={card.labelTooltip}
147-
action={
148-
card.showInsightsButton
149-
? {
150-
icon: <IconSettings size="sm" color="white" />,
151-
tooltip: t('View insight details'),
152-
ariaLabel: t('View insight details'),
153-
onClick: () => {
154-
trackAnalytics('preprod.builds.details.open_insights_sidebar', {
155-
organization,
156-
platform: platformProp ?? null,
157-
project_type: projectType,
158-
source: 'metric_card',
159-
});
160-
onOpenInsightsSidebar();
161-
},
162-
}
163-
: undefined
164-
}
165-
>
166157
{card.watchBreakdown ? (
167158
<Tooltip
168159
title={
@@ -171,16 +162,17 @@ export function BuildDetailsMetricCards(props: BuildDetailsMetricCardsProps) {
171162
watchValue={card.watchBreakdown.watchValue}
172163
/>
173164
}
174-
position="left"
165+
position="bottom"
175166
>
176-
{valueContent}
167+
<MetricValue $interactive>{card.value}</MetricValue>
177168
</Tooltip>
178169
) : (
179-
valueContent
170+
<MetricValue>{card.value}</MetricValue>
180171
)}
181-
</MetricCard>
182-
);
183-
})}
172+
{card.percentageText ?? ''}
173+
</Heading>
174+
</MetricCard>
175+
))}
184176
</Flex>
185177
);
186178
}

0 commit comments

Comments
 (0)