Skip to content

Commit

Permalink
feat(replays): Move player controller to bottom of screen (#58166)
Browse files Browse the repository at this point in the history
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 getsentry/team-replay#198

---------

Co-authored-by: Ryan Albrecht <[email protected]>
  • Loading branch information
c298lee and ryan953 authored Oct 16, 2023
1 parent fb956d8 commit 143bb38
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion static/app/components/replays/replayView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ReplayController from 'sentry/components/replays/replayController';
import ReplayCurrentUrl from 'sentry/components/replays/replayCurrentUrl';
import ReplayPlayer from 'sentry/components/replays/replayPlayer';
import {space} from 'sentry/styles/space';
import useOrganization from 'sentry/utils/useOrganization';
import BrowserOSIcons from 'sentry/views/replays/detail/browserOSIcons';
import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';

Expand All @@ -13,6 +14,8 @@ type Props = {
};

function ReplayView({toggleFullscreen}: Props) {
const organization = useOrganization();
const hasNewTimeline = organization.features.includes('session-replay-new-timeline');
return (
<Fragment>
<ContextContainer>
Expand All @@ -22,7 +25,7 @@ function ReplayView({toggleFullscreen}: Props) {
<Panel>
<ReplayPlayer />
</Panel>
<ReplayController toggleFullscreen={toggleFullscreen} />
{hasNewTimeline ? null : <ReplayController toggleFullscreen={toggleFullscreen} />}
</Fragment>
);
}
Expand Down
14 changes: 14 additions & 0 deletions static/app/views/replays/detail/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import styled from '@emotion/styled';

import ErrorBoundary from 'sentry/components/errorBoundary';
import ReplayTimeline from 'sentry/components/replays/breadcrumbs/replayTimeline';
import ReplayController from 'sentry/components/replays/replayController';
import ReplayView from 'sentry/components/replays/replayView';
import {space} from 'sentry/styles/space';
import {LayoutKey} from 'sentry/utils/replays/hooks/useReplayLayout';
import {useDimensions} from 'sentry/utils/useDimensions';
import useOrganization from 'sentry/utils/useOrganization';
import useFullscreen from 'sentry/utils/window/useFullscreen';
import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
import FluidPanel from 'sentry/views/replays/detail/layout/fluidPanel';
Expand Down Expand Up @@ -34,6 +36,9 @@ function ReplayLayout({layout = LayoutKey.TOPBAR}: Props) {
const measureRef = useRef<HTMLDivElement>(null);
const {width, height} = useDimensions({elementRef: measureRef});

const organization = useOrganization();
const hasNewTimeline = organization.features.includes('session-replay-new-timeline');

const timeline = (
<ErrorBoundary mini>
<ReplayTimeline />
Expand All @@ -48,11 +53,18 @@ function ReplayLayout({layout = LayoutKey.TOPBAR}: Props) {
</VideoSection>
);

const controller = hasNewTimeline ? (
<ErrorBoundary>
<ReplayController toggleFullscreen={toggleFullscreen} />
</ErrorBoundary>
) : null;

if (layout === LayoutKey.VIDEO_ONLY) {
return (
<BodyContent>
{timeline}
{video}
{controller}
</BodyContent>
);
}
Expand Down Expand Up @@ -97,6 +109,7 @@ function ReplayLayout({layout = LayoutKey.TOPBAR}: Props) {
/>
) : null}
</FluidHeight>
{controller}
</BodyContent>
);
}
Expand All @@ -120,6 +133,7 @@ function ReplayLayout({layout = LayoutKey.TOPBAR}: Props) {
/>
) : null}
</FluidHeight>
{controller}
</BodyContent>
);
}
Expand Down

0 comments on commit 143bb38

Please sign in to comment.