: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(experiments): remove unused experiment template components (#84564)
Rodrigo Iloro2ce246bc6d99
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 9c85c643fb1c..ff2726edba91 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -329,7 +329,6 @@ export const FEATURE_FLAGS = {EXPERIMENTS_METRICS_RECALCULATION: 'experiments-metrics-recalculation', // owner: @rodrigoi #team-experimentsEXPERIMENTS_SHOW_SQL: 'experiments-show-sql', // owner: @jurajmajerik #team-experimentsEXPERIMENTS_SYNC_QUERIES: 'experiments-sync-queries', // owner: @andehen #team-experiments- EXPERIMENTS_TEMPLATES: 'experiments-templates', // owner: @rodrigoi #team-experimentsFEATURE_FLAG_COHORT_CREATION: 'feature-flag-cohort-creation', // owner: #team-feature-flagsFEATURE_FLAG_CREATION_INTENTS: 'feature-flag-creation-intents', // owner: #team-feature-flagsFEATURE_FLAG_DRAG_DROP_CONDITIONS: 'feature-flag-drag-drop-conditions', // owner: @gustavo #team-feature-flagsdiff --git a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplateCard.tsx b/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplateCard.tsxdeleted file mode 100644index 040593584a34..000000000000--- a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplateCard.tsx+++ /dev/null@@ -1,39 +0,0 @@-import { LemonTag } from 'lib/lemon-ui/LemonTag'--import { ExperimentTemplate } from './constants'--type ExperimentTemplateCardProps = {- template: ExperimentTemplate- onSelect: (template: ExperimentTemplate) => void-}--export const ExperimentTemplateCard = ({ template, onSelect }: ExperimentTemplateCardProps): JSX.Element => {- return (- <button- className="relative flex flex-col bg-bg-light border border-border rounded-lg hover:border-primary-3000-hover focus:border-primary-3000-hover focus:outline-none transition-colors text-left h-full group p-4 cursor-pointer"- data-attr="experiment-template-card"- onClick={() => onSelect(template)}- >- <div className="flex items-start gap-3 mb-3">- <div className="flex-shrink-0">{template.icon}</div>- <div className="flex-1 min-w-0">- <h3 className="font-semibold text-base mb-1">{template.name}</h3>- <p className="text-sm text-muted">{template.description}</p>- </div>- </div>-- <div className="mt-auto pt-2 border-t">- <div className="flex items-center gap-2">- <LemonTag size="small" type="success">- {template.metrics.length} metrics- </LemonTag>- {template.metrics.map((metric, index) => (- <span key={index} className="text-xs text-muted truncate">- {metric.name}- </span>- ))}- </div>- </div>- </button>- )-}diff --git a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplateModal.tsx b/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplateModal.tsxdeleted file mode 100644index 4cf028baf113..000000000000--- a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplateModal.tsx+++ /dev/null@@ -1,60 +0,0 @@-import { useActions, useValues } from 'kea'--import { LemonBanner, LemonButton, LemonModal } from '@posthog/lemon-ui'--import { experimentTemplateModalLogic } from './experimentTemplateModalLogic'--interface ExperimentTemplateModalProps {- onApply: () => void-}--export const ExperimentTemplateModal = ({ onApply }: ExperimentTemplateModalProps): JSX.Element | null => {- const { isModalOpen, template } = useValues(experimentTemplateModalLogic)- const { closeTemplateModal } = useActions(experimentTemplateModalLogic)-- if (!isModalOpen || !template) {- return null- }-- const canApplyTemplate = true-- return (- <LemonModal- isOpen={isModalOpen}- onClose={closeTemplateModal}- title={`Configure: ${template.name}`}- footer={- <div className="flex items-center w-full justify-end gap-2">- <LemonButton type="secondary" onClick={closeTemplateModal}>- Cancel- </LemonButton>- <LemonButton- type="primary"- onClick={onApply}- disabledReason={!canApplyTemplate ? 'Please fill in all required event fields' : undefined}- data-attr="apply-experiment-template"- >- Apply Template- </LemonButton>- </div>- }- >- <div className="space-y-4">- <LemonBanner type="info">- <strong>Goal:</strong> {template.experimentGoal}- </LemonBanner>-- <div className="space-y-4">- {template.metrics.map((metric) => (- <div key={metric.name}>{metric.name}</div>- ))}- </div>-- <LemonBanner type="success">- This will add {template.metrics.length} metrics:{' '}- {template.metrics.map((metric) => metric.name).join(', ')}- </LemonBanner>- </div>- </LemonModal>- )-}diff --git a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplates.tsx b/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplates.tsxdeleted file mode 100644index 923d541ec09f..000000000000--- a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/ExperimentTemplates.tsx+++ /dev/null@@ -1,29 +0,0 @@-import { useActions } from 'kea'--import { EXPERIMENT_TEMPLATES } from './constants'-import { ExperimentTemplateCard } from './ExperimentTemplateCard'-import { ExperimentTemplateModal } from './ExperimentTemplateModal'-import { experimentTemplateModalLogic } from './experimentTemplateModalLogic'--export const ExperimentTemplates = (): JSX.Element => {- const { openTemplateModal } = useActions(experimentTemplateModalLogic)-- return (- <>- <div className="space-y-4">- <div>- <h3 className="font-semibold text-base mb-1">Start with a template</h3>- <p className="text-sm text-muted">- Choose a pre-configured experiment template to quickly set up your metrics- </p>- </div>- </div>- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">- {EXPERIMENT_TEMPLATES.map((template) => (- <ExperimentTemplateCard key={template.id} template={template} onSelect={openTemplateModal} />- ))}- </div>- <ExperimentTemplateModal onApply={() => {}} />- </>- )-}diff --git a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/constants.tsx b/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/constants.tsxdeleted file mode 100644index f7cb2ed9638e..000000000000--- a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/constants.tsx+++ /dev/null@@ -1,103 +0,0 @@-import { IconBell, IconBox, IconGraph, IconTarget, IconTrending, IconUser } from '@posthog/icons'--export const EXPERIMENT_TEMPLATE_IDS = {- CHECKOUT_FLOW: 'checkout-flow',- PRICING_PAGE: 'pricing-page',- ONBOARDING: 'onboarding',- PRODUCT_PAGE: 'product-page',- FEATURE_ADOPTION: 'feature-adoption',- MESSAGING: 'messaging',-} as const--export type ExperimentTemplateId = (typeof EXPERIMENT_TEMPLATE_IDS)[keyof typeof EXPERIMENT_TEMPLATE_IDS]--export type ExperimentTemplate = {- id: ExperimentTemplateId- name: string- description: string- experimentGoal: string- icon: React.ReactNode- metrics: { name: string }[]-}--export const EXPERIMENT_TEMPLATES: ExperimentTemplate[] = [- {- id: EXPERIMENT_TEMPLATE_IDS.CHECKOUT_FLOW,- name: 'Checkout Flow Optimization',- description: 'Increase purchase completion rate',- experimentGoal: 'Optimize conversion from checkout start to completed purchase',- icon: <IconTrending className="text-2xl" />,- metrics: [- { name: 'Conversion rate' },- { name: 'Average order value' },- { name: 'Checkout abandonment rate' },- { name: 'Time to purchase' },- ],- },- {- id: EXPERIMENT_TEMPLATE_IDS.PRICING_PAGE,- name: 'Pricing Page Testing',- description: 'Optimize plan selection and signup rate',- experimentGoal: 'Increase conversion from pricing page view to completed signup',- icon: <IconGraph className="text-2xl" />,- metrics: [- { name: 'Click-through rate' },- { name: 'Plan selection rate' },- { name: 'Conversion to signup' },- { name: 'Revenue per visitor' },- ],- },- {- id: EXPERIMENT_TEMPLATE_IDS.ONBOARDING,- name: 'Onboarding Activation',- description: 'Increase trial-to-paid conversion',- experimentGoal: 'Optimize activation flow and trial-to-paid conversion',- icon: <IconUser className="text-2xl" />,- metrics: [- { name: 'Activation rate' },- { name: 'Time to first value' },- { name: 'Trial-to-paid conversion' },- { name: 'Feature adoption' },- ],- },- {- id: EXPERIMENT_TEMPLATE_IDS.PRODUCT_PAGE,- name: 'Product Page Conversion',- description: 'Increase add-to-cart and purchase rates',- experimentGoal: 'Optimize product page to drive add-to-cart and purchases',- icon: <IconBox className="text-2xl" />,- metrics: [- { name: 'Add-to-cart rate' },- { name: 'Purchase conversion rate' },- { name: 'Revenue per visitor' },- { name: 'Bounce rate' },- ],- },- {- id: EXPERIMENT_TEMPLATE_IDS.FEATURE_ADOPTION,- name: 'Feature Adoption',- description: 'Drive engagement with new/core features',- experimentGoal: 'Increase discovery and usage of key features',- icon: <IconTarget className="text-2xl" />,- metrics: [- { name: 'Feature adoption rate' },- { name: 'Repeat usage rate' },- { name: 'Time to first use' },- { name: 'User retention' },- ],- },- {- id: EXPERIMENT_TEMPLATE_IDS.MESSAGING,- name: 'In-App Messaging & Notification Testing',- description: 'Optimize engagement with notifications',- experimentGoal: 'Maximize engagement with notifications, tooltips, and CTAs',- icon: <IconBell className="text-2xl" />,- metrics: [- { name: 'Click-through rate' },- { name: 'Engagement rate' },- { name: 'Dismissal rate' },- { name: 'Time to action' },- { name: 'Conversion from notification' },- ],- },-]diff --git a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/experimentTemplateModalLogic.ts b/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/experimentTemplateModalLogic.tsdeleted file mode 100644index 7f14709051a0..000000000000--- a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/experimentTemplateModalLogic.ts+++ /dev/null@@ -1,50 +0,0 @@-import { MakeLogicType, actions, kea, path, reducers } from 'kea'--import { ExperimentTemplate } from './constants'--// Generated by kea-typegen. Update if you're an agent, ignore if you're human.-export interface experimentTemplateModalLogicValues {- isModalOpen: boolean- template: ExperimentTemplate | null-}--// Generated by kea-typegen. Update if you're an agent, ignore if you're human.-export interface experimentTemplateModalLogicActions {- closeTemplateModal: () => {- value: true- }- openTemplateModal: (template: ExperimentTemplate) => {- template: ExperimentTemplate- }-}--export type experimentTemplateModalLogicType = MakeLogicType<- experimentTemplateModalLogicValues,- experimentTemplateModalLogicActions->--export const experimentTemplateModalLogic = kea<experimentTemplateModalLogicType>([- path(['scenes', 'experiments', 'ExperimentForm', 'ExperimentTemplates', 'experimentTemplateModalLogic']),-- actions({- openTemplateModal: (template: ExperimentTemplate) => ({ template }),- closeTemplateModal: true,- }),-- reducers({- isModalOpen: [- false,- {- openTemplateModal: () => true,- closeTemplateModal: () => false,- },- ],- template: [- null as ExperimentTemplate | null,- {- openTemplateModal: (_, { template }) => template,- closeTemplateModal: () => null,- },- ],- }),-])diff --git a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/index.ts b/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/index.tsdeleted file mode 100644index f02fa8aa0fdc..000000000000--- a/frontend/src/scenes/experiments/ExperimentForm/ExperimentTemplates/index.ts+++ /dev/null@@ -1 +0,0 @@-export { ExperimentTemplates } from './ExperimentTemplates'