: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): quill twins for the highlights list in the watch layouts (#128359)
Hayne Ryu2fbed112bc64
diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPickRow.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPickRow.tsxindex 196e77f23dae..39fcfdeffa53 100644--- a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPickRow.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPickRow.tsx@@ -45,7 +45,12 @@ export function QuillHighlightPickRow({ item, position, isActive, rank }: QuillH/>}>- <span className={cn('flex w-full min-w-0 items-center gap-3 py-1', observation.viewed && 'opacity-60')}>+ <span+ className={cn(+ 'flex w-full min-w-0 items-center gap-3 py-1 text-left',+ observation.viewed && 'opacity-60'+ )}+ ><span className="relative w-28 shrink-0"><ObservationThumbnailobservation={observation}@@ -53,7 +58,11 @@ export function QuillHighlightPickRow({ item, position, isActive, rank }: QuillHsize="small"retryKey={picksLoad?.feedLoadId}/>- {rank !== undefined && <HighlightPickRankBadge rank={rank} size="small" />}+ {rank !== undefined && (+ <span data-not-quill className="contents">+ <HighlightPickRankBadge rank={rank} size="small" />+ </span>+ )}{!observation.viewed && (<span className="absolute inset-y-0 left-0 w-1 rounded-l bg-primary" aria-hidden />)}diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksEmptyState.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksEmptyState.tsxnew file mode 100644index 000000000000..cdeff10fd83f--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksEmptyState.tsx@@ -0,0 +1,77 @@+import { useActions, useMountedLogic, useValues } from 'kea'+import { useEffect } from 'react'++import { Skeleton } from '@posthog/quill'++import { cn } from 'lib/utils/css-classes'++import { replayRecordingsLogic } from '../../logics/replayRecordingsLogic'+import { visionQuotaLogic } from '../../logics/visionQuotaLogic'+import { visionScannersListLogic } from '../../logics/visionScannersListLogic'+import { resolveHighlightFeedEmptyReason } from '../highlightFeedEmptyState'+import { highlightPicksLogic } from '../highlightPicksLogic'+import { HighlightPicksBlockedState } from './HighlightPicksBlockedState'+import { HighlightPicksShadowPreview } from './HighlightPicksShadowPreview'+import { QuillHighlightPicksNoRecordingsState } from './QuillHighlightPicksNoRecordingsState'+import { QuillHighlightPicksQuietState } from './QuillHighlightPicksQuietState'+import { QuillHighlightPicksReplayOffState } from './QuillHighlightPicksReplayOffState'+import { QuillHighlightPicksStarter } from './QuillHighlightPicksStarter'++export function QuillHighlightPicksEmptyState({ size }: { size: 'small' | 'large' }): JSX.Element {+ const { scanners, scannersLoading } = useValues(visionScannersListLogic)+ const { quota, quotaLoading } = useValues(visionQuotaLogic)+ const { recordingsBlock, hasRecentRecordingsLoading } = useValues(replayRecordingsLogic)+ const picksLogic = useMountedLogic(highlightPicksLogic)+ const { emptyStateShown } = useActions(picksLogic)+ const large = size === 'large'+ // Waits for the probe, so the empty state is not reported once as quiet and again as no recordings.+ const loading = scannersLoading || quotaLoading || hasRecentRecordingsLoading++ const reason = loading+ ? null+ : resolveHighlightFeedEmptyReason({+ scanners,+ quota,+ recordingsBlock,+ hasFeedFilters: false,+ })++ useEffect(() => {+ if (reason) {+ emptyStateShown(reason)+ }+ }, [reason, emptyStateShown])++ if (!reason) {+ return <Skeleton className={cn('w-full rounded', large ? 'h-64' : 'h-40')} />+ }+ if (reason === 'replay-off') {+ return <QuillHighlightPicksReplayOffState size={size} />+ }+ if (reason === 'no-recordings') {+ return (+ <>+ <QuillHighlightPicksNoRecordingsState size={size} />+ <HighlightPicksShadowPreview />+ </>+ )+ }+ if (reason === 'no-scanners') {+ return (+ <>+ <QuillHighlightPicksStarter size={size} />+ <HighlightPicksShadowPreview />+ </>+ )+ }+ if (reason === 'all-disabled' || reason === 'all-capped' || reason === 'quota-exhausted') {+ return <HighlightPicksBlockedState reason={reason} size={size} />+ }++ return (+ <>+ <QuillHighlightPicksQuietState size={size} />+ <HighlightPicksShadowPreview />+ </>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksList.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksList.tsxindex 8a2def2832ca..74f3d5807e8c 100644--- a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksList.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksList.tsx@@ -7,10 +7,10 @@ import { LinkPrimitive } from 'lib/lemon-ui/Link'import { visionDocsUrl } from '../../components/DocsLink'import { highlightPicksLogic } from '../highlightPicksLogic'import { highlightPicksStarterLogic } from '../highlightPicksStarterLogic'-import { HighlightPicksEmptyState } from './HighlightPicksEmptyState'import { HighlightPicksScanningState } from './HighlightPicksScanningState'import { HighlightPicksStarterStatus } from './HighlightPicksStarterStatus'import { QuillHighlightPickRow } from './QuillHighlightPickRow'+import { QuillHighlightPicksEmptyState } from './QuillHighlightPicksEmptyState'import { QuillHighlightPicksExtraRows } from './QuillHighlightPicksExtraRows'import { QuillHighlightPicksStaleBanner } from './QuillHighlightPicksStaleBanner'@@ -63,7 +63,7 @@ export function QuillHighlightPicksList(): JSX.Element {<QuillHighlightPicksExtraRows /></>) : (- <HighlightPicksEmptyState size="small" />+ <QuillHighlightPicksEmptyState size="small" />)) : (<>diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksNoRecordingsState.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksNoRecordingsState.tsxnew file mode 100644index 000000000000..ca86f26500e3--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksNoRecordingsState.tsx@@ -0,0 +1,59 @@+import { useActions, useMountedLogic } from 'kea'++import * as directorPng from '@posthog/brand/hoggies/png/director'+import { Button } from '@posthog/quill'++import { pngHoggie } from 'lib/brand/hoggies'+import { LinkPrimitive } from 'lib/lemon-ui/Link'+import { urls } from 'scenes/urls'++import { ProductKey } from '~/queries/schema/schema-general'+import { OnboardingStepKey } from '~/types'++import { highlightPicksLogic } from '../highlightPicksLogic'+import { QuillHighlightPicksStateFrame } from './QuillHighlightPicksStateFrame'++const HedgehogDirector = pngHoggie(directorPng)++export function QuillHighlightPicksNoRecordingsState({ size }: { size: 'small' | 'large' }): JSX.Element {+ const { emptyStateAction } = useActions(useMountedLogic(highlightPicksLogic))+ return (+ <QuillHighlightPicksStateFrame+ size={size}+ image={HedgehogDirector}+ title="No recordings to scan yet"+ body="Scanners watch recordings, so there is nothing for them to see until sessions arrive. Highlights show up once recording starts."+ dataAttr="vision-highlight-picks-no-recordings"+ footer={+ <Button+ variant="link"+ size="inline"+ className="mt-1"+ render={<LinkPrimitive to="https://posthog.com/docs/session-replay" target="_blank" />}+ onClick={() => emptyStateAction('no-recordings', 'replay_docs')}+ data-attr="vision-highlight-picks-no-recordings-docs"+ >+ Session replay docs+ </Button>+ }+ >+ <Button+ variant="primary"+ size={size === 'large' ? 'default' : 'sm'}+ className="w-full"+ render={+ <LinkPrimitive+ to={urls.onboarding({+ productKey: ProductKey.SESSION_REPLAY,+ stepKey: OnboardingStepKey.INSTALL,+ })}+ />+ }+ onClick={() => emptyStateAction('no-recordings', 'setup_replay')}+ data-attr="vision-highlight-picks-no-recordings-setup"+ >+ Set up session replay+ </Button>+ </QuillHighlightPicksStateFrame>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksQuietState.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksQuietState.tsxnew file mode 100644index 000000000000..19ab3ac72aca--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksQuietState.tsx@@ -0,0 +1,151 @@+import { useActions, useMountedLogic, useValues } from 'kea'++import * as noirPng from '@posthog/brand/hoggies/png/noir-1'+import { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@posthog/quill'++import { pngHoggie } from 'lib/brand/hoggies'+import { TZLabel } from 'lib/components/TZLabel'+import { LinkPrimitive } from 'lib/lemon-ui/Link'+import { pluralize } from 'lib/utils/strings'+import { urls } from 'scenes/urls'++import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'+import { formatCreditCount } from '../../utils/credits'+import { highlightPicksLogic } from '../highlightPicksLogic'+import { highlightPicksStaleLogic } from '../highlightPicksStaleLogic'+import { weeklyVolume } from '../highlightPicksStarter'+import { highlightPicksStarterLogic } from '../highlightPicksStarterLogic'+import { highlightPicksVolumeLogic } from '../highlightPicksVolumeLogic'+import { SWEEP_INTERVAL_MINUTES } from '../scannerStatus'+import { QuillHighlightPicksStateFrame } from './QuillHighlightPicksStateFrame'+import { QuillHighlightPicksVolumeTiles } from './QuillHighlightPicksVolumeTiles'++const HedgehogNoir = pngHoggie(noirPng)+const SWEEP_STALE_MS = 60 * 60 * 1000++export function QuillHighlightPicksQuietState({ size }: { size: 'small' | 'large' }): JSX.Element {+ const picksLogic = useMountedLogic(highlightPicksLogic)+ const logic = highlightPicksStaleLogic(picksLogic.props)+ const {+ backfillCandidates,+ backfillScannerId,+ backfillEstimate,+ backfillEstimateLoading,+ backfillTotals,+ busyScannerId,+ lastSweptAt,+ } = useValues(logic)+ const { pickBackfillScanner, startBackfill } = useActions(logic)+ const { candidateRecordings } = useValues(highlightPicksStarterLogic(picksLogic.props))+ const { volumeEstimate, volumeEstimateLoading } = useValues(highlightPicksVolumeLogic)+ const large = size === 'large'+ const editDisabledReason = getReplayVisionEditDisabledReason()++ const volume = weeklyVolume(volumeEstimate, candidateRecordings)+ const sweepStale = !!lastSweptAt && Date.now() - new Date(lastSweptAt).getTime() > SWEEP_STALE_MS+ const started = backfillScannerId ? backfillTotals[backfillScannerId] : undefined+ const estimateReady = backfillEstimate?.scannerId === backfillScannerId ? backfillEstimate : null+ const scannerOptions = backfillCandidates.map((scanner) => ({ value: scanner.id, label: scanner.name }))++ return (+ <QuillHighlightPicksStateFrame+ size={size}+ image={HedgehogNoir}+ title="Nothing to watch yet"+ body={+ sweepStale ? (+ <>+ {pluralize(backfillCandidates.length, 'scanner')} running, but the last sweep was{' '}+ <TZLabel time={lastSweptAt} showPopover={false} noStyles />.+ </>+ ) : (+ <>+ {pluralize(backfillCandidates.length, 'scanner')} running+ {lastSweptAt && (+ <>+ , last sweep <TZLabel time={lastSweptAt} showPopover={false} noStyles />+ </>+ )}+ . New recordings are checked every {SWEEP_INTERVAL_MINUTES} minutes and picks appear here.+ </>+ )+ }+ dataAttr="vision-highlight-picks-quiet"+ footer={+ <Button+ variant="link"+ size="inline"+ className="mt-1"+ render={<LinkPrimitive to={urls.replayVision()} />}+ data-attr="vision-highlight-picks-empty-link"+ >+ Open Replay vision+ </Button>+ }+ >+ <QuillHighlightPicksVolumeTiles+ volume={volume}+ loading={volumeEstimateLoading}+ dataAttr="vision-highlight-picks-quiet-volume"+ />+ {backfillCandidates.length > 0 &&+ (started === undefined ? (+ <>+ {backfillCandidates.length > 1 && (+ <Select+ items={scannerOptions}+ value={backfillScannerId}+ onValueChange={(value: string | null) => pickBackfillScanner(value)}+ >+ <SelectTrigger+ size="sm"+ className="w-full"+ data-attr="vision-highlight-picks-quiet-scanner"+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {scannerOptions.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ <Button+ variant="primary"+ size={large ? 'default' : 'sm'}+ className="w-full"+ loading={busyScannerId === backfillScannerId}+ disabledReason={+ editDisabledReason ??+ (estimateReady && estimateReady.sessions === 0+ ? 'No recording in the last 7 days matches this scanner'+ : undefined)+ }+ onClick={() => backfillScannerId && startBackfill(backfillScannerId)}+ data-attr="vision-highlight-picks-quiet-backfill"+ >+ Scan the last 7 days now+ </Button>+ <span className="text-xs">+ {backfillEstimateLoading+ ? 'Counting matching recordings'+ : estimateReady+ ? `${pluralize(estimateReady.sessions, 'recording')}, about ${formatCreditCount(estimateReady.credits)}`+ : 'Could not count matching recordings'}+ </span>+ </>+ ) : started === 0 ? (+ <span className="text-xs">+ No recording in the last 7 days matched. New ones are still scanned.+ </span>+ ) : (+ <span className="text-xs">+ Scanning {pluralize(started, 'recording')}. Results land here as they finish.+ </span>+ ))}+ </QuillHighlightPicksStateFrame>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksReplayOffState.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksReplayOffState.tsxnew file mode 100644index 000000000000..9c10f327f392--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksReplayOffState.tsx@@ -0,0 +1,58 @@+import { useActions, useValues } from 'kea'++import * as directorPng from '@posthog/brand/hoggies/png/director'+import { Button } from '@posthog/quill'++import { pngHoggie } from 'lib/brand/hoggies'+import { RestrictionScope, useRestrictedArea } from 'lib/components/RestrictedArea'+import { TeamMembershipLevel } from 'lib/constants'+import { LinkPrimitive } from 'lib/lemon-ui/Link'+import { teamLogic } from 'scenes/teamLogic'+import { urls } from 'scenes/urls'++import { QuillHighlightPicksStateFrame } from './QuillHighlightPicksStateFrame'++const HedgehogDirector = pngHoggie(directorPng)++export function QuillHighlightPicksReplayOffState({ size }: { size: 'small' | 'large' }): JSX.Element {+ const { currentTeamLoading } = useValues(teamLogic)+ const { updateCurrentTeam } = useActions(teamLogic)+ // Same gate as the settings toggle that writes this field (`ReplayGeneral`).+ const restrictedReason = useRestrictedArea({+ scope: RestrictionScope.Project,+ minimumAccessLevel: TeamMembershipLevel.Admin,+ })++ return (+ <QuillHighlightPicksStateFrame+ size={size}+ image={HedgehogDirector}+ title="Session replay is off"+ body="Scanners watch recordings, so there is nothing for them to see until recording is on. Recordings you already have stay available."+ dataAttr="vision-highlight-picks-replay-off"+ footer={+ <Button+ variant="link"+ size="inline"+ className="mt-1"+ render={<LinkPrimitive to={urls.settings('environment-replay')} />}+ data-attr="vision-highlight-picks-replay-off-settings"+ >+ Replay settings+ </Button>+ }+ >+ <Button+ variant="primary"+ size={size === 'large' ? 'default' : 'sm'}+ className="w-full"+ loading={currentTeamLoading}+ disabledReason={restrictedReason ? 'Ask a project admin to turn on session replay' : undefined}+ onClick={() => updateCurrentTeam({ session_recording_opt_in: true })}+ data-attr="vision-highlight-picks-replay-off-enable"+ >+ Turn on session replay+ </Button>+ </QuillHighlightPicksStateFrame>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksStarter.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksStarter.tsxnew file mode 100644index 000000000000..6a1f9fc36bef--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksStarter.tsx@@ -0,0 +1,154 @@+import { useActions, useMountedLogic, useValues } from 'kea'++import * as magnifyingGlassPng from '@posthog/brand/hoggies/png/magnifying-glass'+import { Button, Item, ItemContent, ItemDescription, Skeleton, ToggleGroup, ToggleGroupItem } from '@posthog/quill'++import { pngHoggie } from 'lib/brand/hoggies'+import { LinkPrimitive } from 'lib/lemon-ui/Link'+import { pluralize } from 'lib/utils/strings'+import { urls } from 'scenes/urls'++import { visionQuotaLogic } from '../../logics/visionQuotaLogic'+import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'+import { formatCreditCount, formatCreditNumber, formatCreditsMaybeUsd } from '../../utils/credits'+import { highlightPicksLogic } from '../highlightPicksLogic'+import { BUDGET_PRESETS, TARGET_MONTHLY_SCANS, weeklyVolume } from '../highlightPicksStarter'+import { highlightPicksStarterLogic } from '../highlightPicksStarterLogic'+import { highlightPicksVolumeLogic } from '../highlightPicksVolumeLogic'+import { QuillHighlightPicksStateFrame } from './QuillHighlightPicksStateFrame'+import { QuillHighlightPicksVolumeTiles } from './QuillHighlightPicksVolumeTiles'++const SCANS_PER_DAY = Math.round(TARGET_MONTHLY_SCANS / 30)+const HedgehogMagnifyingGlass = pngHoggie(magnifyingGlassPng)++export function QuillHighlightPicksStarter({ size }: { size: 'small' | 'large' }): JSX.Element {+ const picksLogic = useMountedLogic(highlightPicksLogic)+ const { emptyStateAction } = useActions(picksLogic)+ const logic = highlightPicksStarterLogic(picksLogic.props)+ const { burstPlan, spendMode, freeAvailable, budget, starting, startError, freeCreditsLeft, candidateRecordings } =+ useValues(logic)+ const { setBudget, chooseBudget, startScanner } = useActions(logic)+ const { volumeEstimate, volumeEstimateLoading } = useValues(highlightPicksVolumeLogic)+ const { showUsd } = useValues(visionQuotaLogic)+ const large = size === 'large'+ const editDisabledReason = getReplayVisionEditDisabledReason()++ const volume = weeklyVolume(volumeEstimate, candidateRecordings)+ const loading = volumeEstimateLoading && !volume+ const burstCount = burstPlan.sessionIds.length+ const costLine =+ spendMode === 'free'+ ? `Free credits only${freeCreditsLeft !== null ? `, ${formatCreditCount(freeCreditsLeft)} left` : ''}. Stops by itself at the limit.`+ : freeAvailable+ ? 'A monthly budget you set. Free credits are used first.'+ : 'Free credits are used up, so this scanner needs a monthly limit.'++ return (+ <QuillHighlightPicksStateFrame+ size={size}+ image={HedgehogMagnifyingGlass}+ title={+ loading ? (+ <Skeleton className="h-5 w-48" />+ ) : volume ? (+ 'Your week in recordings'+ ) : (+ 'Nothing to watch yet'+ )+ }+ body={+ volume || loading+ ? null+ : 'Start scanning your sessions. A scanner reads new recordings and surfaces the ones worth watching.'+ }+ dataAttr="vision-highlight-picks-starter"+ footer={+ <div className="mt-1 flex flex-wrap items-baseline justify-center gap-x-3 gap-y-1">+ {freeAvailable && (+ <Button+ size="xs"+ disabledReason={starting ? 'Starting' : undefined}+ onClick={() => {+ emptyStateAction('no-scanners', spendMode === 'free' ? 'set_budget' : 'use_free')+ chooseBudget(spendMode === 'free')+ }}+ data-attr="vision-highlight-picks-starter-toggle-budget"+ >+ {spendMode === 'free' ? 'Set a monthly budget instead' : 'Use free credits instead'}+ </Button>+ )}+ <Button+ variant="link"+ size="inline"+ render={<LinkPrimitive to={urls.replayVisionNewScanner()} />}+ onClick={() => emptyStateAction('no-scanners', 'own_goal')}+ data-attr="vision-highlight-picks-starter-own-goal"+ >+ Write my own goal+ </Button>+ </div>+ }+ >+ <QuillHighlightPicksVolumeTiles+ volume={volume}+ loading={loading}+ dataAttr="vision-highlight-picks-starter-volume"+ />+ {volume && (+ <span className="text-xs text-muted-foreground">+ {burstCount > 0+ ? `A scanner reads the newest ${burstCount} now and hands you the few worth opening.`+ : 'A scanner reads new recordings and hands you the few worth opening.'}+ </span>+ )}+ {spendMode === 'budget' && (+ <>+ <ToggleGroup+ variant="outline"+ size="sm"+ className="w-full"+ value={[String(budget)]}+ onValueChange={(value: string[]) => value[0] && setBudget(Number(value[0]))}+ >+ {BUDGET_PRESETS.map((preset) => (+ <ToggleGroupItem+ key={preset}+ value={String(preset)}+ className="flex-1"+ data-attr="vision-highlight-picks-starter-budget"+ >+ {formatCreditNumber(preset)}+ </ToggleGroupItem>+ ))}+ </ToggleGroup>+ <span className="text-xs">{formatCreditsMaybeUsd(budget, showUsd)} a month</span>+ </>+ )}+ {startError && (+ <Item variant="outline" tone="destructive">+ <ItemContent>+ <ItemDescription>{startError}</ItemDescription>+ </ItemContent>+ </Item>+ )}+ <Button+ variant="primary"+ size={large ? 'default' : 'sm'}+ className="w-full"+ loading={starting}+ disabledReason={editDisabledReason}+ onClick={startScanner}+ data-attr="vision-highlight-picks-starter-start"+ >+ {spendMode === 'free'+ ? burstCount > 0+ ? `Scan ${pluralize(burstCount, 'recent recording')} for free`+ : 'Start free scanner'+ : `Start with ${formatCreditCount(budget)} a month`}+ </Button>+ <span className="text-xxs text-muted-foreground">+ Then about {SCANS_PER_DAY} new recordings a day. {costLine}+ </span>+ </QuillHighlightPicksStateFrame>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksStateFrame.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksStateFrame.tsxnew file mode 100644index 000000000000..5f3c966bb62c--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksStateFrame.tsx@@ -0,0 +1,41 @@+import { ComponentType, ReactNode } from 'react'++import { cn } from 'lib/utils/css-classes'++interface QuillHighlightPicksStateFrameProps {+ size: 'small' | 'large'+ image: ComponentType<{ className?: string }>+ title: ReactNode+ body: ReactNode+ children?: ReactNode+ footer?: ReactNode+ dataAttr: string+}++export function QuillHighlightPicksStateFrame({+ size,+ image: Image,+ title,+ body,+ children,+ footer,+ dataAttr,+}: QuillHighlightPicksStateFrameProps): JSX.Element {+ const large = size === 'large'+ return (+ <div+ data-quill+ className={cn(+ 'flex flex-col items-center gap-2 text-center text-muted-foreground',+ large ? 'rounded border border-border bg-background p-8 text-sm' : 'p-4 text-xs'+ )}+ data-attr={dataAttr}+ >+ <Image className={large ? 'h-48 w-48' : 'h-24 w-24'} />+ <span className={cn('font-semibold text-foreground', large ? 'text-lg' : 'text-sm')}>{title}</span>+ <span className="max-w-lg">{body}</span>+ {children && <div className="mt-1 flex w-full max-w-xs flex-col items-stretch gap-2">{children}</div>}+ {footer}+ </div>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksVolumeTiles.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksVolumeTiles.tsxnew file mode 100644index 000000000000..bc3ddef04741--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/QuillHighlightPicksVolumeTiles.tsx@@ -0,0 +1,39 @@+import { Skeleton } from '@posthog/quill'++import type { WeeklyVolume } from '../highlightPicksStarter'++function hoursLabel(hours: number): string {+ return hours < 1 ? `${Math.max(1, Math.round(hours * 60))}m` : `${Math.round(hours)}h`+}++export function QuillHighlightPicksVolumeTiles({+ volume,+ loading,+ dataAttr,+}: {+ volume: WeeklyVolume | null+ loading: boolean+ dataAttr: string+}): JSX.Element | null {+ if (!volume) {+ return loading ? <Skeleton className="h-16 w-full rounded" /> : null+ }+ const tiles: [string, string, string][] = [+ ['Recorded', String(volume.recorded), 'a week, estimated'],+ ['To watch', volume.hours === null ? '-' : hoursLabel(volume.hours), 'at normal speed'],+ ]+ return (+ <div className="grid grid-cols-2 gap-1.5" data-attr={dataAttr}>+ {tiles.map(([label, value, caption]) => (+ <div+ key={label}+ className="flex flex-col items-center gap-0.5 rounded border border-border bg-background px-1 py-2 text-center"+ >+ <span className="text-xxs font-bold uppercase tracking-wide text-muted-foreground">{label}</span>+ <span className="text-xl font-bold leading-tight text-foreground">{value}</span>+ <span className="text-xxs text-muted-foreground">{caption}</span>+ </div>+ ))}+ </div>+ )+}