Skip to content

Commit e6b5424

Browse files
committed
ref(replay): Cleanup old session-replay-trace-table experiment
1 parent 8b39295 commit e6b5424

19 files changed

+14
-1138
lines changed

static/app/components/replays/breadcrumbs/breadcrumbItem.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import {isErrorFrame, isFeedbackFrame} from 'sentry/utils/replays/types';
2121
import useOrganization from 'sentry/utils/useOrganization';
2222
import useProjectFromSlug from 'sentry/utils/useProjectFromSlug';
2323
import IconWrapper from 'sentry/views/replays/detail/iconWrapper';
24-
import TraceGrid from 'sentry/views/replays/detail/perfTable/traceGrid';
25-
import type {ReplayTraceRow} from 'sentry/views/replays/detail/perfTable/useReplayPerfData';
2624
import TimestampButton from 'sentry/views/replays/detail/timestampButton';
2725

2826
type MouseCallback = (frame: ReplayFrame, e: React.MouseEvent<HTMLElement>) => void;
@@ -33,7 +31,6 @@ interface Props {
3331
extraction: Extraction | undefined;
3432
frame: ReplayFrame;
3533
onClick: null | MouseCallback;
36-
onDimensionChange: () => void;
3734
onInspectorExpanded: (
3835
path: string,
3936
expandedState: Record<string, boolean>,
@@ -42,7 +39,6 @@ interface Props {
4239
onMouseEnter: MouseCallback;
4340
onMouseLeave: MouseCallback;
4441
startTimestampMs: number;
45-
traces: ReplayTraceRow | undefined;
4642
className?: string;
4743
expandPaths?: string[];
4844
style?: CSSProperties;
@@ -54,13 +50,11 @@ function BreadcrumbItem({
5450
frame,
5551
expandPaths,
5652
onClick,
57-
onDimensionChange,
5853
onInspectorExpanded,
5954
onMouseEnter,
6055
onMouseLeave,
6156
startTimestampMs,
6257
style,
63-
traces,
6458
}: Props) {
6559
const {color, description, title, icon} = getFrameDetails(frame);
6660
const {replay} = useReplayContext();
@@ -133,14 +127,6 @@ function BreadcrumbItem({
133127
</CodeContainer>
134128
) : null}
135129

136-
{traces?.flattenedTraces.map((flatTrace, i) => (
137-
<TraceGrid
138-
key={i}
139-
flattenedTrace={flatTrace}
140-
onDimensionChange={onDimensionChange}
141-
/>
142-
))}
143-
144130
{isErrorFrame(frame) || isFeedbackFrame(frame) ? (
145131
<CrumbErrorIssue frame={frame} />
146132
) : null}

static/app/utils/replays/hooks/useActiveReplayTab.spec.tsx

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -102,37 +102,4 @@ describe('useActiveReplayTab', () => {
102102
query: {t_main: TabKey.TAGS},
103103
});
104104
});
105-
106-
it('should disallow PERF by default', () => {
107-
mockOrganizationFixture({
108-
features: [],
109-
});
110-
111-
const {result} = reactHooks.renderHook(useActiveReplayTab, {
112-
initialProps: {},
113-
});
114-
expect(result.current.getActiveTab()).toBe(TabKey.BREADCRUMBS);
115-
116-
result.current.setActiveTab(TabKey.PERF);
117-
expect(mockPush).toHaveBeenLastCalledWith({
118-
pathname: '',
119-
query: {t_main: TabKey.BREADCRUMBS},
120-
});
121-
});
122-
123-
it('should allow PERF when the feature is enabled', () => {
124-
mockOrganizationFixture({
125-
features: ['session-replay-trace-table'],
126-
});
127-
const {result} = reactHooks.renderHook(useActiveReplayTab, {
128-
initialProps: {},
129-
});
130-
expect(result.current.getActiveTab()).toBe(TabKey.BREADCRUMBS);
131-
132-
result.current.setActiveTab(TabKey.PERF);
133-
expect(mockPush).toHaveBeenLastCalledWith({
134-
pathname: '',
135-
query: {t_main: TabKey.PERF},
136-
});
137-
});
138105
});

static/app/utils/replays/hooks/useActiveReplayTab.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import {useCallback} from 'react';
22

3-
import type {Organization} from 'sentry/types';
4-
import useOrganization from 'sentry/utils/useOrganization';
53
import useUrlParams from 'sentry/utils/useUrlParams';
64

75
export enum TabKey {
@@ -11,42 +9,32 @@ export enum TabKey {
119
ERRORS = 'errors',
1210
MEMORY = 'memory',
1311
NETWORK = 'network',
14-
PERF = 'perf',
1512
TAGS = 'tags',
1613
TRACE = 'trace',
1714
}
1815

19-
function isReplayTab(tab: string, organization: Organization): tab is TabKey {
20-
const hasPerfTab = organization.features.includes('session-replay-trace-table');
21-
22-
if (tab === TabKey.PERF) {
23-
return hasPerfTab;
24-
}
25-
16+
function isReplayTab(tab: string): tab is TabKey {
2617
return Object.values<string>(TabKey).includes(tab);
2718
}
2819

2920
function useActiveReplayTab({isVideoReplay}: {isVideoReplay?: boolean}) {
3021
const defaultTab = isVideoReplay ? TabKey.TAGS : TabKey.BREADCRUMBS;
31-
const organization = useOrganization();
3222
const {getParamValue, setParamValue} = useUrlParams('t_main', defaultTab);
3323

3424
const paramValue = getParamValue()?.toLowerCase() ?? '';
3525

3626
return {
3727
getActiveTab: useCallback(
38-
() => (isReplayTab(paramValue, organization) ? (paramValue as TabKey) : defaultTab),
39-
[organization, paramValue, defaultTab]
28+
() => (isReplayTab(paramValue) ? (paramValue as TabKey) : defaultTab),
29+
[paramValue, defaultTab]
4030
),
4131
setActiveTab: useCallback(
4232
(value: string) => {
4333
setParamValue(
44-
isReplayTab(value.toLowerCase(), organization)
45-
? value.toLowerCase()
46-
: defaultTab
34+
isReplayTab(value.toLowerCase()) ? value.toLowerCase() : defaultTab
4735
);
4836
},
49-
[organization, setParamValue, defaultTab]
37+
[setParamValue, defaultTab]
5038
),
5139
};
5240
}

static/app/views/replays/detail/breadcrumbs/breadcrumbRow.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import {useReplayContext} from 'sentry/components/replays/replayContext';
77
import type {Extraction} from 'sentry/utils/replays/extractDomNodes';
88
import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers';
99
import type {ReplayFrame} from 'sentry/utils/replays/types';
10-
import type {ReplayTraceRow} from 'sentry/views/replays/detail/perfTable/useReplayPerfData';
1110

1211
interface Props {
1312
extraction: Extraction | undefined;
1413
frame: ReplayFrame;
1514
index: number;
1615
onClick: ReturnType<typeof useCrumbHandlers>['onClickTimestamp'];
17-
onDimensionChange: (index: number) => void;
1816
onInspectorExpanded: (
1917
index: number,
2018
path: string,
@@ -23,7 +21,6 @@ interface Props {
2321
) => void;
2422
startTimestampMs: number;
2523
style: CSSProperties;
26-
traces: ReplayTraceRow | undefined;
2724
breadcrumbIndex?: number[][];
2825
expandPaths?: string[];
2926
}
@@ -34,19 +31,14 @@ export default function BreadcrumbRow({
3431
frame,
3532
index,
3633
onClick,
37-
onDimensionChange,
3834
onInspectorExpanded,
3935
startTimestampMs,
4036
style,
41-
traces,
4237
}: Props) {
4338
const {currentTime, currentHoverTime} = useReplayContext();
4439

4540
const {onMouseEnter, onMouseLeave} = useCrumbHandlers();
46-
const handleDimensionChange = useCallback(
47-
() => onDimensionChange(index),
48-
[onDimensionChange, index]
49-
);
41+
5042
const handleObjectInspectorExpanded = useCallback(
5143
(path, expandedState, e) => onInspectorExpanded?.(index, path, expandedState, e),
5244
[index, onInspectorExpanded]
@@ -66,14 +58,12 @@ export default function BreadcrumbRow({
6658
})}
6759
style={style}
6860
frame={frame}
69-
traces={traces}
7061
extraction={extraction}
7162
onClick={onClick}
7263
onMouseEnter={onMouseEnter}
7364
onMouseLeave={onMouseLeave}
7465
startTimestampMs={startTimestampMs}
7566
expandPaths={expandPaths}
76-
onDimensionChange={handleDimensionChange}
7767
onInspectorExpanded={handleObjectInspectorExpanded}
7868
/>
7969
);

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import useJumpButtons from 'sentry/components/replays/useJumpButtons';
99
import {t} from 'sentry/locale';
1010
import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers';
1111
import useExtractedDomNodes from 'sentry/utils/replays/hooks/useExtractedDomNodes';
12-
import useOrganization from 'sentry/utils/useOrganization';
1312
import useVirtualizedInspector from 'sentry/views/replays/detail//useVirtualizedInspector';
1413
import BreadcrumbFilters from 'sentry/views/replays/detail/breadcrumbs/breadcrumbFilters';
1514
import BreadcrumbRow from 'sentry/views/replays/detail/breadcrumbs/breadcrumbRow';
@@ -18,10 +17,8 @@ import useScrollToCurrentItem from 'sentry/views/replays/detail/breadcrumbs/useS
1817
import FilterLoadingIndicator from 'sentry/views/replays/detail/filterLoadingIndicator';
1918
import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
2019
import NoRowRenderer from 'sentry/views/replays/detail/noRowRenderer';
21-
import useReplayPerfData from 'sentry/views/replays/detail/perfTable/useReplayPerfData';
2220
import TabItemContainer from 'sentry/views/replays/detail/tabItemContainer';
2321
import useVirtualizedList from 'sentry/views/replays/detail/useVirtualizedList';
24-
import useVirtualListDimentionChange from 'sentry/views/replays/detail/useVirtualListDimentionChange';
2522

2623
// Ensure this object is created once as it is an input to
2724
// `useVirtualizedList`'s memoization
@@ -32,13 +29,9 @@ const cellMeasurer = {
3229

3330
function Breadcrumbs() {
3431
const {currentTime, replay} = useReplayContext();
35-
const organization = useOrganization();
36-
const hasPerfTab = organization.features.includes('session-replay-trace-table');
37-
3832
const {onClickTimestamp} = useCrumbHandlers();
3933
const {data: frameToExtraction, isFetching: isFetchingExtractions} =
4034
useExtractedDomNodes({replay});
41-
const {data: frameToTrace, isFetching: isFetchingTraces} = useReplayPerfData({replay});
4235

4336
const startTimestampMs = replay?.getStartTimestampMs() ?? 0;
4437
const frames = replay?.getChapterFrames();
@@ -57,7 +50,6 @@ function Breadcrumbs() {
5750
ref: listRef,
5851
deps,
5952
});
60-
const {handleDimensionChange} = useVirtualListDimentionChange({cache, listRef});
6153
const {handleDimensionChange: handleInspectorExpanded} = useVirtualizedInspector({
6254
cache,
6355
listRef,
@@ -81,12 +73,12 @@ function Breadcrumbs() {
8173
ref: listRef,
8274
});
8375

84-
// Need to refresh the item dimensions as DOM & Trace data gets loaded
76+
// Need to refresh the item dimensions as DOM data gets loaded
8577
useEffect(() => {
86-
if (!isFetchingExtractions || !isFetchingTraces) {
78+
if (!isFetchingExtractions) {
8779
updateList();
8880
}
89-
}, [isFetchingExtractions, isFetchingTraces, updateList]);
81+
}, [isFetchingExtractions, updateList]);
9082

9183
const renderRow = ({index, key, style, parent}: ListRowProps) => {
9284
const item = (items || [])[index];
@@ -103,14 +95,12 @@ function Breadcrumbs() {
10395
index={index}
10496
frame={item}
10597
extraction={frameToExtraction?.get(item)}
106-
traces={hasPerfTab ? frameToTrace?.get(item) : undefined}
10798
startTimestampMs={startTimestampMs}
10899
style={style}
109100
expandPaths={Array.from(expandPathsRef.current?.get(index) || [])}
110101
onClick={() => {
111102
onClickTimestamp(item);
112103
}}
113-
onDimensionChange={handleDimensionChange}
114104
onInspectorExpanded={handleInspectorExpanded}
115105
/>
116106
</CellMeasurer>
@@ -119,7 +109,7 @@ function Breadcrumbs() {
119109

120110
return (
121111
<FluidHeight>
122-
<FilterLoadingIndicator isLoading={isFetchingExtractions || isFetchingTraces}>
112+
<FilterLoadingIndicator isLoading={isFetchingExtractions}>
123113
<BreadcrumbFilters frames={frames} {...filterProps} />
124114
</FilterLoadingIndicator>
125115
<TabItemContainer data-test-id="replay-details-breadcrumbs-tab">

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,17 @@ import {useLocation} from 'sentry/utils/useLocation';
1616
import useOrganization from 'sentry/utils/useOrganization';
1717

1818
function getReplayTabs({
19-
organization,
2019
isVideoReplay,
2120
}: {
2221
isVideoReplay: boolean;
2322
organization: Organization;
2423
}): Record<TabKey, ReactNode> {
25-
// The new trace table inside Breadcrumb items:
26-
const hasTraceTable = organization.features.includes('session-replay-trace-table');
27-
2824
return {
2925
[TabKey.BREADCRUMBS]: t('Breadcrumbs'),
3026
[TabKey.CONSOLE]: t('Console'),
3127
[TabKey.NETWORK]: t('Network'),
3228
[TabKey.ERRORS]: t('Errors'),
33-
[TabKey.TRACE]: hasTraceTable || isVideoReplay ? null : t('Trace'),
34-
[TabKey.PERF]: null,
29+
[TabKey.TRACE]: isVideoReplay ? null : t('Trace'),
3530
[TabKey.A11Y]: isVideoReplay ? null : (
3631
<Fragment>
3732
<Tooltip

static/app/views/replays/detail/perfTable/grabber.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

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

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)