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

Conversation

ryan953
Copy link
Member

@ryan953 ryan953 commented Mar 24, 2025

Before we had: <GroupReplaysTableInner> with a child of <ReplayClipPreviewWrapper>. The Wrapper would then unconditionally render <ReplayClipPreviewPlayer> as it's child.

These components render replay clips inside the Issues Details > Replays tab. Users can watch clips from all events within an issue.

The names are each a bit confusing, and more-so because the component in the middle of the stack, <ReplayClipPreviewWrapper> didn't really have a strong job to do. It mostly proxied props down through the layers.

This PR removes <ReplayClipPreviewWrapper>. Now <GroupReplaysTableInner> includes <ReplayClipPreviewPlayer> as it's direct child. The wrapper component is removed from the codebase as this was the only callsite. Also some props were required by the Wrapper, but never used by the PreviewPlayer, so I cleaned up those unused fields.

@ryan953 ryan953 requested a review from a team as a code owner March 24, 2025 23:11
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 24, 2025
Comment on lines -122 to -123
pageLinks={pageLinks}
visibleColumns={visibleColumns(allMobileProj)}
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

Comment on lines -23 to -27
const replayReaderData = useLoadReplayReader({
orgSlug: props.orgSlug,
replaySlug: props.replaySlug,
group: props.group,
});
Copy link
Member Author

@ryan953 ryan953 Mar 24, 2025

Choose a reason for hiding this comment

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

We were already calling useLoadReplayReader from groupReplays.tsx, so this is redundant (caching helps with the fetches... but while constructing the Class we did a bunch of redundant processing and memoizing too)

Comment on lines -8 to -18
type Props = {
group: Group;
orgSlug: string;
pageLinks: string | null;
replaySlug: string;
replays: ReplayListRecord[] | undefined;
selectedReplayIndex: number;
setSelectedReplayIndex: (index: number) => void;
visibleColumns: ReplayColumn[];
overlayContent?: React.ReactNode;
};
Copy link
Member Author

@ryan953 ryan953 Mar 24, 2025

Choose a reason for hiding this comment

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

Not all of these props were used. So they also came out of the parent components in groupReplays.tsx

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.

@ryan953 ryan953 requested a review from a team March 25, 2025 16:25
@ryan953 ryan953 merged commit 4c79f54 into master Mar 26, 2025
43 checks passed
@ryan953 ryan953 deleted the ryan953/ref-ReplayClipPreviewWrapper branch March 26, 2025 20:39
andrewshie-sentry pushed a commit that referenced this pull request Mar 27, 2025
… its used (#87818)

Before we had: `<GroupReplaysTableInner>` with a child of
`<ReplayClipPreviewWrapper>`. The Wrapper would then unconditionally
render `<ReplayClipPreviewPlayer>` as it's child.

These components render replay clips inside the Issues Details > Replays
tab. Users can watch clips from all events within an issue.

The names are each a bit confusing, and more-so because the component in
the middle of the stack, `<ReplayClipPreviewWrapper>` didn't really have
a strong job to do. It mostly proxied props down through the layers.

This PR removes `<ReplayClipPreviewWrapper>`. Now
`<GroupReplaysTableInner>` includes `<ReplayClipPreviewPlayer>` as it's
direct child. The wrapper component is removed from the codebase as this
was the only callsite. Also some props were required by the Wrapper, but
never used by the PreviewPlayer, so I cleaned up those unused fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants