Skip to content

Commit 754f82b

Browse files
authored
feat(preprod): Add second row with build number, version info and date to comparison screen (EME-520) (#104117)
## Summary Adds a second line of information showing version build number and date. I also adjust the logic to only show the buildId if the build number is missing since it was confusing the difference between the buildId and buildNumber when presented visually. Before: <img width="1321" height="318" alt="image" src="https://github.com/user-attachments/assets/363a41d6-ab9a-42b9-ac69-3c4bc659da7d" /> After: <img width="1323" height="338" alt="image" src="https://github.com/user-attachments/assets/4869c401-88ce-4254-b5c9-71f616aa0bcd" /> Also on comparison selection screen: <img width="1320" height="269" alt="image" src="https://github.com/user-attachments/assets/b58ee1f0-dd28-47a9-b50d-127a7f810082" /> Also light mode: <img width="907" height="88" alt="image" src="https://github.com/user-attachments/assets/e73344f3-5278-4bfc-a148-82d2751fbecf" /> ## Changes - Added two-line layout showing version, build number, and date - Increased text size from small to medium for better readability - Metadata line (version, build number, date) aligned with build info Fixes EME-520
1 parent a547c4f commit 754f82b

File tree

1 file changed

+65
-30
lines changed

1 file changed

+65
-30
lines changed

static/app/views/preprod/buildComparison/main/sizeCompareSelectedBuilds.tsx

Lines changed: 65 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {IconClose, IconCommit, IconFocus, IconLock, IconTelescope} from 'sentry/
99
import {t} from 'sentry/locale';
1010
import ProjectsStore from 'sentry/stores/projectsStore';
1111
import {trackAnalytics} from 'sentry/utils/analytics';
12+
import {getFormat, getFormattedDate} from 'sentry/utils/dates';
1213
import useOrganization from 'sentry/utils/useOrganization';
1314
import {useParams} from 'sentry/utils/useParams';
1415
import type {BuildDetailsApiResponse} from 'sentry/views/preprod/types/buildDetailsTypes';
@@ -35,12 +36,34 @@ function BuildButton({
3536
const sha = buildDetails.vcs_info?.head_sha?.substring(0, 7);
3637
const branchName = buildDetails.vcs_info?.head_ref;
3738
const buildId = buildDetails.id;
39+
const version = buildDetails.app_info?.version;
40+
const buildNumber = buildDetails.app_info?.build_number;
41+
const dateBuilt = buildDetails.app_info?.date_built;
42+
const dateAdded = buildDetails.app_info?.date_added;
3843

3944
const buildUrl = `/organizations/${organization.slug}/preprod/${projectId}/${buildId}/`;
4045
const platform = buildDetails.app_info?.platform ?? null;
4146

47+
const dateToShow = dateBuilt || dateAdded;
48+
const formattedDate = getFormattedDate(
49+
dateToShow,
50+
getFormat({timeZone: true, year: true}),
51+
{
52+
local: true,
53+
}
54+
);
55+
56+
// Build metadata parts for the second line
57+
const metadataParts = [formattedDate];
58+
if (version) {
59+
metadataParts.unshift(`Version ${version}`);
60+
}
61+
if (buildNumber) {
62+
metadataParts.unshift(`Build ${buildNumber}`);
63+
}
64+
4265
return (
43-
<LinkButton
66+
<StyledLinkButton
4467
to={buildUrl}
4568
onClick={() =>
4669
trackAnalytics('preprod.builds.compare.go_to_build_details', {
@@ -53,15 +76,17 @@ function BuildButton({
5376
})
5477
}
5578
>
56-
<Flex align="center" gap="sm">
57-
{icon}
58-
<Text size="sm" variant="accent" bold>
59-
{label}
60-
</Text>
61-
<Flex align="center" gap="md">
79+
<Flex direction="column" gap="xs">
80+
<Flex align="center" gap="sm">
81+
{icon}
6282
<Text size="sm" variant="accent" bold>
63-
{`#${buildId}`}
83+
{label}
6484
</Text>
85+
{!buildNumber && (
86+
<Text size="sm" variant="accent" bold>
87+
{`#${buildId}`}
88+
</Text>
89+
)}
6590
{sha && (
6691
<Flex align="center" gap="xs">
6792
<IconCommit size="xs" />
@@ -70,33 +95,43 @@ function BuildButton({
7095
</Text>
7196
</Flex>
7297
)}
98+
{branchName && (
99+
<BuildBranch>
100+
<Text size="sm" variant="muted">
101+
{branchName}
102+
</Text>
103+
</BuildBranch>
104+
)}
105+
{onRemove && (
106+
<Button
107+
onClick={e => {
108+
e.preventDefault();
109+
e.stopPropagation();
110+
onRemove();
111+
}}
112+
size="zero"
113+
priority="transparent"
114+
borderless
115+
aria-label={t('Clear base build')}
116+
icon={<IconClose size="xs" color="purple400" />}
117+
/>
118+
)}
119+
</Flex>
120+
<Flex align="center" gap="sm">
121+
<Text size="sm" variant="muted">
122+
{metadataParts.join(' • ')}
123+
</Text>
73124
</Flex>
74-
{branchName && (
75-
<BuildBranch>
76-
<Text size="sm" variant="muted">
77-
{branchName}
78-
</Text>
79-
</BuildBranch>
80-
)}
81-
{onRemove && (
82-
<Button
83-
onClick={e => {
84-
e.preventDefault();
85-
e.stopPropagation();
86-
onRemove();
87-
}}
88-
size="zero"
89-
priority="transparent"
90-
borderless
91-
aria-label={t('Clear base build')}
92-
icon={<IconClose size="xs" color="purple400" />}
93-
/>
94-
)}
95125
</Flex>
96-
</LinkButton>
126+
</StyledLinkButton>
97127
);
98128
}
99129

130+
const StyledLinkButton = styled(LinkButton)`
131+
height: auto;
132+
min-height: auto;
133+
`;
134+
100135
const ComparisonContainer = styled(Flex)`
101136
flex-wrap: wrap;
102137
align-items: center;

0 commit comments

Comments
 (0)