Skip to content

Commit 784c5e5

Browse files
Revert "fix(replay): Adjust number of columns on Replay List depending on container size (#97791)"
This reverts commit 849108f. Co-authored-by: ryan953 <[email protected]>
1 parent 849108f commit 784c5e5

File tree

5 files changed

+43
-100
lines changed

5 files changed

+43
-100
lines changed

static/app/components/replays/table/replayTable.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type {RefObject} from 'react';
21
import styled from '@emotion/styled';
32

43
import {Alert} from 'sentry/components/core/alert';
@@ -26,15 +25,13 @@ type Props = SortProps & {
2625
isPending: boolean;
2726
replays: ReplayListRecord[];
2827
showDropdownFilters: boolean;
29-
ref?: RefObject<HTMLDivElement | null>;
3028
};
3129

3230
export default function ReplayTable({
3331
columns,
3432
error,
3533
isPending,
3634
onSortClick,
37-
ref,
3835
replays,
3936
showDropdownFilters,
4037
sort,
@@ -46,7 +43,6 @@ export default function ReplayTable({
4643
return (
4744
<StyledSimpleTable
4845
data-test-id="replay-table-loading"
49-
ref={ref}
5046
style={{gridTemplateColumns}}
5147
>
5248
<ReplayTableHeader
@@ -66,7 +62,6 @@ export default function ReplayTable({
6662
return (
6763
<StyledSimpleTable
6864
data-test-id="replay-table-errored"
69-
ref={ref}
7065
style={{gridTemplateColumns}}
7166
>
7267
<ReplayTableHeader
@@ -87,11 +82,7 @@ export default function ReplayTable({
8782
}
8883

8984
return (
90-
<StyledSimpleTable
91-
data-test-id="replay-table"
92-
ref={ref}
93-
style={{gridTemplateColumns}}
94-
>
85+
<StyledSimpleTable data-test-id="replay-table" style={{gridTemplateColumns}}>
9586
<ReplayTableHeader
9687
columns={columns}
9788
onSortClick={onSortClick}
@@ -150,6 +141,8 @@ function getErrorMessage(fetchError: RequestError) {
150141
}
151142

152143
const RowCell = styled(SimpleTable.RowCell)`
144+
overflow-x: auto;
145+
153146
/* Used for cell menu items that are hidden by default */
154147
&:hover [data-visible-on-hover='true'] {
155148
opacity: 1;

static/app/components/replays/table/replayTableColumns.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,11 @@ export const ReplaySessionColumn: ReplayTableColumn = {
584584
size={24}
585585
/>
586586
<SubText>
587-
<DisplayName data-underline-on-hover>
588-
{replay.user.display_name || t('Anonymous User')}
589-
</DisplayName>
590-
587+
<Flex gap="xs" align="start">
588+
<DisplayName data-underline-on-hover>
589+
{replay.user.display_name || t('Anonymous User')}
590+
</DisplayName>
591+
</Flex>
591592
<Flex gap="xs">
592593
{/* Avatar is used instead of ProjectBadge because using ProjectBadge increases spacing, which doesn't look as good */}
593594
{project ? <ProjectAvatar size={12} project={project} /> : null}
@@ -666,7 +667,6 @@ const CellLink = styled(Link)`
666667
margin: -${p => p.theme.space.xl};
667668
padding: ${p => p.theme.space.xl};
668669
flex-grow: 1;
669-
width: 100%;
670670
671671
&:before {
672672
content: '';

static/app/components/tables/simpleTable/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {ComponentProps, CSSProperties, HTMLAttributes, RefObject} from 'react';
1+
import type {ComponentProps, CSSProperties, HTMLAttributes} from 'react';
22
import {css} from '@emotion/react';
33
import styled from '@emotion/styled';
44

@@ -10,7 +10,6 @@ import {defined} from 'sentry/utils';
1010

1111
interface TableProps extends HTMLAttributes<HTMLDivElement> {
1212
children: React.ReactNode;
13-
ref?: RefObject<HTMLDivElement | null>;
1413
}
1514

1615
interface RowProps extends HTMLAttributes<HTMLDivElement> {

static/app/views/replays/list/replayIndexTable.tsx

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Fragment, useMemo, useRef} from 'react';
1+
import {Fragment, useMemo} from 'react';
22
import styled from '@emotion/styled';
33

44
import {Button} from 'sentry/components/core/button';
@@ -9,6 +9,17 @@ import {
99
useNeedsJetpackComposePiiNotice,
1010
} from 'sentry/components/replays/jetpackComposePiiNotice';
1111
import ReplayTable from 'sentry/components/replays/table/replayTable';
12+
import {
13+
ReplayActivityColumn,
14+
ReplayBrowserColumn,
15+
ReplayCountDeadClicksColumn,
16+
ReplayCountErrorsColumn,
17+
ReplayCountRageClicksColumn,
18+
ReplayDurationColumn,
19+
ReplayOSColumn,
20+
ReplaySelectColumn,
21+
ReplaySessionColumn,
22+
} from 'sentry/components/replays/table/replayTableColumns';
1223
import useReplayTableSort from 'sentry/components/replays/table/useReplayTableSort';
1324
import {t, tct} from 'sentry/locale';
1425
import {trackAnalytics} from 'sentry/utils/analytics';
@@ -25,7 +36,6 @@ import {
2536
} from 'sentry/utils/replays/sdkVersions';
2637
import {MutableSearch} from 'sentry/utils/tokenizeSearch';
2738
import useLocationQuery from 'sentry/utils/url/useLocationQuery';
28-
import {useDimensions} from 'sentry/utils/useDimensions';
2939
import {useLocalStorageState} from 'sentry/utils/useLocalStorageState';
3040
import {useNavigate} from 'sentry/utils/useNavigate';
3141
import useOrganization from 'sentry/utils/useOrganization';
@@ -35,10 +45,30 @@ import useAllMobileProj from 'sentry/views/replays/detail/useAllMobileProj';
3545
import BulkDeleteAlert from 'sentry/views/replays/list/bulkDeleteAlert';
3646
import ReplaysFilters from 'sentry/views/replays/list/filters';
3747
import ReplaysSearch from 'sentry/views/replays/list/search';
38-
import useReplayIndexTableColumns from 'sentry/views/replays/list/useReplayIndexTableColumns';
3948
import DeadRageSelectorCards from 'sentry/views/replays/selectors/deadRageSelectorCards';
4049
import type {ReplayListRecord} from 'sentry/views/replays/types';
4150

51+
const COLUMNS_WEB = [
52+
ReplaySelectColumn,
53+
ReplaySessionColumn,
54+
ReplayOSColumn,
55+
ReplayBrowserColumn,
56+
ReplayDurationColumn,
57+
ReplayCountDeadClicksColumn,
58+
ReplayCountRageClicksColumn,
59+
ReplayCountErrorsColumn,
60+
ReplayActivityColumn,
61+
] as const;
62+
63+
const COLUMNS_MOBILE = [
64+
ReplaySelectColumn,
65+
ReplaySessionColumn,
66+
ReplayOSColumn,
67+
ReplayDurationColumn,
68+
ReplayCountErrorsColumn,
69+
ReplayActivityColumn,
70+
] as const;
71+
4272
export default function ReplayIndexTable() {
4373
const queryClient = useQueryClient();
4474
const organization = useOrganization();
@@ -47,9 +77,6 @@ export default function ReplayIndexTable() {
4777
selection: {projects},
4878
} = usePageFilters();
4979

50-
const tableRef = useRef<HTMLDivElement>(null);
51-
const tableDimensions = useDimensions({elementRef: tableRef});
52-
5380
const rageClicksSdkVersion = useProjectSdkNeedsUpdate({
5481
minVersion: MIN_DEAD_RAGE_CLICK_SDK.minVersion,
5582
projectId: projects.map(String),
@@ -82,7 +109,7 @@ export default function ReplayIndexTable() {
82109
const replays = data?.data?.map(mapResponseToReplayRecord) ?? [];
83110

84111
const {allMobileProj} = useAllMobileProj({});
85-
const columns = useReplayIndexTableColumns({allMobileProj, tableDimensions});
112+
const columns = allMobileProj ? COLUMNS_MOBILE : COLUMNS_WEB;
86113

87114
const needsSDKUpdateForClickSearch = useNeedsSDKUpdateForClickSearch(query);
88115

@@ -142,7 +169,6 @@ export default function ReplayIndexTable() {
142169
</Fragment>
143170
) : (
144171
<ReplayTable
145-
ref={tableRef}
146172
columns={columns}
147173
error={error}
148174
isPending={isPending}

static/app/views/replays/list/useReplayIndexTableColumns.tsx

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

0 commit comments

Comments
 (0)