diff --git a/frontend/__snapshots__/scenes-app-notebooks--recordings-playlist--dark.png b/frontend/__snapshots__/scenes-app-notebooks--recordings-playlist--dark.png index be16d2121c557..db33b25c6b98d 100644 Binary files a/frontend/__snapshots__/scenes-app-notebooks--recordings-playlist--dark.png and b/frontend/__snapshots__/scenes-app-notebooks--recordings-playlist--dark.png differ diff --git a/frontend/src/lib/components/PropertyIcon.tsx b/frontend/src/lib/components/PropertyIcon.tsx index 8d4d9577fe1c0..881380953d64f 100644 --- a/frontend/src/lib/components/PropertyIcon.tsx +++ b/frontend/src/lib/components/PropertyIcon.tsx @@ -18,8 +18,7 @@ import { IconWeb, IconWindows, } from 'lib/lemon-ui/icons' -import { Tooltip } from 'lib/lemon-ui/Tooltip' -import { HTMLAttributes, ReactNode } from 'react' +import { forwardRef, HTMLAttributes, Ref } from 'react' import { countryCodeToFlag } from 'scenes/insights/views/WorldMap' const osIcons = { @@ -66,12 +65,13 @@ interface PropertyIconProps { property: string value?: string className?: string - noTooltip?: boolean onClick?: HTMLAttributes['onClick'] - tooltipTitle?: (property: string, value?: string) => ReactNode // Tooltip title will default to `value` } -export function PropertyIcon({ property, value, className, noTooltip, tooltipTitle }: PropertyIconProps): JSX.Element { +export const PropertyIcon = forwardRef(function PropertyIcon( + { property, value, className }: PropertyIconProps, + ref: Ref +): JSX.Element { if (!property || !(property in PROPERTIES_ICON_MAP)) { return <> } @@ -86,7 +86,9 @@ export function PropertyIcon({ property, value, className, noTooltip, tooltipTit icon = countryCodeToFlag(value) } - const content =
{icon}
- - return noTooltip ? content : {content} -} + return ( +
+ {icon} +
+ ) +}) diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodePerson.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodePerson.tsx index df2ac18295f26..1c249164b197a 100644 --- a/frontend/src/scenes/notebooks/Nodes/NotebookNodePerson.tsx +++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodePerson.tsx @@ -1,7 +1,7 @@ import { createPostHogWidgetNode } from 'scenes/notebooks/Nodes/NodeWrapper' import { NotebookNodeType, PropertyDefinitionType } from '~/types' import { useActions, useValues } from 'kea' -import { LemonDivider } from '@posthog/lemon-ui' +import { LemonDivider, Tooltip } from '@posthog/lemon-ui' import { urls } from 'scenes/urls' import { PersonIcon, TZLabel } from '@posthog/apps-common' import { personLogic } from 'scenes/persons/personLogic' @@ -78,17 +78,16 @@ const Component = ({ attributes }: NotebookNodeProps ( + title={
{tooltipValue ?? 'N/A'}
- )} - /> + } + > + + ) }) ) : ( diff --git a/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreview.tsx b/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreview.tsx index 19350d0ab4b8d..df7a1dd777a15 100644 --- a/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreview.tsx +++ b/frontend/src/scenes/session-recordings/playlist/SessionRecordingPreview.tsx @@ -20,6 +20,7 @@ import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton' import { Tooltip } from 'lib/lemon-ui/Tooltip' import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { colonDelimitedDuration } from 'lib/utils' +import { countryCodeToName } from 'scenes/insights/views/WorldMap' import { DraggableToNotebook } from 'scenes/notebooks/AddToNotebook/DraggableToNotebook' import { useNotebookNode } from 'scenes/notebooks/Nodes/NotebookNodeContext' import { asDisplay } from 'scenes/persons/person-utils' @@ -130,7 +131,7 @@ export function PropertyIcons({ recordingProperties, loading, iconClassNames }: ) : ( recordingProperties.map(({ property, value, label }) => (
- + {!value ? 'Not captured' : label || value} @@ -195,6 +196,7 @@ export function SessionRecordingPreview({ const nodeLogic = useNotebookNode() const inNotebook = !!nodeLogic + const countryCode = recording.person?.properties['$geoip_country_code'] const iconClassnames = 'text-base text-muted-alt' const innerContent = ( @@ -209,15 +211,20 @@ export function SessionRecordingPreview({
-
- {asDisplay(recording.person)} +
+ {countryCode && ( + + + + )} + {asDisplay(recording.person)}