Skip to content

Commit 143bb38

Browse files
c298leeryan953
andauthored
feat(replays): Move player controller to bottom of screen (#58166)
Moves the player controller to the bottom of screen. Change is under feature flag "session-replay-new-timeline" Before: <img width="1497" alt="image" src="https://github.com/getsentry/sentry/assets/55311782/238d192a-64cd-489f-8879-c503d222a3de"> After: <img width="1497" alt="image" src="https://github.com/getsentry/sentry/assets/55311782/7190d9d6-3b47-4027-8263-876bd061fcbb"> Relates to https://github.com/getsentry/team-replay/issues/198 --------- Co-authored-by: Ryan Albrecht <[email protected]>
1 parent fb956d8 commit 143bb38

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

static/app/components/replays/replayView.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import ReplayController from 'sentry/components/replays/replayController';
55
import ReplayCurrentUrl from 'sentry/components/replays/replayCurrentUrl';
66
import ReplayPlayer from 'sentry/components/replays/replayPlayer';
77
import {space} from 'sentry/styles/space';
8+
import useOrganization from 'sentry/utils/useOrganization';
89
import BrowserOSIcons from 'sentry/views/replays/detail/browserOSIcons';
910
import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
1011

@@ -13,6 +14,8 @@ type Props = {
1314
};
1415

1516
function ReplayView({toggleFullscreen}: Props) {
17+
const organization = useOrganization();
18+
const hasNewTimeline = organization.features.includes('session-replay-new-timeline');
1619
return (
1720
<Fragment>
1821
<ContextContainer>
@@ -22,7 +25,7 @@ function ReplayView({toggleFullscreen}: Props) {
2225
<Panel>
2326
<ReplayPlayer />
2427
</Panel>
25-
<ReplayController toggleFullscreen={toggleFullscreen} />
28+
{hasNewTimeline ? null : <ReplayController toggleFullscreen={toggleFullscreen} />}
2629
</Fragment>
2730
);
2831
}

static/app/views/replays/detail/layout/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import styled from '@emotion/styled';
33

44
import ErrorBoundary from 'sentry/components/errorBoundary';
55
import ReplayTimeline from 'sentry/components/replays/breadcrumbs/replayTimeline';
6+
import ReplayController from 'sentry/components/replays/replayController';
67
import ReplayView from 'sentry/components/replays/replayView';
78
import {space} from 'sentry/styles/space';
89
import {LayoutKey} from 'sentry/utils/replays/hooks/useReplayLayout';
910
import {useDimensions} from 'sentry/utils/useDimensions';
11+
import useOrganization from 'sentry/utils/useOrganization';
1012
import useFullscreen from 'sentry/utils/window/useFullscreen';
1113
import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
1214
import FluidPanel from 'sentry/views/replays/detail/layout/fluidPanel';
@@ -34,6 +36,9 @@ function ReplayLayout({layout = LayoutKey.TOPBAR}: Props) {
3436
const measureRef = useRef<HTMLDivElement>(null);
3537
const {width, height} = useDimensions({elementRef: measureRef});
3638

39+
const organization = useOrganization();
40+
const hasNewTimeline = organization.features.includes('session-replay-new-timeline');
41+
3742
const timeline = (
3843
<ErrorBoundary mini>
3944
<ReplayTimeline />
@@ -48,11 +53,18 @@ function ReplayLayout({layout = LayoutKey.TOPBAR}: Props) {
4853
</VideoSection>
4954
);
5055

56+
const controller = hasNewTimeline ? (
57+
<ErrorBoundary>
58+
<ReplayController toggleFullscreen={toggleFullscreen} />
59+
</ErrorBoundary>
60+
) : null;
61+
5162
if (layout === LayoutKey.VIDEO_ONLY) {
5263
return (
5364
<BodyContent>
5465
{timeline}
5566
{video}
67+
{controller}
5668
</BodyContent>
5769
);
5870
}
@@ -97,6 +109,7 @@ function ReplayLayout({layout = LayoutKey.TOPBAR}: Props) {
97109
/>
98110
) : null}
99111
</FluidHeight>
112+
{controller}
100113
</BodyContent>
101114
);
102115
}
@@ -120,6 +133,7 @@ function ReplayLayout({layout = LayoutKey.TOPBAR}: Props) {
120133
/>
121134
) : null}
122135
</FluidHeight>
136+
{controller}
123137
</BodyContent>
124138
);
125139
}

0 commit comments

Comments
 (0)