From 80d02254aecb5b42762781281bac41a012d3224d Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Tue, 4 Aug 2026 11:20:17 -0700 Subject: [PATCH] Fix session profile replays for mobile layout --- .../replays/[replayId]/ReplayPlayback.tsx | 17 ++++++++++++----- .../[websiteId]/sessions/SessionModal.tsx | 5 +++-- .../[websiteId]/sessions/SessionProfile.tsx | 6 +++--- .../sessions/SessionReplaysDataTable.tsx | 17 ++++++++++++++--- src/app/global.css | 18 +++++++++++++++++- 5 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayback.tsx b/src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayback.tsx index 2006011da..54d8e560a 100644 --- a/src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayback.tsx +++ b/src/app/(main)/websites/[websiteId]/replays/[replayId]/ReplayPlayback.tsx @@ -7,6 +7,7 @@ import { Avatar } from '@/components/common/Avatar'; import { LoadingPanel } from '@/components/common/LoadingPanel'; import { useMessages, + useMobile, useReplayQuery, useReplaySavedQuery, useUpdateQuery, @@ -36,6 +37,7 @@ export function ReplayPlayback({ const { data: replaySaved } = useReplaySavedQuery(websiteId, replayId); const { data: session } = useWebsiteSessionQuery(websiteId, replay?.sessionId); const { t, labels } = useMessages(); + const { isMobile } = useMobile(); const [isSaved, setIsSaved] = useState(null); const { mutate } = useUpdateQuery(`/websites/${websiteId}/replays/saved/${replayId}`); const replayViewport = useMemo(() => getReplayViewport(replay?.events), [replay?.events]); @@ -67,19 +69,24 @@ export function ReplayPlayback({ style={{ minHeight: '400px' }} > {replay && ( - + {session && ( - - + + - + {t(labels.replay)} {replay.eventCount} {t(labels.actions).toLowerCase()} - + {saved ? ( )} - + {showReplays && ( - + )} diff --git a/src/app/(main)/websites/[websiteId]/sessions/SessionReplaysDataTable.tsx b/src/app/(main)/websites/[websiteId]/sessions/SessionReplaysDataTable.tsx index 9ff3ec43f..6e8989fbf 100644 --- a/src/app/(main)/websites/[websiteId]/sessions/SessionReplaysDataTable.tsx +++ b/src/app/(main)/websites/[websiteId]/sessions/SessionReplaysDataTable.tsx @@ -2,7 +2,7 @@ import { Column } from '@umami/react-zen'; import { useState } from 'react'; import { DataGrid } from '@/components/common/DataGrid'; -import { useSessionReplaysQuery } from '@/components/hooks'; +import { useMobile, useSessionReplaysQuery } from '@/components/hooks'; import { ReplayPlayback } from '../replays/[replayId]/ReplayPlayback'; import { SessionReplaysTable } from './SessionReplaysTable'; @@ -10,13 +10,22 @@ function InlinePlayer({ websiteId, replayId, onClose, + isMobile, }: { websiteId: string; replayId: string; onClose: () => void; + isMobile: boolean; }) { return ( -
+
(); @@ -42,12 +52,13 @@ export function SessionReplaysDataTable({ }; return ( - + {selectedId && ( setSelectedId(undefined)} + isMobile={isMobile} /> )} diff --git a/src/app/global.css b/src/app/global.css index 93df698bf..ef8ce56bd 100644 --- a/src/app/global.css +++ b/src/app/global.css @@ -86,6 +86,7 @@ select:is(:-webkit-autofill, :autofill):focus { height: auto !important; padding: 8px 0 10px; gap: 8px; + overflow: hidden; } .rr-timeline { @@ -95,7 +96,7 @@ select:is(:-webkit-autofill, :autofill):focus { .rr-timeline__time { width: auto !important; - min-width: 52px; + min-width: 44px; font-size: 12px; } @@ -105,8 +106,23 @@ select:is(:-webkit-autofill, :autofill):focus { .rr-controller__btns { width: calc(100% - 24px); + box-sizing: border-box; flex-wrap: wrap; justify-content: center; + column-gap: 6px; row-gap: 8px; + font-size: 12px; + overflow: hidden; + } + + .rr-controller__btns button { + width: 28px; + height: 28px; + flex: 0 0 28px; + } + + .rr-controller__btns .label { + margin: 0 4px; + font-size: 12px; } }