From 56d2f43266341b2d85217aa6c78a5550178e10cc Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Tue, 4 Aug 2026 09:01:59 -0700 Subject: [PATCH 1/5] fix transfer state bug --- .../settings/WebsiteTransferForm.tsx | 76 ++++++++++--------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/src/app/(main)/websites/[websiteId]/settings/WebsiteTransferForm.tsx b/src/app/(main)/websites/[websiteId]/settings/WebsiteTransferForm.tsx index 348bccafc..cceec88e5 100644 --- a/src/app/(main)/websites/[websiteId]/settings/WebsiteTransferForm.tsx +++ b/src/app/(main)/websites/[websiteId]/settings/WebsiteTransferForm.tsx @@ -9,7 +9,6 @@ import { Select, Text, } from '@umami/react-zen'; -import { useState } from 'react'; import { useLoginQuery, useMessages, @@ -30,7 +29,6 @@ export function WebsiteTransferForm({ }) { const { user } = useLoginQuery(); const website = useWebsite(); - const [teamId, setTeamId] = useState(null); const { t, labels, messages, getErrorMessage } = useMessages(); const { mutateAsync, error, isPending } = useUpdateQuery(`/websites/${websiteId}/transfer`); const { data: teams, isLoading } = useUserTeamsQuery(user.id); @@ -44,11 +42,11 @@ export function WebsiteTransferForm({ ), ) || []; - const handleSubmit = async () => { + const handleSubmit = async (data: { teamId?: string }) => { await mutateAsync( { userId: website.teamId ? user.id : undefined, - teamId: website.userId ? teamId : undefined, + teamId: website.userId ? data.teamId : undefined, }, { onSuccess: async () => { @@ -59,42 +57,50 @@ export function WebsiteTransferForm({ ); }; - const handleChange = (key: string | number | null) => { - setTeamId(key as string); - }; - if (isLoading) { return ; } return ( -
- - {t(isTeamWebsite ? messages.transferTeamWebsiteToUser : messages.transferUserWebsiteToTeam)} - - - {!isTeamWebsite && ( - - )} - - - - - {t(labels.transfer)} - - + + {({ watch }) => { + const selectedTeamId = watch('teamId'); + + return ( + <> + + {t( + isTeamWebsite + ? messages.transferTeamWebsiteToUser + : messages.transferUserWebsiteToTeam, + )} + + + {!isTeamWebsite && ( + + )} + + + + + {t(labels.transfer)} + + + + ); + }}
); } From fc19aa60d899a4fc82e28c9aebea45b13e176df5 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Tue, 4 Aug 2026 09:11:47 -0700 Subject: [PATCH 2/5] fix heatmap/replay css issues --- .../(reports)/heatmaps/HeatmapsPage.tsx | 14 ++++++++++++-- .../[websiteId]/replays/ReplayModal.module.css | 1 + .../websites/[websiteId]/replays/ReplayModal.tsx | 12 +++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/HeatmapsPage.tsx b/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/HeatmapsPage.tsx index b771fc020..dad677aef 100644 --- a/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/HeatmapsPage.tsx +++ b/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/HeatmapsPage.tsx @@ -67,7 +67,12 @@ export function HeatmapsPage({ websiteId }: { websiteId: string }) { {isPhone ? ( - + ) : ( - + - - + {({ close }) => ( {activeReplayId && ( @@ -55,7 +53,7 @@ export function ReplayModal({ websiteId, replayId, className, ...props }: Replay )} - + ); } From 9bb1f5519aa8cfe9f989d951a2df822ef6e082a9 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Tue, 4 Aug 2026 10:56:18 -0700 Subject: [PATCH 3/5] heatmap mobile layout. session replay mobile replays fix. share page tests. Closes #4417. --- .../(reports)/heatmaps/Heatmap.module.css | 68 ++++++++ .../(reports)/heatmaps/Heatmap.tsx | 158 ++++++++++++++--- .../replays/ReplayModal.module.css | 4 + .../[websiteId]/replays/ReplayModal.tsx | 24 ++- .../replays/[replayId]/ReplayPlayback.tsx | 19 ++- .../replays/[replayId]/ReplayPlayer.tsx | 88 +++++++--- src/app/global.css | 30 ++++ .../[slug]/[[...path]]/SharePage.test.tsx | 161 ++++++++++++++++++ 8 files changed, 508 insertions(+), 44 deletions(-) create mode 100644 src/app/share/[slug]/[[...path]]/SharePage.test.tsx diff --git a/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.module.css b/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.module.css index 350542e16..e4eb6ad75 100644 --- a/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.module.css +++ b/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.module.css @@ -58,6 +58,35 @@ font-weight: 600; } +.mobilePageHeader { + min-width: 0; +} + +.mobilePageSection { + padding: 4px 0 2px; +} + +.mobileSectionLabel { + font-size: 12px; + font-weight: 600; +} + +.mobileSelectedPageButton { + width: 100%; + text-align: left; + border: 1px solid var(--border-base); + background: var(--surface-raised); + border-radius: 8px; + padding: 10px 12px; + cursor: pointer; + font: inherit; + color: inherit; +} + +.mobileSelectedPageButton:hover { + background: var(--surface-sunken); +} + .summaryHeader { min-width: 0; } @@ -98,6 +127,10 @@ min-width: 0; } +.mobileSummaryControls { + width: 100%; +} + .screenWidthCount { margin-left: auto; font-variant-numeric: tabular-nums; @@ -228,3 +261,38 @@ pointer-events: auto; mix-blend-mode: multiply; } + +@media (max-width: 640px) { + .summaryStats, + .summaryHeader { + width: 100%; + align-items: stretch; + } + + .summaryStats { + gap: 8px; + } + + .summaryStat { + width: 100%; + justify-content: flex-start; + } + + .screenWidthControl { + width: 100%; + margin-left: 0; + justify-content: space-between; + } + + .screenWidthLabel { + font-size: 12px; + } + + .canvasWrapper { + max-height: 70vh; + } + + .scrollBandLabel { + display: none; + } +} diff --git a/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.tsx b/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.tsx index da6392142..15375066c 100644 --- a/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.tsx +++ b/src/app/(main)/websites/[websiteId]/(reports)/heatmaps/Heatmap.tsx @@ -1,19 +1,25 @@ 'use client'; import { + Button, Column, + Dialog, Grid, Heading, Icon, ListItem, Loading, + Modal, Row, Select, Text, } from '@umami/react-zen'; import { Laptop, Monitor, Smartphone, Tablet } from 'lucide-react'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { ControlledDialog } from '@/components/common/ControlledDialog'; +import { IconLabel } from '@/components/common/IconLabel'; import { LoadingPanel } from '@/components/common/LoadingPanel'; -import { useResultQuery } from '@/components/hooks'; +import { useMobile, useResultQuery } from '@/components/hooks'; +import { ListCheck } from '@/components/icons'; import { formatLongNumber } from '@/lib/format'; import type { HeatmapMode, HeatmapPoint, HeatmapResult, HeatmapSnapshot } from '@/queries/sql'; import styles from './Heatmap.module.css'; @@ -53,6 +59,8 @@ interface HeatmapProps { } export function Heatmap({ websiteId, urlPath, onUrlPathChange, mode, search }: HeatmapProps) { + const { isPhone } = useMobile(); + const [isPagePickerOpen, setIsPagePickerOpen] = useState(false); const { data: pagesData, error, @@ -88,6 +96,7 @@ export function Heatmap({ websiteId, urlPath, onUrlPathChange, mode, search }: H return pages.filter(page => page.urlPath.toLowerCase().includes(value)); }, [pages, search]); + const selectedPage = filteredPages.find(page => page.urlPath === urlPath) ?? null; const points = detailData?.points ?? []; const scroll = detailData?.scroll; const snapshot = detailData?.snapshot ?? null; @@ -122,16 +131,33 @@ export function Heatmap({ websiteId, urlPath, onUrlPathChange, mode, search }: H return ( - - -