📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Update for consistency
Blue Mousee8df3156a137
diff --git a/web/app/pages/Project/tabs/Replays/Replays.tsx b/web/app/pages/Project/tabs/Replays/Replays.tsxindex e564f0be2..e45446ccc 100644--- a/web/app/pages/Project/tabs/Replays/Replays.tsx+++ b/web/app/pages/Project/tabs/Replays/Replays.tsx@@ -9,9 +9,8 @@ import {CursorClickIcon,FileTextIcon,ListBulletsIcon,- MonitorPlayIcon,- PlayIcon,UserIcon,+ VideoCameraIcon,WarningIcon,} from '@phosphor-icons/react'import { useMemo } from 'react'@@ -19,8 +18,10 @@ import { useTranslation } from 'react-i18next'import { useLocation } from 'react-router'import type { SessionReplayListItem } from '~/api/api.server'+import { Badge } from '~/ui/Badge'import Flag from '~/ui/Flag'import Button from '~/ui/Button'+import { Link } from '~/ui/Link'import { Text } from '~/ui/Text'import Tooltip from '~/ui/Tooltip'import { BrowserIcon, OSIcon } from '~/pages/Project/tabs/SharedIcons'@@ -50,7 +51,6 @@ interface ReplaysProps {timeFormat: '12-hour' | '24-hour'timezone: stringcurrency?: string- onWatchReplay: (replay: SessionReplayListItem) => void}interface ReplayRowProps extends Omit<ReplaysProps, 'replays'> {@@ -83,7 +83,6 @@ const ReplayRow = ({timeFormat,timezone,currency,- onWatchReplay,}: ReplayRowProps) => {const {t,@@ -125,6 +124,24 @@ const ReplayRow = ({if (!replay.replayDuration || replay.replayDuration <= 0) return nullreturn getStringFromTime(getTimeFromSeconds(replay.replayDuration))}, [replay.replayDuration])+ const dateLineString = useMemo(() => {+ if (!replayStartedAt) return durationString++ const durationDisplay = durationString ? ` • ${durationString}` : ''++ return (+ <span className='flex items-center'>+ {replayStartedAt}+ {durationDisplay}+ </span>+ )+ }, [durationString, replayStartedAt])++ const replayParams = new URLSearchParams(location.search)+ replayParams.set('tab', PROJECT_TABS.replays)+ replayParams.set('psid', replay.psid)+ replayParams.set('replayId', replay.replayId)+ replayParams.delete('profileId')const sessionParams = new URLSearchParams(location.search)sessionParams.set('tab', PROJECT_TABS.sessions)@@ -142,229 +159,229 @@ const ReplayRow = ({return (<li className='mb-2'>- <div className='relative flex items-center justify-between gap-x-4 overflow-hidden rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 transition-colors hover:bg-gray-200/70 sm:px-5 dark:border-slate-800/60 dark:bg-slate-900/25 dark:hover:bg-slate-900/60'>- <div className='flex min-w-0 flex-1 items-center gap-x-3.5'>- <div className='relative shrink-0'>- {replay.profileId ? (- <ProfileAvatar profileId={replay.profileId} size={32} />- ) : (- <div className='flex h-8 w-8 items-center justify-center rounded-full bg-gray-100 ring-1 ring-gray-200/50 dark:bg-slate-800 dark:ring-slate-700/50'>- <Text size='xs' weight='medium' colour='secondary'>- ?- </Text>- </div>- )}- </div>-- <div className='flex min-w-0 flex-1 flex-col justify-center gap-2'>- <div className='flex flex-wrap items-start justify-between gap-2 sm:gap-4'>- <div className='flex min-w-0 items-center gap-2'>- <Text size='sm' weight='semibold' truncate>- {displayName}- </Text>- <Text- as='span'- size='xs'- weight='medium'- colour='secondary'- className='hidden items-center gap-1 sm:flex'- >- <MonitorPlayIcon className='size-3.5' />- {durationString || t('project.sessionReplay.replay')}- </Text>- </div>-- <div className='mt-0.5 flex shrink-0 items-center sm:hidden'>- <Text size='xs' colour='secondary' className='text-[11px]'>- {replayStartedAt}- </Text>- </div>+ <div className='relative flex items-center overflow-hidden rounded-lg border border-gray-200 bg-gray-50 transition-colors hover:bg-gray-200/70 dark:border-slate-800/60 dark:bg-slate-900/25 dark:hover:bg-slate-900/60'>+ <Link+ to={{ search: replayParams.toString() }}+ className='flex min-w-0 flex-1 cursor-pointer items-center justify-between gap-x-4 rounded-lg px-4 py-3 outline-none focus-visible:ring-2 focus-visible:ring-slate-900 focus-visible:ring-inset sm:px-5 dark:focus-visible:ring-slate-300'+ >+ <div className='flex min-w-0 flex-1 items-center gap-x-3.5'>+ <div className='relative shrink-0'>+ {replay.profileId ? (+ <ProfileAvatar profileId={replay.profileId} size={32} />+ ) : (+ <div className='flex h-8 w-8 items-center justify-center rounded-full bg-gray-100 ring-1 ring-gray-200/50 dark:bg-slate-800 dark:ring-slate-700/50'>+ <Text size='xs' weight='medium' colour='secondary'>+ ?+ </Text>+ </div>+ )}</div>- <div className='flex items-center justify-between gap-4'>- <div className='flex flex-wrap items-center gap-x-3 gap-y-2'>- <div className='flex items-center gap-1.5'>- <Tooltip- text={- replay.cc- ? countries.getName(replay.cc, language) || replay.cc- : t('project.unknownCountry')- }- tooltipNode={- <div className='flex h-[22px] w-[22px] items-center justify-center rounded bg-gray-100/80 ring-1 ring-gray-200/50 dark:bg-slate-800/80 dark:ring-slate-700/50'>- <Flag- country={replay.cc}- size={14}- className='rounded-[2px]'- aria-hidden='true'- />- </div>- }- />- <Tooltip- text={replay.os || t('project.unknown')}- tooltipNode={- <div className='flex h-[22px] w-[22px] items-center justify-center rounded bg-gray-100/80 ring-1 ring-gray-200/50 dark:bg-slate-800/80 dark:ring-slate-700/50'>- <OSIcon- os={replay.os}- theme={theme}- className='size-3.5'- />- </div>- }- />- <Tooltip- text={replay.br || t('project.unknown')}- tooltipNode={- <div className='flex h-[22px] w-[22px] items-center justify-center rounded bg-gray-100/80 ring-1 ring-gray-200/50 dark:bg-slate-800/80 dark:ring-slate-700/50'>- <BrowserIcon browser={replay.br} className='size-3.5' />- </div>- }- />+ <div className='flex min-w-0 flex-1 flex-col justify-center gap-2'>+ <div className='flex flex-wrap items-start justify-between gap-2 sm:gap-4'>+ <div className='flex min-w-0 items-center gap-2'>+ <Text size='sm' weight='semibold' truncate>+ {displayName}+ </Text>+ {Boolean(replay.isIdentified) && (+ <Badge+ label={t('project.identified')}+ colour='indigo'+ className='text-[0.625rem] leading-3'+ />+ )}</div>- <div className='h-3 w-px bg-gray-200 dark:bg-slate-700' />-- <div className='flex items-center gap-3'>- <Tooltip- text={t('project.sessionReplay.eventsCount', {- count: replay.eventCount,- })}- tooltipNode={- <Text- as='span'- size='xs'- colour='secondary'- weight='medium'- className='flex items-center gap-1'- >- <MonitorPlayIcon className='size-3.5' />- {replay.eventCount}- </Text>- }- />-- <Tooltip- text={t('dashboard.pageviews')}- tooltipNode={- <Text- as='span'- size='xs'- colour='secondary'- weight='medium'- className='flex items-center gap-1'- >- <FileTextIcon className='size-3.5' />- {replay.pageviews}- </Text>- }- />+ <div className='mt-0.5 flex shrink-0 items-center sm:hidden'>+ <Text size='xs' colour='secondary' className='text-[11px]'>+ {dateLineString}+ </Text>+ </div>+ </div>- {replay.customEvents > 0 ? (+ <div className='flex items-center justify-between gap-4'>+ <div className='flex flex-wrap items-center gap-x-3 gap-y-2'>+ <div className='flex items-center gap-1.5'><Tooltip- text={t('dashboard.events')}+ text={+ replay.cc+ ? countries.getName(replay.cc, language) || replay.cc+ : t('project.unknownCountry')+ }tooltipNode={- <Text- as='span'- size='xs'- colour='secondary'- weight='medium'- className='flex items-center gap-1'- >- <CursorClickIcon className='size-3.5' />- {replay.customEvents}- </Text>+ <div className='flex h-[22px] w-[22px] items-center justify-center rounded bg-gray-100/80 ring-1 ring-gray-200/50 dark:bg-slate-800/80 dark:ring-slate-700/50'>+ <Flag+ country={replay.cc}+ size={14}+ className='rounded-[2px]'+ aria-hidden='true'+ />+ </div>}/>- ) : null}+ <Tooltip+ text={replay.os || t('project.unknown')}+ tooltipNode={+ <div className='flex h-[22px] w-[22px] items-center justify-center rounded bg-gray-100/80 ring-1 ring-gray-200/50 dark:bg-slate-800/80 dark:ring-slate-700/50'>+ <OSIcon+ os={replay.os}+ theme={theme}+ className='size-3.5'+ />+ </div>+ }+ />+ <Tooltip+ text={replay.br || t('project.unknown')}+ tooltipNode={+ <div className='flex h-[22px] w-[22px] items-center justify-center rounded bg-gray-100/80 ring-1 ring-gray-200/50 dark:bg-slate-800/80 dark:ring-slate-700/50'>+ <BrowserIcon+ browser={replay.br}+ className='size-3.5'+ />+ </div>+ }+ />+ </div>++ <div className='h-3 w-px bg-gray-200 dark:bg-slate-700' />- {replay.revenue != null && replay.revenue !== 0 ? (+ <div className='flex items-center gap-3'><Tooltip- text={t('dashboard.revenue')}+ text={t('project.sessionReplay.eventsCount', {+ count: replay.eventCount,+ })}tooltipNode={<Textas='span'size='xs'+ colour='secondary'weight='medium'- colour='inherit'- className={cx('flex items-center gap-1', {- 'text-emerald-600 dark:text-emerald-500':- replay.revenue > 0,- 'text-amber-600 dark:text-amber-500':- replay.revenue < 0,- })}+ className='flex items-center gap-1'>- {replay.revenue < 0 ? '-' : ''}- {currencySymbol}- {Math.abs(replay.revenue).toFixed(2)}+ <VideoCameraIcon className='size-3.5' />+ {replay.eventCount}</Text>}/>- ) : null}- {replay.errors > 0 ? (<Tooltip- text={t('dashboard.errors')}+ text={t('dashboard.pageviews')}tooltipNode={<Textas='span'size='xs'- colour='error'+ colour='secondary'weight='medium'className='flex items-center gap-1'>- <WarningIcon className='size-3.5' />- {replay.errors}+ <FileTextIcon className='size-3.5' />+ {replay.pageviews}</Text>}/>++ {replay.customEvents > 0 ? (+ <Tooltip+ text={t('dashboard.events')}+ tooltipNode={+ <Text+ as='span'+ size='xs'+ colour='secondary'+ weight='medium'+ className='flex items-center gap-1'+ >+ <CursorClickIcon className='size-3.5' />+ {replay.customEvents}+ </Text>+ }+ />+ ) : null}++ {replay.revenue != null && replay.revenue !== 0 ? (+ <Tooltip+ text={t('dashboard.revenue')}+ tooltipNode={+ <Text+ as='span'+ size='xs'+ weight='medium'+ colour='inherit'+ className={cx('flex items-center gap-1', {+ 'text-emerald-600 dark:text-emerald-500':+ replay.revenue > 0,+ 'text-amber-600 dark:text-amber-500':+ replay.revenue < 0,+ })}+ >+ {replay.revenue < 0 ? '-' : ''}+ {currencySymbol}+ {Math.abs(replay.revenue).toFixed(2)}+ </Text>+ }+ />+ ) : null}++ {replay.errors > 0 ? (+ <Tooltip+ text={t('dashboard.errors')}+ tooltipNode={+ <Text+ as='span'+ size='xs'+ colour='error'+ weight='medium'+ className='flex items-center gap-1'+ >+ <WarningIcon className='size-3.5' />+ {replay.errors}+ </Text>+ }+ />+ ) : null}+ </div>++ {replayExpiresAt ? (+ <>+ <div className='hidden h-3 w-px bg-gray-200 sm:block dark:bg-slate-700' />+ <Text+ as='span'+ size='xs'+ colour='secondary'+ className='hidden sm:inline'+ >+ {t('project.sessionReplay.expiresAt', {+ date: replayExpiresAt,+ })}+ </Text>+ </>) : null}</div>-- {replayExpiresAt ? (- <>- <div className='hidden h-3 w-px bg-gray-200 sm:block dark:bg-slate-700' />- <Text- as='span'- size='xs'- colour='secondary'- className='hidden sm:inline'- >- {t('project.sessionReplay.expiresAt', {- date: replayExpiresAt,- })}- </Text>- </>- ) : null}</div></div></div>- </div>- <div className='hidden shrink-0 items-center gap-x-2 sm:flex'>- <div className='mr-1 flex flex-col items-end'>- <Text as='p' size='xs' colour='secondary' className='text-[11px]'>- {replayStartedAt}- </Text>- {durationString ? (+ <div className='hidden shrink-0 items-center gap-x-3 sm:flex'>+ <div className='flex flex-col items-end'><Text as='p' size='xs' colour='secondary' className='text-[11px]'>- {durationString}+ {dateLineString}</Text>- ) : null}+ </div>+ <CaretRightIcon+ className='size-4 text-gray-400'+ aria-hidden='true'+ /></div>- <Tooltip- text={t('project.watchReplay')}- tooltipNode={- <Button- variant='icon'- aria-label={t('project.watchReplay')}- className='active:scale-[0.97]'- onClick={() => onWatchReplay(replay)}- >- <PlayIcon className='size-4' />- </Button>- }- />+ <div className='flex shrink-0 items-center sm:hidden'>+ <CaretRightIcon+ className='size-4 text-gray-400'+ aria-hidden='true'+ />+ </div>+ </Link>++ <div className='hidden shrink-0 items-center gap-x-2 pr-3 sm:flex'><Tooltiptext={t('project.viewSession')}tooltipNode={@@ -372,7 +389,6 @@ const ReplayRow = ({variant='icon'aria-label={t('project.viewSession')}to={{ search: sessionParams.toString() }}- className='active:scale-[0.97]'><ListBulletsIcon className='size-4' /></Button>@@ -386,30 +402,19 @@ const ReplayRow = ({variant='icon'aria-label={t('project.goToProfile')}to={{ search: profileParams.toString() }}- className='active:scale-[0.97]'><UserIcon className='size-4' /></Button>}/>) : null}- <CaretRightIcon className='size-4 text-gray-400' aria-hidden='true' /></div>- <div className='flex shrink-0 items-center gap-1 sm:hidden'>- <Button- variant='icon'- aria-label={t('project.watchReplay')}- className='active:scale-[0.97]'- onClick={() => onWatchReplay(replay)}- >- <PlayIcon className='size-4' />- </Button>+ <div className='flex shrink-0 items-center gap-1 pr-2 sm:hidden'><Buttonvariant='icon'aria-label={t('project.viewSession')}to={{ search: sessionParams.toString() }}- className='active:scale-[0.97]'><ListBulletsIcon className='size-4' /></Button>@@ -424,7 +429,6 @@ export const Replays = ({timeFormat,timezone,currency,- onWatchReplay,}: ReplaysProps) => {return (<ul className='flex flex-col'>@@ -435,7 +439,6 @@ export const Replays = ({timeFormat={timeFormat}timezone={timezone}currency={currency}- onWatchReplay={onWatchReplay}/>))}</ul>diff --git a/web/app/pages/Project/tabs/Replays/ReplaysView.tsx b/web/app/pages/Project/tabs/Replays/ReplaysView.tsxindex 154754ec9..e498d3bfc 100644--- a/web/app/pages/Project/tabs/Replays/ReplaysView.tsx+++ b/web/app/pages/Project/tabs/Replays/ReplaysView.tsx@@ -283,13 +283,6 @@ const ReplaysViewInner = ({// eslint-disable-next-line react-hooks/exhaustive-deps}, [replaysRefreshTrigger])- const openReplay = (replay: SessionReplayListItem) => {- const params = new URLSearchParams(searchParams)- params.set('psid', replay.psid)- params.set('replayId', replay.replayId)- setSearchParams(params)- }-const closeReplay = () => {const params = new URLSearchParams(searchParams)params.delete('psid')@@ -334,7 +327,6 @@ const ReplaysViewInner = ({timeFormat={timeFormat}timezone={timezone}currency={project?.revenueCurrency}- onWatchReplay={openReplay}/><InfiniteScrollTriggerhasMore={canLoadMoreReplays}