Skip to content

Commit 13f2e6b

Browse files
authored
feat(replays): Replay layout move start time (#58488)
Move started at time to dead clicks, rage clicks, errors area as part of replay layout changes Before: <img width="1510" alt="image" src="https://github.com/getsentry/sentry/assets/55311782/d3639c72-4537-4673-b753-d0864fe04de6"> After: <img width="1510" alt="image" src="https://github.com/getsentry/sentry/assets/55311782/ff81e6a7-e2fe-48fa-9e7a-dfbd61a217ac"> Relates to: https://github.com/getsentry/team-replay/issues/139
1 parent b793ef6 commit 13f2e6b

File tree

2 files changed

+26
-31
lines changed

2 files changed

+26
-31
lines changed

static/app/components/replays/header/replayMetaData.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import styled from '@emotion/styled';
33

44
import ErrorCounts from 'sentry/components/replays/header/errorCounts';
55
import HeaderPlaceholder from 'sentry/components/replays/header/headerPlaceholder';
6-
import {IconCursorArrow} from 'sentry/icons';
6+
import TimeSince from 'sentry/components/timeSince';
7+
import {IconCalendar, IconCursorArrow} from 'sentry/icons';
78
import {t} from 'sentry/locale';
89
import {space} from 'sentry/styles/space';
910
import EventView from 'sentry/utils/discover/eventView';
@@ -37,6 +38,22 @@ function ReplayMetaData({replayErrors, replayRecord}: Props) {
3738

3839
return (
3940
<KeyMetrics>
41+
<KeyMetricLabel>{t('Start Time')}</KeyMetricLabel>
42+
<KeyMetricData>
43+
{replayRecord ? (
44+
<TimeContainer>
45+
<IconCalendar color="gray300" size="sm" />
46+
<TimeSince
47+
date={replayRecord.started_at}
48+
isTooltipHoverable
49+
unitStyle="regular"
50+
/>
51+
</TimeContainer>
52+
) : (
53+
<HeaderPlaceholder width="80px" height="16px" />
54+
)}
55+
</KeyMetricData>
56+
4057
<KeyMetricLabel>{t('Dead Clicks')}</KeyMetricLabel>
4158
<KeyMetricData>
4259
{replayRecord?.count_dead_clicks ? (
@@ -80,7 +97,7 @@ function ReplayMetaData({replayErrors, replayRecord}: Props) {
8097
const KeyMetrics = styled('dl')`
8198
display: grid;
8299
grid-template-rows: max-content 1fr;
83-
grid-template-columns: repeat(4, max-content);
100+
grid-template-columns: repeat(5, max-content);
84101
grid-auto-flow: column;
85102
gap: 0 ${space(3)};
86103
align-items: center;
@@ -117,4 +134,10 @@ const ClickCount = styled(Count)<{color: ColorOrAlias}>`
117134
align-items: center;
118135
`;
119136

137+
const TimeContainer = styled('div')`
138+
display: flex;
139+
gap: ${space(1)};
140+
align-items: center;
141+
`;
142+
120143
export default ReplayMetaData;

static/app/views/replays/detail/page.tsx

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import HeaderPlaceholder from 'sentry/components/replays/header/headerPlaceholde
1111
import ReplayMetaData from 'sentry/components/replays/header/replayMetaData';
1212
import ShareButton from 'sentry/components/replays/shareButton';
1313
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
14-
import TimeSince from 'sentry/components/timeSince';
15-
import {IconCalendar} from 'sentry/icons';
1614
import {t} from 'sentry/locale';
1715
import {space} from 'sentry/styles/space';
1816
import type {ReplayError, ReplayRecord} from 'sentry/views/replays/types';
@@ -61,23 +59,7 @@ function Page({children, orgSlug, replayRecord, projectSlug, replayErrors}: Prop
6159
ip_address: replayRecord.user.ip || '',
6260
id: replayRecord.user.id || '',
6361
}}
64-
// this is the subheading for the avatar, so displayEmail in this case is a misnomer
65-
displayEmail={
66-
<div>
67-
{replayRecord ? (
68-
<TimeContainer>
69-
<IconCalendar color="gray300" size="xs" />
70-
<StyledTimeSince
71-
date={replayRecord.started_at}
72-
isTooltipHoverable
73-
unitStyle="regular"
74-
/>
75-
</TimeContainer>
76-
) : (
77-
<HeaderPlaceholder width="80px" height="16px" />
78-
)}
79-
</div>
80-
}
62+
hideEmail
8163
/>
8264
) : (
8365
<HeaderPlaceholder width="100%" height="58px" />
@@ -116,14 +98,4 @@ const ButtonActionsWrapper = styled(Layout.HeaderActions)`
11698
}
11799
`;
118100

119-
const TimeContainer = styled('div')`
120-
display: flex;
121-
gap: ${space(0.5)};
122-
align-items: center;
123-
`;
124-
125-
const StyledTimeSince = styled(TimeSince)`
126-
font-size: ${p => p.theme.fontSizeMedium};
127-
`;
128-
129101
export default Page;

0 commit comments

Comments
 (0)