Skip to content

Commit 3205191

Browse files
authored
feat(issue-details): Update graph section on streamlined issue details (#96125)
updates the graph section to have better distinction between the graph ,search, and tags preview before: <img width="1330" height="205" alt="Screenshot 2025-07-23 at 9 54 37 AM" src="https://github.com/user-attachments/assets/cb276cd7-657e-4cc5-9029-228c056d5efe" /> after: <img width="1136" height="221" alt="Screenshot 2025-07-23 at 9 54 52 AM" src="https://github.com/user-attachments/assets/51b49bc0-2438-4732-8d28-059f673cc95c" />
1 parent d70197d commit 3205191

File tree

8 files changed

+150
-157
lines changed

8 files changed

+150
-157
lines changed

static/app/views/issueDetails/metricIssues/metricIssueChart.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {useChartZoom} from 'sentry/components/charts/useChartZoom';
55
import {Alert} from 'sentry/components/core/alert';
66
import Placeholder from 'sentry/components/placeholder';
77
import {t} from 'sentry/locale';
8-
import {space} from 'sentry/styles/space';
98
import type {Group} from 'sentry/types/group';
109
import type {Project} from 'sentry/types/project';
1110
import useOrganization from 'sentry/utils/useOrganization';
@@ -158,17 +157,18 @@ function MetricIssuePlaceholder({type}: {type: 'loading' | 'error'}) {
158157

159158
const MetricChartSection = styled('div')`
160159
display: block;
161-
padding-right: ${space(1.5)};
160+
padding-right: ${p => p.theme.space.lg};
161+
padding-left: ${p => p.theme.space.lg};
162162
width: 100%;
163163
`;
164164

165165
const PlaceholderContainer = styled('div')`
166-
padding: ${space(1)} 0;
166+
padding: ${p => p.theme.space.md} 0;
167167
`;
168168

169169
const ChartContainer = styled('div')`
170170
position: relative;
171-
padding: ${space(0.75)} 0;
171+
padding: ${p => p.theme.space.sm} 0;
172172
`;
173173

174174
const MetricChartAlert = styled(Alert)`

static/app/views/issueDetails/streamline/eventDetailsHeader.tsx

Lines changed: 83 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import {css, useTheme} from '@emotion/react';
33
import styled from '@emotion/styled';
44

55
import {Button} from 'sentry/components/core/button';
6-
import {Flex} from 'sentry/components/core/layout';
76
import ErrorBoundary from 'sentry/components/errorBoundary';
87
import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
98
import {TimeRangeSelector} from 'sentry/components/timeRangeSelector';
109
import {getRelativeSummary} from 'sentry/components/timeRangeSelector/utils';
1110
import {TourElement} from 'sentry/components/tours/components';
1211
import {t} from 'sentry/locale';
13-
import {space} from 'sentry/styles/space';
1412
import type {Event} from 'sentry/types/event';
1513
import type {Group} from 'sentry/types/group';
1614
import type {Project} from 'sentry/types/project';
@@ -113,58 +111,55 @@ export function EventDetailsHeader({group, event, project}: EventDetailsHeaderPr
113111
)}
114112
position="bottom-start"
115113
>
116-
<FilterContainer>
117-
<EnvironmentSelector group={group} event={event} project={project} />
118-
<DateFilter
119-
menuTitle={t('Filter Time Range')}
120-
start={period?.start}
121-
end={period?.end}
122-
utc={location.query.utc === 'true'}
123-
relative={period?.statsPeriod}
124-
relativeOptions={props => {
125-
return {
126-
...props.arbitraryOptions,
127-
// Always display arbitrary issue open period
128-
...(defaultStatsPeriod?.statsPeriod
129-
? {
130-
[defaultStatsPeriod.statsPeriod]: t(
131-
'%s (since first seen)',
132-
getRelativeSummary(defaultStatsPeriod.statsPeriod)
133-
),
134-
}
135-
: {}),
136-
...props.defaultOptions,
137-
};
138-
}}
139-
onChange={({relative, start, end, utc}) => {
140-
navigate({
141-
...location,
142-
query: {
143-
...location.query,
144-
// If selecting the issue open period, remove the stats period query param
145-
statsPeriod:
146-
relative === defaultStatsPeriod?.statsPeriod
147-
? undefined
148-
: relative,
149-
start: start ? getUtcDateString(start) : undefined,
150-
end: end ? getUtcDateString(end) : undefined,
151-
utc: utc ? 'true' : undefined,
152-
},
153-
});
154-
}}
155-
triggerLabel={
156-
period === defaultStatsPeriod && !defaultStatsPeriod.isMaxRetention
157-
? t('Since First Seen')
158-
: undefined
159-
}
160-
triggerProps={{
161-
borderless: true,
162-
style: {
163-
borderRadius: 0,
164-
},
165-
}}
166-
/>
167-
<Flex gap="xs">
114+
<FilterSection>
115+
<FilterContainer>
116+
<EnvironmentSelector group={group} event={event} project={project} />
117+
<DateFilter
118+
menuTitle={t('Filter Time Range')}
119+
start={period?.start}
120+
end={period?.end}
121+
utc={location.query.utc === 'true'}
122+
relative={period?.statsPeriod}
123+
relativeOptions={props => {
124+
return {
125+
...props.arbitraryOptions,
126+
// Always display arbitrary issue open period
127+
...(defaultStatsPeriod?.statsPeriod
128+
? {
129+
[defaultStatsPeriod.statsPeriod]: t(
130+
'%s (since first seen)',
131+
getRelativeSummary(defaultStatsPeriod.statsPeriod)
132+
),
133+
}
134+
: {}),
135+
...props.defaultOptions,
136+
};
137+
}}
138+
onChange={({relative, start, end, utc}) => {
139+
navigate({
140+
...location,
141+
query: {
142+
...location.query,
143+
// If selecting the issue open period, remove the stats period query param
144+
statsPeriod:
145+
relative === defaultStatsPeriod?.statsPeriod
146+
? undefined
147+
: relative,
148+
start: start ? getUtcDateString(start) : undefined,
149+
end: end ? getUtcDateString(end) : undefined,
150+
utc: utc ? 'true' : undefined,
151+
},
152+
});
153+
}}
154+
triggerLabel={
155+
period === defaultStatsPeriod && !defaultStatsPeriod.isMaxRetention
156+
? t('Since First Seen')
157+
: undefined
158+
}
159+
triggerProps={{
160+
borderless: true,
161+
}}
162+
/>
168163
<SearchFilter
169164
group={group}
170165
handleSearch={query => {
@@ -181,9 +176,9 @@ export function EventDetailsHeader({group, event, project}: EventDetailsHeaderPr
181176
label: searchText,
182177
}}
183178
/>
184-
<ToggleSidebar />
185-
</Flex>
186-
</FilterContainer>
179+
</FilterContainer>
180+
<ToggleSidebar />
181+
</FilterSection>
187182
</TourElement>
188183
)}
189184
{issueTypeConfig.header.graph.enabled && (
@@ -227,8 +222,8 @@ function EnvironmentSelector({group, event, project}: EventDetailsHeaderProps) {
227222
display: block;
228223
&:before {
229224
right: 0;
230-
top: ${space(1)};
231-
bottom: ${space(1)};
225+
top: ${theme.space.md};
226+
bottom: ${theme.space.md};
232227
width: 1px;
233228
content: '';
234229
position: absolute;
@@ -250,9 +245,6 @@ function EnvironmentSelector({group, event, project}: EventDetailsHeaderProps) {
250245
css={environmentCss}
251246
triggerProps={{
252247
borderless: true,
253-
style: {
254-
borderRadius: 0,
255-
},
256248
}}
257249
/>
258250
);
@@ -261,33 +253,46 @@ function EnvironmentSelector({group, event, project}: EventDetailsHeaderProps) {
261253
const DetailsContainer = styled('div')<{
262254
hasFilterBar: boolean;
263255
}>`
264-
padding-left: 24px;
256+
position: relative;
265257
display: flex;
266258
flex-direction: column;
267-
border: 0px solid ${p => p.theme.translucentBorder};
268-
border-width: 0 1px 1px 0;
259+
gap: ${p => p.theme.space.md};
260+
background: ${p => p.theme.backgroundSecondary};
261+
padding-left: ${p => p.theme.space.lg};
262+
padding-right: ${p => p.theme.space.lg};
263+
padding-top: ${p => p.theme.space.md};
264+
265+
@media (min-width: ${p => p.theme.breakpoints.lg}) {
266+
border-right: 1px solid ${p => p.theme.translucentBorder};
267+
}
268+
`;
269+
const FilterSection = styled('div')`
270+
display: flex;
271+
gap: ${p => p.theme.space.xs};
269272
`;
270273

271274
const FilterContainer = styled('div')`
272275
display: grid;
273276
grid-template-columns: auto auto minmax(100px, 1fr) auto;
274277
grid-template-rows: minmax(38px, auto);
275278
width: 100%;
279+
background: ${p => p.theme.background};
280+
border-radius: ${p => p.theme.borderRadius};
281+
border: 1px solid ${p => p.theme.translucentBorder};
276282
`;
277283

278284
const SearchFilter = styled(EventSearch)`
279285
display: block;
280286
border-color: transparent;
281-
border-radius: 0;
282287
box-shadow: none;
283288
`;
284289

285290
const DateFilter = styled(TimeRangeSelector)`
286291
display: block;
287292
&:before {
288293
right: 0;
289-
top: ${space(1)};
290-
bottom: ${space(1)};
294+
top: ${p => p.theme.space.md};
295+
bottom: ${p => p.theme.space.md};
291296
width: 1px;
292297
content: '';
293298
position: absolute;
@@ -297,24 +302,26 @@ const DateFilter = styled(TimeRangeSelector)`
297302

298303
const GraphSection = styled('div')`
299304
display: flex;
300-
&:not(:first-child) {
301-
border-top: 1px solid ${p => p.theme.translucentBorder};
305+
gap: ${p => p.theme.space.md};
306+
& > * {
307+
background: ${p => p.theme.background};
308+
border-radius: ${p => p.theme.borderRadius};
309+
border: 1px solid ${p => p.theme.translucentBorder};
302310
}
303311
`;
304312

305313
const OccurrenceSummarySection = styled(OccurrenceSummary)`
306314
white-space: unset;
307-
padding: ${space(1)};
308-
padding-left: 0;
309-
&:not(:first-child) {
310-
border-top: 1px solid ${p => p.theme.translucentBorder};
311-
}
315+
background: ${p => p.theme.background};
316+
padding: ${p => p.theme.space.lg};
317+
border-radius: ${p => p.theme.borderRadius};
318+
border: 1px solid ${p => p.theme.translucentBorder};
312319
`;
313320

314321
const PageErrorBoundary = styled(ErrorBoundary)`
315322
margin: 0;
316323
border: 0px solid ${p => p.theme.translucentBorder};
317324
border-width: 0 1px 1px 0;
318325
border-radius: 0;
319-
padding: ${space(1.5)} 24px;
326+
padding: ${p => p.theme.space.lg} ${p => p.theme.space['2xl']};
320327
`;

static/app/views/issueDetails/streamline/eventGraph.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -626,22 +626,18 @@ const GraphWrapper = styled('div')`
626626

627627
const SummaryContainer = styled('div')`
628628
display: flex;
629-
gap: ${p => (p.theme.isChonk ? space(0.75) : space(0.5))};
629+
gap: ${p => (p.theme.isChonk ? p.theme.space.sm : p.theme.space.xs)};
630630
flex-direction: column;
631-
margin: ${space(1)} ${space(0.25)} ${space(1)} 0;
631+
margin: ${p => p.theme.space.md};
632632
border-radius: ${p => p.theme.borderRadius} 0 0 ${p => p.theme.borderRadius};
633-
634-
@media (min-width: ${p => p.theme.breakpoints.xl}) {
635-
margin: ${space(1)} ${space(1)} ${space(1)} 0;
636-
}
637633
`;
638634

639635
const CalloutButton = withChonk(
640636
styled(Button)<{isActive: boolean}>`
641637
cursor: ${p => (p.isActive ? 'initial' : 'pointer')};
642638
border: 1px solid ${p => (p.isActive ? p.theme.purple100 : 'transparent')};
643639
background: ${p => (p.isActive ? p.theme.purple100 : 'transparent')};
644-
padding: ${space(0.5)} ${space(2)};
640+
padding: ${p => p.theme.space.xs} ${p => p.theme.space.xl};
645641
box-shadow: none;
646642
height: unset;
647643
overflow: hidden;
@@ -666,31 +662,31 @@ const Label = styled('div')<{isActive: boolean}>`
666662

667663
const Count = styled('div')<{isActive: boolean}>`
668664
line-height: 1;
669-
margin-top: ${space(0.5)};
665+
margin-top: ${p => p.theme.space.xs};
670666
font-size: 20px;
671667
font-weight: ${p => p.theme.fontWeight.normal};
672668
color: ${p => (p.isActive ? p.theme.purple400 : p.theme.textColor)};
673669
`;
674670

675671
const ChartContainer = styled('div')`
676672
position: relative;
677-
padding: ${space(0.75)} 0 ${space(0.75)} 0;
673+
padding: ${p => p.theme.space.sm} 0 ${p => p.theme.space.sm} 0;
678674
margin-right: -2px;
679675
680676
@media (min-width: ${p => p.theme.breakpoints.xl}) {
681-
padding: ${space(0.75)} ${space(1)} ${space(0.75)} 0;
677+
padding: ${p => p.theme.space.sm} ${p => p.theme.space.md} ${p => p.theme.space.sm} 0;
682678
}
683679
`;
684680

685681
const LoadingChartContainer = styled('div')`
686682
position: relative;
687-
padding: ${space(0.75)} 0 ${space(0.75)} 0;
688-
margin: 0 ${space(1)};
683+
padding: ${p => p.theme.space.sm} 0 ${p => p.theme.space.sm} 0;
684+
margin: 0 ${p => p.theme.space.md};
689685
`;
690686

691687
const GraphAlert = styled(Alert)`
692-
padding-left: 24px;
693-
margin: 0 0 0 -24px;
688+
padding-left: ${p => p.theme.space['2xl']};
689+
margin: 0 0 0 -${p => p.theme.space['2xl']};
694690
border: 0;
695691
border-radius: 0;
696692
`;

static/app/views/issueDetails/streamline/issueCronCheckTimeline.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import type {StatsBucket} from 'sentry/components/checkInTimeline/types';
1212
import {Flex} from 'sentry/components/core/layout';
1313
import {Tooltip} from 'sentry/components/core/tooltip';
1414
import {tct} from 'sentry/locale';
15-
import {space} from 'sentry/styles/space';
1615
import type {Event} from 'sentry/types/event';
1716
import type {Group} from 'sentry/types/group';
1817
import {useApiQuery} from 'sentry/utils/queryClient';
@@ -204,15 +203,17 @@ const ChartContainer = styled('div')<{envCount: number}>`
204203
position: relative;
205204
width: 100%;
206205
min-height: ${p => Math.max(p.envCount - 1, 0) * totalHeight + 104}px;
206+
padding-left: ${p => p.theme.space.lg};
207+
padding-right: ${p => p.theme.space.lg};
207208
`;
208209

209210
const TimelineLegend = styled('div')`
210211
position: absolute;
211-
width: 100%;
212+
width: calc(100% - ${p => p.theme.space.lg} * 2);
212213
user-select: none;
213214
display: flex;
214-
gap: ${space(1)};
215-
margin-top: ${space(1.5)};
215+
gap: ${p => p.theme.space.md};
216+
margin-top: ${p => p.theme.space.lg};
216217
`;
217218

218219
const TimelineLegendText = styled('div')`
@@ -223,7 +224,9 @@ const TimelineLegendText = styled('div')`
223224
const TimelineContainer = styled('div')`
224225
position: absolute;
225226
top: 36px;
226-
width: 100%;
227+
left: ${p => p.theme.space.lg};
228+
right: ${p => p.theme.space.lg};
229+
width: calc(100% - ${p => p.theme.space.lg} * 2);
227230
`;
228231

229232
const EnvironmentLabel = styled(Tooltip)`
@@ -244,4 +247,5 @@ const IssueGridLineOverlay = styled(GridLineOverlay)<{envCount: number}>`
244247
${Gridline} {
245248
top: ${p => Math.max(p.envCount - 1, 0) * totalHeight + 68}px;
246249
}
250+
width: calc(100% - ${p => p.theme.space.lg} * 2);
247251
`;

0 commit comments

Comments
 (0)