:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(replay): move the collections segment to quill (#128200)
Hayne Ryu5e866b273455
diff --git a/frontend/src/scenes/session-recordings/playlist/ReplayCollectionView.tsx b/frontend/src/scenes/session-recordings/playlist/ReplayCollectionView.tsxindex 551183bb71da..8c30b8e8349f 100644--- a/frontend/src/scenes/session-recordings/playlist/ReplayCollectionView.tsx+++ b/frontend/src/scenes/session-recordings/playlist/ReplayCollectionView.tsx@@ -1,9 +1,9 @@import { BindLogic, useActions, useMountedLogic, useValues } from 'kea'import { IconArrowLeft, IconExternal, IconPlus } from '@posthog/icons'-import { LemonBadge, LemonButton, LemonSkeleton } from '@posthog/lemon-ui'+import { Badge, Button, Item, ItemContent, ItemDescription, Skeleton } from '@posthog/quill'-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'+import { LinkPrimitive } from 'lib/lemon-ui/Link'import { urls } from 'scenes/urls'import { BUILT_IN_COLLECTION_ICONS } from '../collections/builtInCollectionIcons'@@ -38,48 +38,54 @@ export function ReplayCollectionView({ shortId, logicKey }: { shortId: string; lreturn (<div className="flex flex-col flex-1 min-h-0 gap-2" data-attr="list-collection-view">- <div className="flex items-center gap-1">- <LemonButton- size="small"- icon={<IconArrowLeft />}+ <div data-quill className="flex items-center gap-1 text-foreground">+ <Button+ size="icon-sm"onClick={closeCollection}tooltip="Back to collections"aria-label="Back to collections"data-attr="list-collection-back"- />+ >+ <IconArrowLeft />+ </Button>{playlist ? (<span className="flex items-center gap-1.5 min-w-0 flex-1 text-sm font-semibold">{BUILT_IN_COLLECTION_ICONS[playlist.short_id]}<span className="truncate">{playlist.name || playlist.derived_name || 'Unnamed'}</span>- <LemonBadge.Number count={pinnedRecordings?.length ?? 0} size="small" status="muted" showZero />+ <Badge>{pinnedRecordings?.length ?? 0}</Badge></span>) : failed ? (<span className="flex-1 text-sm font-semibold">Collection</span>) : (- <LemonSkeleton className="h-5 flex-1" />+ <Skeleton className="h-5 flex-1" />)}{playlist && !playlist.is_synthetic && (- <LemonButton- size="small"- type="secondary"- icon={<IconPlus />}+ <Button+ variant="outline"+ size="sm"onClick={() => setAddRecordingsModalOpen(true)}data-attr="list-collection-add-recordings">+ <IconPlus />Add- </LemonButton>+ </Button>)}- <LemonButton- size="small"- icon={<IconExternal />}- to={urls.replayPlaylist(shortId)}+ <Button+ size="icon-sm"+ render={<LinkPrimitive to={urls.replayPlaylist(shortId)} />}tooltip="Open collection page"aria-label="Open collection page"data-attr="list-collection-open-page"- />+ >+ <IconExternal />+ </Button></div>{failed ? (- <LemonBanner type="error">Couldn't load this collection. Refresh the page to try again.</LemonBanner>+ <Item data-quill variant="outline" tone="destructive">+ <ItemContent>+ <ItemDescription>Couldn't load this collection. Refresh the page to try again.</ItemDescription>+ </ItemContent>+ </Item>) : (<BindLogic logic={sessionRecordingsPlaylistLogic} props={listProps}><Playlistdiff --git a/frontend/src/scenes/session-recordings/playlist/ReplayCollectionsSegment.tsx b/frontend/src/scenes/session-recordings/playlist/ReplayCollectionsSegment.tsxindex ab76597116d4..8d288e93f772 100644--- a/frontend/src/scenes/session-recordings/playlist/ReplayCollectionsSegment.tsx+++ b/frontend/src/scenes/session-recordings/playlist/ReplayCollectionsSegment.tsx@@ -1,10 +1,10 @@import { useActions, useValues } from 'kea'import { IconPin, IconPinFilled, IconPlus } from '@posthog/icons'-import { LemonBadge, LemonButton, LemonInput, LemonSkeleton, Link } from '@posthog/lemon-ui'+import { Badge, Button, Input, Item, ItemContent, ItemDescription, Skeleton, Text } from '@posthog/quill'import { AccessControlAction } from 'lib/components/AccessControlAction'-import { LemonBanner } from 'lib/lemon-ui/LemonBanner'+import { LinkPrimitive } from 'lib/lemon-ui/Link'import { urls } from 'scenes/urls'import { AccessControlLevel, AccessControlResourceType, ReplayTabs, SessionRecordingPlaylistType } from '~/types'@@ -32,33 +32,33 @@ export function ReplayCollectionsSegment({ logicKey }: { logicKey: string }): JSreturn (<div- className="flex flex-col flex-1 min-h-0 border rounded bg-surface-primary overflow-hidden"+ data-quill+ className="flex flex-col flex-1 min-h-0 border border-border rounded bg-background text-foreground overflow-hidden"data-attr="list-collections">- <div className="flex items-center gap-2 p-2 border-b">- <LemonInput+ <div className="flex items-center gap-2 p-2 border-b border-border">+ <Inputtype="search"- size="small"+ size="sm"className="flex-1"placeholder="Search collections"value={filters.search || ''}- onChange={(value) => setSavedPlaylistsFilters({ search: value || undefined })}+ onChange={(event) => setSavedPlaylistsFilters({ search: event.target.value || undefined })}data-attr="list-collections-search"/><AccessControlActionresourceType={AccessControlResourceType.SessionRecording}minAccessLevel={AccessControlLevel.Editor}>- <LemonButton- type="primary"- size="small"- icon={<IconPlus />}+ <Button+ variant="primary"onClick={() => void createCollection()}loading={creating}data-attr="list-collections-new">+ <IconPlus />New- </LemonButton>+ </Button></AccessControlAction></div><div className="flex-1 min-h-0 overflow-y-auto">@@ -81,17 +81,21 @@ export function ReplayCollectionsSegment({ logicKey }: { logicKey: string }): JS)}<CollectionSectionHeading title="Your collections" description="Made by your team." />{loadPlaylistsFailed ? (- <LemonBanner type="error" className="m-2">- Couldn't load your collections. Refresh the page to try again.- </LemonBanner>+ <Item variant="outline" tone="destructive" className="m-2">+ <ItemContent>+ <ItemDescription>+ Couldn't load your collections. Refresh the page to try again.+ </ItemDescription>+ </ItemContent>+ </Item>) : playlistsLoading && playlists.results.length === 0 ? (<RowSkeletons count={4} />) : playlists.results.length === 0 ? (- <p className="text-secondary text-xs m-0 px-3 py-4 text-center">+ <Text size="xs" variant="muted" className="px-3 py-4 text-center">{searching? 'No collections match your search.': 'No collections yet. Create one to group recordings.'}- </p>+ </Text>) : (playlists.results.map((playlist) => (<CollectionRow@@ -103,15 +107,20 @@ export function ReplayCollectionsSegment({ logicKey }: { logicKey: string }): JS)))}</div>- <div className="flex items-center justify-between gap-2 px-3 py-1.5 border-t text-xs">- <span className="text-secondary">+ <div className="flex items-center justify-between gap-2 px-3 py-1.5 border-t border-border text-xs">+ <span className="text-muted-foreground">{playlists.count > playlists.results.length? `Showing ${playlists.results.length} of ${playlists.count}`: ''}</span>- <Link to={urls.replay(ReplayTabs.Playlists)} data-attr="list-collections-manage">+ <Button+ variant="link"+ size="inline"+ render={<LinkPrimitive to={urls.replay(ReplayTabs.Playlists)} />}+ data-attr="list-collections-manage"+ >Manage collections- </Link>+ </Button></div></div>)@@ -127,28 +136,23 @@ function CollectionRow({onClick: () => void}): JSX.Element {const counts = getCollectionCounts(playlist.recordings_counts)+ const total = counts?.total || 0return (- <LemonButton- fullWidth- size="small"+ <Button+ size="row"+ leftclassName="rounded-none"- icon={icon}onClick={onClick}- sideIcon={- counts ? (- <LemonBadge.Number- count={counts.total || 0}- status={counts.unwatched ? 'primary' : 'muted'}- size="small"- maxDigits={3}- showZero- />- ) : undefined- }data-attr={playlist.is_synthetic ? 'list-collections-row-synthetic' : 'list-collections-row'}>- <span className="truncate font-normal">{playlist.name || playlist.derived_name || 'Unnamed'}</span>- </LemonButton>+ {icon}+ <span className="truncate">{playlist.name || playlist.derived_name || 'Unnamed'}</span>+ {counts && (+ <Badge variant={counts.unwatched ? 'info' : 'default'} className="ml-auto">+ {total > 999 ? '999+' : total}+ </Badge>+ )}+ </Button>)}@@ -156,7 +160,7 @@ function RowSkeletons({ count }: { count: number }): JSX.Element {return (<div className="flex flex-col gap-1 p-2">{Array.from({ length: count }, (_, i) => (- <LemonSkeleton key={i} className="h-7" />+ <Skeleton key={i} className="h-7" />))}</div>)diff --git a/frontend/src/scenes/session-recordings/playlist/ReplayListColumn.tsx b/frontend/src/scenes/session-recordings/playlist/ReplayListColumn.tsxindex 01027d20922c..c685f62f7cc4 100644--- a/frontend/src/scenes/session-recordings/playlist/ReplayListColumn.tsx+++ b/frontend/src/scenes/session-recordings/playlist/ReplayListColumn.tsx@@ -1,7 +1,7 @@import { useActions, useValues } from 'kea'import { ReactNode, useEffect } from 'react'-import { LemonBadge, LemonSegmentedButton } from '@posthog/lemon-ui'+import { Badge, Tabs, TabsList, TabsTrigger } from '@posthog/quill'import { ReplayCollectionsSegment } from './ReplayCollectionsSegment'import { ReplayListPicksMode, ReplayListSegment, replayListColumnLogic } from './replayListColumnLogic'@@ -35,49 +35,55 @@ export function ReplayListColumn({settleSegment(picksMode)}, [picksMode, settleSegment])- const options = [+ const options: { value: ReplayListSegment; label: ReactNode; dataAttr: string }[] = [...(picksList? [{value: 'picks' as const,label: (- <span className="flex items-center gap-1">- <span>Highlights</span>- {unwatchedPicksCount > 0 && (- <LemonBadge.Number count={unwatchedPicksCount} size="small" status="muted" />- )}- </span>+ <>+ Highlights+ {unwatchedPicksCount > 0 && <Badge>{unwatchedPicksCount}</Badge>}+ </>),- 'data-attr': 'list-segment-picks',+ dataAttr: 'list-segment-picks',},]: []),- {- value: 'recordings' as const,- label: 'All recordings',- 'data-attr': 'list-segment-recordings',- },+ { value: 'recordings' as const, label: 'All recordings', dataAttr: 'list-segment-recordings' },...(collections- ? [{ value: 'collections' as const, label: 'Collections', 'data-attr': 'list-segment-collections' }]+ ? [{ value: 'collections' as const, label: 'Collections', dataAttr: 'list-segment-collections' }]: []),]return (<div className="flex flex-col h-full min-h-0">{options.length > 1 && (- <LemonSegmentedButton- size="small"- fullWidth- className="mb-2"+ <Tabs+ data-quillvalue={segment}- onChange={(next: ReplayListSegment) => {+ onValueChange={(value) => {+ const next = value as ReplayListSegmentsetSegment(next)if ((next === 'picks') !== (segment === 'picks')) {onPicksSelected?.(next === 'picks')}}}- options={options}- />+ className="mb-2 shrink-0"+ >+ <TabsList className="w-full">+ {options.map((option) => (+ <TabsTrigger+ key={option.value}+ value={option.value}+ className="text-xs"+ data-attr={option.dataAttr}+ >+ {option.label}+ </TabsTrigger>+ ))}+ </TabsList>+ </Tabs>)}<div className="flex flex-col flex-1 min-h-0">{segment === 'picks' ? (