diff --git a/frontend/__snapshots__/components-playerinspector--default--dark.png b/frontend/__snapshots__/components-playerinspector--default--dark.png index 51580b9660e6f..87c483c27613a 100644 Binary files a/frontend/__snapshots__/components-playerinspector--default--dark.png and b/frontend/__snapshots__/components-playerinspector--default--dark.png differ diff --git a/frontend/__snapshots__/components-playerinspector--default--light.png b/frontend/__snapshots__/components-playerinspector--default--light.png index 42395f0be8cb4..04f141310bd43 100644 Binary files a/frontend/__snapshots__/components-playerinspector--default--light.png and b/frontend/__snapshots__/components-playerinspector--default--light.png differ diff --git a/frontend/src/scenes/session-recordings/player/inspector/PlayerInspectorBottomSettings.tsx b/frontend/src/scenes/session-recordings/player/inspector/PlayerInspectorBottomSettings.tsx index d5341305dd2c8..b6287ef3fdb30 100644 --- a/frontend/src/scenes/session-recordings/player/inspector/PlayerInspectorBottomSettings.tsx +++ b/frontend/src/scenes/session-recordings/player/inspector/PlayerInspectorBottomSettings.tsx @@ -1,8 +1,9 @@ import './PlayerInspectorList.scss' +import { BaseIcon, IconCheck } from '@posthog/icons' import { useActions, useValues } from 'kea' import { userPreferencesLogic } from 'lib/logic/userPreferencesLogic' -import { SettingsBar, SettingsToggle } from 'scenes/session-recordings/components/PanelSettings' +import { SettingsBar, SettingsMenu, SettingsToggle } from 'scenes/session-recordings/components/PanelSettings' import { miniFiltersLogic } from 'scenes/session-recordings/player/inspector/miniFiltersLogic' import { FilterableInspectorListItemTypes } from '~/types' @@ -10,32 +11,39 @@ import { FilterableInspectorListItemTypes } from '~/types' import { sessionRecordingPlayerLogic } from '../sessionRecordingPlayerLogic' import { playerInspectorLogic } from './playerInspectorLogic' -function HideProperties(): JSX.Element | null { +function HideProperties(): JSX.Element { const { logicProps } = useValues(sessionRecordingPlayerLogic) const inspectorLogic = playerInspectorLogic(logicProps) - const { allItemsByItemType } = useValues(inspectorLogic) + const { hasEventsToDisplay } = useValues(inspectorLogic) + const { hasEventsFiltersSelected } = useValues(miniFiltersLogic) + + const { hideNullValues } = useValues(userPreferencesLogic) + const { setHideNullValues } = useActions(userPreferencesLogic) - const { miniFiltersForType } = useValues(miniFiltersLogic) const { hidePostHogPropertiesInTable } = useValues(userPreferencesLogic) const { setHidePostHogPropertiesInTable } = useActions(userPreferencesLogic) - const hasEventsFiltersSelected = miniFiltersForType(FilterableInspectorListItemTypes.EVENTS).some((x) => x.enabled) - const hasEventsToDisplay = allItemsByItemType[FilterableInspectorListItemTypes.EVENTS]?.length > 0 - return ( - setHidePostHogPropertiesInTable(!hidePostHogPropertiesInTable)} - disabledReason={ - hasEventsToDisplay && hasEventsFiltersSelected ? undefined : 'There are no events in the list' - } - active={hidePostHogPropertiesInTable} + {hidePostHogPropertiesInTable ? : } Hide PostHog properties, + onClick: () => setHidePostHogPropertiesInTable(!hidePostHogPropertiesInTable), + active: hidePostHogPropertiesInTable, + disabledReason: + hasEventsToDisplay && hasEventsFiltersSelected ? undefined : 'There are no events in the list', + }, + { + label: <>{hideNullValues ? : } Hide null values, + onClick: () => setHideNullValues(!hideNullValues), + active: hideNullValues, + disabledReason: + hasEventsToDisplay && hasEventsFiltersSelected ? undefined : 'There are no events in the list', + }, + ]} + label="Hide properties" + highlightWhenActive={false} /> ) } diff --git a/frontend/src/scenes/session-recordings/player/inspector/miniFiltersLogic.ts b/frontend/src/scenes/session-recordings/player/inspector/miniFiltersLogic.ts index 357e0eb4a12f6..27953c893b9cb 100644 --- a/frontend/src/scenes/session-recordings/player/inspector/miniFiltersLogic.ts +++ b/frontend/src/scenes/session-recordings/player/inspector/miniFiltersLogic.ts @@ -176,6 +176,11 @@ export const miniFiltersLogic = kea([ }, ], + hasEventsFiltersSelected: [ + (s) => [s.miniFiltersForType], + (miniFiltersForType) => miniFiltersForType(FilterableInspectorListItemTypes.EVENTS).some((x) => x.enabled), + ], + miniFilters: [ (s) => [s.selectedMiniFilters], (selectedMiniFilters): SharedListMiniFilter[] => { diff --git a/frontend/src/scenes/session-recordings/player/inspector/playerInspectorLogic.ts b/frontend/src/scenes/session-recordings/player/inspector/playerInspectorLogic.ts index f3d380dbc14f7..c6b6c2d289e79 100644 --- a/frontend/src/scenes/session-recordings/player/inspector/playerInspectorLogic.ts +++ b/frontend/src/scenes/session-recordings/player/inspector/playerInspectorLogic.ts @@ -984,6 +984,11 @@ export const playerInspectorLogic = kea([ return itemsByType }, ], + + hasEventsToDisplay: [ + (s) => [s.allItemsByItemType], + (allItemsByItemType): boolean => allItemsByItemType[FilterableInspectorListItemTypes.EVENTS]?.length > 0, + ], })), listeners(({ values, actions }) => ({ setItemExpanded: ({ index, expanded }) => {