From 2bca64e7680ce3d2939ff6800cb91427d0db0ab3 Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Tue, 15 Jul 2025 08:59:33 -0700 Subject: [PATCH] feat(replay): Unify the tooltips into one for replay details os/browser --- .../views/replays/detail/browserOSIcons.tsx | 79 +++++++++++++------ 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/static/app/views/replays/detail/browserOSIcons.tsx b/static/app/views/replays/detail/browserOSIcons.tsx index 883992c1d8317c..5980be31482d4d 100644 --- a/static/app/views/replays/detail/browserOSIcons.tsx +++ b/static/app/views/replays/detail/browserOSIcons.tsx @@ -1,11 +1,15 @@ +import {Fragment} from 'react'; import styled from '@emotion/styled'; +import {PlatformIcon} from 'platformicons'; import {Flex} from 'sentry/components/core/layout'; import {Tooltip} from 'sentry/components/core/tooltip'; import Placeholder from 'sentry/components/placeholder'; +import CountTooltipContent from 'sentry/components/replays/countTooltipContent'; import {useReplayContext} from 'sentry/components/replays/replayContext'; -import ReplayPlatformIcon from 'sentry/components/replays/replayPlatformIcon'; +import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; +import {generatePlatformIconName} from 'sentry/utils/replays/generatePlatformIconName'; export default function BrowserOSIcons({ showBrowser = true, @@ -17,33 +21,56 @@ export default function BrowserOSIcons({ const {replay} = useReplayContext(); const replayRecord = replay?.getReplay(); - return isLoading ? ( - - ) : ( - - - + if (isLoading) { + return ; + } + + if (!replayRecord) { + return ( + + - {showBrowser && ( - - - + {showBrowser && ( + +
{t('Browser:')}
+
{`${replayRecord?.browser.name ?? ''} ${replayRecord?.browser.version ?? ''}`}
+
+ )} +
{t('OS:')}
+
+ {replayRecord?.os.name ?? ''} {replayRecord?.os.version ?? ''} +
+ + } + > + + {showBrowser && ( + + -
-
- )} -
+ + )} + + + ); }