Skip to content

Commit 2bdfbef

Browse files
authored
feat(replay): Add an Alert in playlist tab when there is a query (#105690)
<img width="739" height="334" alt="image" src="https://github.com/user-attachments/assets/6225d684-1a99-4e4e-ab85-c5f955bee223" />
1 parent 0c7847e commit 2bdfbef

File tree

1 file changed

+36
-11
lines changed
  • static/app/views/replays/detail/playlist

1 file changed

+36
-11
lines changed

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

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import {parseAsString, useQueryState} from 'nuqs';
2+
3+
import {Flex, Grid} from '@sentry/scraps/layout';
4+
import {Text} from '@sentry/scraps/text';
5+
6+
import {Alert} from 'sentry/components/core/alert';
17
import ReplayTable from 'sentry/components/replays/table/replayTable';
28
import {
39
ReplayBrowserColumn,
@@ -6,6 +12,8 @@ import {
612
ReplayOSColumn,
713
ReplaySessionColumn,
814
} from 'sentry/components/replays/table/replayTableColumns';
15+
import {ProvidedFormattedQuery} from 'sentry/components/searchQueryBuilder/formattedQuery';
16+
import {t} from 'sentry/locale';
917
import {useReplayPlaylist} from 'sentry/utils/replays/playback/providers/replayPlaylistProvider';
1018
import {useLocation} from 'sentry/utils/useLocation';
1119
import useAllMobileProj from 'sentry/views/replays/detail/useAllMobileProj';
@@ -28,20 +36,37 @@ const MOBILE_COLUMNS = [
2836
export default function Playlist() {
2937
const {replays, currentReplayIndex, isLoading} = useReplayPlaylist();
3038
const location = useLocation();
39+
const [query] = useQueryState('query', parseAsString.withDefault(''));
3140

3241
const {allMobileProj} = useAllMobileProj({});
3342
const columns = allMobileProj ? MOBILE_COLUMNS : VISIBLE_COLUMNS;
43+
const rows = query ? 'max-content auto' : 'auto';
44+
3445
return (
35-
<ReplayTable
36-
columns={columns}
37-
error={null}
38-
highlightedRowIndex={currentReplayIndex}
39-
// we prefer isLoading since isPending is true even if not enabled
40-
isPending={isLoading}
41-
query={location.query}
42-
replays={replays}
43-
showDropdownFilters={false}
44-
stickyHeader
45-
/>
46+
<Flex height="100%" overflow="auto">
47+
<Grid gap="md" rows={rows} height="100%" width="100%">
48+
{query ? (
49+
<Alert
50+
variant="info"
51+
showIcon
52+
defaultExpanded
53+
expand={<ProvidedFormattedQuery query={query} />}
54+
>
55+
<Text>{t('This playlist is filtered by:')} </Text>
56+
</Alert>
57+
) : null}
58+
<ReplayTable
59+
columns={columns}
60+
error={null}
61+
highlightedRowIndex={currentReplayIndex}
62+
// we prefer isLoading since isPending is true even if not enabled
63+
isPending={isLoading}
64+
query={location.query}
65+
replays={replays}
66+
showDropdownFilters={false}
67+
stickyHeader
68+
/>
69+
</Grid>
70+
</Flex>
4671
);
4772
}

0 commit comments

Comments
 (0)