Skip to content
Merged
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
47 changes: 36 additions & 11 deletions static/app/views/replays/detail/playlist/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import {parseAsString, useQueryState} from 'nuqs';

import {Flex, Grid} from '@sentry/scraps/layout';
import {Text} from '@sentry/scraps/text';

import {Alert} from 'sentry/components/core/alert';
import ReplayTable from 'sentry/components/replays/table/replayTable';
import {
ReplayBrowserColumn,
Expand All @@ -6,6 +12,8 @@ import {
ReplayOSColumn,
ReplaySessionColumn,
} from 'sentry/components/replays/table/replayTableColumns';
import {ProvidedFormattedQuery} from 'sentry/components/searchQueryBuilder/formattedQuery';
import {t} from 'sentry/locale';
import {useReplayPlaylist} from 'sentry/utils/replays/playback/providers/replayPlaylistProvider';
import {useLocation} from 'sentry/utils/useLocation';
import useAllMobileProj from 'sentry/views/replays/detail/useAllMobileProj';
Expand All @@ -28,20 +36,37 @@ const MOBILE_COLUMNS = [
export default function Playlist() {
const {replays, currentReplayIndex, isLoading} = useReplayPlaylist();
const location = useLocation();
const [query] = useQueryState('query', parseAsString.withDefault(''));

const {allMobileProj} = useAllMobileProj({});
const columns = allMobileProj ? MOBILE_COLUMNS : VISIBLE_COLUMNS;
const rows = query ? 'max-content auto' : 'auto';

return (
<ReplayTable
columns={columns}
error={null}
highlightedRowIndex={currentReplayIndex}
// we prefer isLoading since isPending is true even if not enabled
isPending={isLoading}
query={location.query}
replays={replays}
showDropdownFilters={false}
stickyHeader
/>
<Flex height="100%" overflow="auto">
<Grid gap="md" rows={rows} height="100%" width="100%">
Copy link
Member

Choose a reason for hiding this comment

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

Grid!

Copy link
Member Author

Choose a reason for hiding this comment

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

I had to do this to make the multiline Alert work, otherwise it wouldn't expand properly

Copy link
Member

Choose a reason for hiding this comment

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

ya! it looks like it'll work well that way, using the templates to keep things the right size

Copy link
Member

Choose a reason for hiding this comment

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

ya! it looks like it'll work well that way, using the templates to keep things the right size

{query ? (
<Alert
variant="info"
showIcon
defaultExpanded
expand={<ProvidedFormattedQuery query={query} />}
>
<Text>{t('This playlist is filtered by:')} </Text>
</Alert>
) : null}
<ReplayTable
columns={columns}
error={null}
highlightedRowIndex={currentReplayIndex}
// we prefer isLoading since isPending is true even if not enabled
isPending={isLoading}
query={location.query}
replays={replays}
showDropdownFilters={false}
stickyHeader
/>
</Grid>
</Flex>
);
}
Loading