Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(replay): remove the A/B test results template (#91208)

Phil Haacke62b8dd5e87c
diff --git a/frontend/src/scenes/session-recordings/templates/SessionRecordingTemplates.tsx b/frontend/src/scenes/session-recordings/templates/SessionRecordingTemplates.tsx
index 563792a24224..69ad4c71d885 100644
--- a/frontend/src/scenes/session-recordings/templates/SessionRecordingTemplates.tsx
+++ b/frontend/src/scenes/session-recordings/templates/SessionRecordingTemplates.tsx
@@ -8,13 +8,7 @@ import { universalFiltersLogic } from 'lib/components/UniversalFilters/universal
import { isUniversalGroupFilterLike } from 'lib/components/UniversalFilters/utils'
import { actionsModel } from '~/models/actionsModel'
-import {
- FeaturePropertyFilter,
- FilterLogicalOperator,
- ReplayTemplateCategory,
- ReplayTemplateType,
- ReplayTemplateVariableType,
-} from '~/types'
+import { FilterLogicalOperator, ReplayTemplateCategory, ReplayTemplateType, ReplayTemplateVariableType } from '~/types'
import { replayTemplates } from './availableTemplates'
import { sessionReplayTemplatesLogic } from './sessionRecordingTemplatesLogic'
@@ -28,7 +22,7 @@ const allCategories: ReplayTemplateCategory[] = replayTemplates
.flatMap((template) => template.categories)
.filter((category, index, self) => self.indexOf(category) === index)
-const NestedFilterGroup = ({ buttonTitle, selectOne }: { buttonTitle?: string; selectOne?: boolean }): JSX.Element => {
+const NestedFilterGroup = ({ buttonTitle }: { buttonTitle?: string }): JSX.Element => {
const { filterGroup } = useValues(universalFiltersLogic)
const { replaceGroupValue, removeGroupValue } = useActions(universalFiltersLogic)
@@ -50,11 +44,9 @@ const NestedFilterGroup = ({ buttonTitle, selectOne }: { buttonTitle?: string; s
/>
)
})}
- {!selectOne || (selectOne && filterGroup.values.length === 0) ? (
- <div>
- <UniversalFilters.AddFilterButton title={buttonTitle} type="secondary" size="xsmall" />
- </div>
- ) : null}
+ <div>
+ <UniversalFilters.AddFilterButton title={buttonTitle} type="secondary" size="xsmall" />
+ </div>
</div>
</div>
)
@@ -81,7 +73,7 @@ const SingleTemplateVariable = ({
size="small"
/>
</div>
- ) : ['event', 'flag', 'person-property'].includes(variable.type) ? (
+ ) : ['event', 'person-property'].includes(variable.type) ? (
<div>
<LemonLabel info={variable.description}>{variable.name}</LemonLabel>
<UniversalFilters
@@ -93,28 +85,17 @@ const SingleTemplateVariable = ({
taxonomicGroupTypes={
variable.type === 'event'
? [TaxonomicFilterGroupType.Events, TaxonomicFilterGroupType.Actions]
- : variable.type === 'flag'
- ? [TaxonomicFilterGroupType.FeatureFlags]
- : variable.type === 'person-property'
- ? [TaxonomicFilterGroupType.PersonProperties]
- : []
+ : [TaxonomicFilterGroupType.PersonProperties]
}
onChange={(thisFilterGroup) => {
if (thisFilterGroup.values.length === 0) {
resetVariable({ ...variable, filterGroup: undefined })
- } else if (variable.type === 'flag') {
- setVariable({ ...variable, value: (thisFilterGroup.values[0] as FeaturePropertyFilter).key })
} else {
setVariable({ ...variable, filterGroup: thisFilterGroup.values[0] })
}
}}
>
- <NestedFilterGroup
- buttonTitle={`Select ${
- variable.type === 'event' ? 'event' : variable.type === 'flag' ? 'flag' : 'person property'
- }`}
- selectOne={variable.type == 'flag'}
- />
+ <NestedFilterGroup buttonTitle={`Select ${variable.type === 'event' ? 'event' : 'person property'}`} />
</UniversalFilters>
</div>
) : null
diff --git a/frontend/src/scenes/session-recordings/templates/availableTemplates.tsx b/frontend/src/scenes/session-recordings/templates/availableTemplates.tsx
index b5e42c926f7f..10830065e570 100644
--- a/frontend/src/scenes/session-recordings/templates/availableTemplates.tsx
+++ b/frontend/src/scenes/session-recordings/templates/availableTemplates.tsx
@@ -1,7 +1,6 @@
import {
IconApp,
IconCursorClick,
- IconFlag,
IconHandMoney,
IconPhone,
IconSearch,
@@ -136,21 +135,6 @@ export const replayTemplates: ReplayTemplateType[] = [
categories: ['B2C'],
icon: <IconSearch />,
},
- {
- key: 'experiment',
- name: 'A/B test results',
- description: 'Watch how users interact with your A/B test. Look for any areas or steps that cause friction.',
- variables: [
- {
- type: 'flag',
- name: 'Feature flag',
- key: 'feature-flag',
- description: 'The feature flag that you want to observe.',
- },
- ],
- categories: ['More'],
- icon: <IconFlag />,
- },
{
key: 'rageclicks',
name: 'Rageclicks',
diff --git a/frontend/src/scenes/session-recordings/templates/sessionRecordingTemplatesLogic.tsx b/frontend/src/scenes/session-recordings/templates/sessionRecordingTemplatesLogic.tsx
index fc21139dcc1c..2d364b94305c 100644
--- a/frontend/src/scenes/session-recordings/templates/sessionRecordingTemplatesLogic.tsx
+++ b/frontend/src/scenes/session-recordings/templates/sessionRecordingTemplatesLogic.tsx
@@ -29,34 +29,6 @@ const getPageviewFilterValue = (pageview: string): UniversalFiltersGroupValue =>
}
}
-const getFlagFilterValue = (flag: string): UniversalFiltersGroupValue => {
- return {
- id: '$feature_flag_called',
- name: '$feature_flag_called',
- type: 'events',
- properties: [
- {
- key: `$feature/${flag}`,
- type: PropertyFilterType.Event,
- value: ['false'],
- operator: PropertyOperator.IsNot,
- },
- {
- key: `$feature/${flag}`,
- type: PropertyFilterType.Event,
- value: 'is_set',
- operator: PropertyOperator.IsSet,
- },
- {
- key: '$feature_flag',
- type: PropertyFilterType.Event,
- value: flag,
- operator: PropertyOperator.Exact,
- },
- ],
- }
-}
-
export interface ReplayTemplateLogicPropsType {
template: ReplayTemplateType
// one card can be in multiple categories,
@@ -167,9 +139,6 @@ export const sessionReplayTemplatesLogic = kea<sessionReplayTemplatesLogicType>(
if (variable.type === 'pageview' && variable.value) {
return getPageviewFilterValue(variable.value)
}
- if (variable.type === 'flag' && variable.value) {
- return getFlagFilterValue(variable.value)
- }
if (
['snapshot_source', 'event', 'person-property'].includes(variable.type) &&
variable.filterGroup
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 8895e339406a..dfad12210be4 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -7615,7 +7615,7 @@ export type ReplayTemplateType = {
export type ReplayTemplateCategory = 'B2B' | 'B2C' | 'More'
export type ReplayTemplateVariableType = {
- type: 'event' | 'flag' | 'pageview' | 'person-property' | 'snapshot_source'
+ type: 'event' | 'pageview' | 'person-property' | 'snapshot_source'
name: string
key: string
touched?: boolean