Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Merge ReplayClipPreviewWrapper into GroupReplaysTableInner where its used #87818

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ function getReplayAnalyticsStatus({

return 'none';
}
function ReplayClipPreviewPlayer({

export default function ReplayClipPreviewPlayer({
analyticsContext,
orgSlug,
fullReplayButtonProps,
Expand Down Expand Up @@ -171,5 +172,3 @@ const StyledNegativeSpaceContainer = styled(NegativeSpaceContainer)<{isLarge?: b
height: ${p => (p.isLarge ? REPLAY_LOADING_HEIGHT_LARGE : REPLAY_LOADING_HEIGHT)}px;
border-radius: ${p => p.theme.borderRadius};
`;

export default ReplayClipPreviewPlayer;
54 changes: 26 additions & 28 deletions static/app/views/issueDetails/groupReplays/groupReplays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styled from '@emotion/styled';
import type {Location} from 'history';

import {Button} from 'sentry/components/core/button';
import ReplayClipPreviewPlayer from 'sentry/components/events/eventReplay/replayClipPreviewPlayer';
import * as Layout from 'sentry/components/layouts/thirds';
import Placeholder from 'sentry/components/placeholder';
import {Provider as ReplayContextProvider} from 'sentry/components/replays/replayContext';
Expand All @@ -27,7 +28,6 @@ import ReplayTable from 'sentry/views/replays/replayTable';
import {ReplayColumn} from 'sentry/views/replays/replayTable/types';
import type {ReplayListLocationQuery, ReplayListRecord} from 'sentry/views/replays/types';

import {ReplayClipPreviewWrapper} from './replayClipPreviewWrapper';
import useReplaysFromIssue from './useReplaysFromIssue';

type Props = {
Expand Down Expand Up @@ -67,12 +67,12 @@ function ReplayFilterMessage() {
);
}

function GroupReplays({group}: Props) {
export default function GroupReplays({group}: Props) {
const organization = useOrganization();
const location = useLocation<ReplayListLocationQuery>();
const hasStreamlinedUI = useHasStreamlinedUI();

const {eventView, fetchError, isFetching, pageLinks} = useReplaysFromIssue({
const {eventView, fetchError, isFetching} = useReplaysFromIssue({
group,
location,
organization,
Expand Down Expand Up @@ -116,13 +116,7 @@ function GroupReplays({group}: Props) {
);
}
return (
<GroupReplaysTable
eventView={eventView}
organization={organization}
pageLinks={pageLinks}
visibleColumns={visibleColumns(allMobileProj)}
Comment on lines -122 to -123
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two unused props are gone now

group={group}
/>
<GroupReplaysTable eventView={eventView} organization={organization} group={group} />
);
}

Expand All @@ -135,25 +129,23 @@ function GroupReplaysTableInner({
selectedReplayIndex,
overlayContent,
replays,
pageLinks,
}: {
children: React.ReactNode;
group: Group;
organization: Organization;
pageLinks: string | null;
replaySlug: string;
replays: ReplayListRecord[] | undefined;
selectedReplayIndex: number;
setSelectedReplayIndex: (index: number) => void;
overlayContent?: React.ReactNode;
}) {
const orgSlug = organization.slug;
const {fetching, replay} = useLoadReplayReader({
const replayReaderData = useLoadReplayReader({
orgSlug,
replaySlug,
group,
});
const {allMobileProj} = useAllMobileProj({});
const {fetching, replay} = replayReaderData;

return (
<ReplayContextProvider
Expand All @@ -162,16 +154,27 @@ function GroupReplaysTableInner({
replay={replay}
autoStart
>
<ReplayClipPreviewWrapper
orgSlug={orgSlug}
replaySlug={replaySlug}
group={group}
pageLinks={pageLinks}
selectedReplayIndex={selectedReplayIndex}
setSelectedReplayIndex={setSelectedReplayIndex}
visibleColumns={[ReplayColumn.PLAY_PAUSE, ...visibleColumns(allMobileProj)]}
<ReplayClipPreviewPlayer
replayReaderResult={replayReaderData}
overlayContent={overlayContent}
replays={replays}
orgSlug={orgSlug}
showNextAndPrevious
handleForwardClick={
replays && selectedReplayIndex + 1 < replays.length
? () => {
setSelectedReplayIndex(selectedReplayIndex + 1);
}
: undefined
}
handleBackClick={
selectedReplayIndex > 0
? () => {
setSelectedReplayIndex(selectedReplayIndex - 1);
}
: undefined
}
analyticsContext={'replay_tab'}
isLarge
/>
{children}
</ReplayContextProvider>
Expand All @@ -188,8 +191,6 @@ function GroupReplaysTable({
eventView: EventView;
group: Group;
organization: Organization;
pageLinks: string | null;
visibleColumns: ReplayColumn[];
}) {
const location = useLocation();
const urlParams = useUrlParams();
Expand Down Expand Up @@ -274,7 +275,6 @@ function GroupReplaysTable({
organization={organization}
group={group}
replaySlug={selectedReplay.id}
pageLinks={replayListData.pageLinks}
replays={replays}
>
{replayTable}
Expand Down Expand Up @@ -348,5 +348,3 @@ const OverlayText = styled('div')`
const UpNext = styled('div')`
line-height: 0;
`;

export default GroupReplays;
4 changes: 1 addition & 3 deletions static/app/views/issueDetails/groupReplays/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function GroupReplaysWithGroup() {
return <GroupReplays group={group} />;
}

function GroupReplaysContainer() {
export default function GroupReplaysContainer() {
const organization = useOrganization();

return (
Expand All @@ -48,5 +48,3 @@ function GroupReplaysContainer() {
</Feature>
);
}

export default GroupReplaysContainer;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was only imported from groupReplays.tsx, so safe to delete.

This file was deleted.

Loading