: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
feat(experiments): add legacy deprecation banner behind a flag (#104368)
Anders36b2ff2c5938
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 314d31b7f304..fe2dfa07e017 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -320,6 +320,7 @@ export const FEATURE_FLAGS = {EXPERIMENTS_DW_AA_TEST: 'experiments-dw-aa-test', // owner: @rodrigoi #team-experimentsEXPERIMENTS_EXCLUDED_VARIANTS: 'experiments-excluded-variants', // owner: @rodrigoi #team-experimentsEXPERIMENTS_FREEZE_EXPOSURE_AA_TEST: 'experiments-freeze-exposure-aa-test', // owner: @mp-hog #team-experiments multivariate=control,test, dogfood A/A used to validate the freeze-exposure lifecycle action+ EXPERIMENTS_LEGACY_DEPRECATION_NOTICE: 'experiments-legacy-deprecation-notice', // owner: @andehen #team-experiments, shows the legacy experiments deprecation bannerEXPERIMENTS_LIST_AA_TEST: 'experiments-list-aa-test', // owner: @andehen #team-experiments multivariate=control,test, dogfood A/A exposed on the experiments list pageEXPERIMENTS_METRICS_RECALCULATION: 'experiments-metrics-recalculation', // owner: @rodrigoi #team-experimentsEXPERIMENTS_SHOW_SQL: 'experiments-show-sql', // owner: @jurajmajerik #team-experimentsdiff --git a/products/experiments/frontend/legacy/LegacyExperimentView.tsx b/products/experiments/frontend/legacy/LegacyExperimentView.tsxindex cd56a9f27f25..90362eaf8783 100644--- a/products/experiments/frontend/legacy/LegacyExperimentView.tsx+++ b/products/experiments/frontend/legacy/LegacyExperimentView.tsx@@ -3,6 +3,7 @@ import { useEffect } from 'react'import { LemonBanner, LemonTab, LemonTabs } from '@posthog/lemon-ui'+import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'import { PendingChangeRequestBanner } from 'scenes/approvals/PendingChangeRequestBanner'import { experimentLogic } from 'scenes/experiments/experimentLogic'import {@@ -157,6 +158,7 @@ export function LegacyExperimentView(): JSX.Element {const { experimentLoading, experiment } = useValues(experimentLogic)const { activeTabKey } = useValues(experimentSceneLogic)const { setActiveTabKey } = useActions(experimentSceneLogic)+ const showDeprecationNotice = useFeatureFlag('EXPERIMENTS_LEGACY_DEPRECATION_NOTICE')// Props for legacy logic - uses experiment data from parent experimentLogicconst legacyLogicProps = {@@ -198,6 +200,14 @@ export function LegacyExperimentView(): JSX.Element {<><ExperimentWarningBanner />+ {showDeprecationNotice && (+ <LemonBanner type="error" className="mb-4">+ Legacy experiments will be deprecated on October 15, 2026. Take a screenshot of these+ results if you need them after that date. Legacy experiments can be migrated to the new+ engine, and PostHog AI can do this for you. Contact support if you have questions.+ </LemonBanner>+ )}+{/* Warning banner indicating this is a legacy experiment */}<LemonBanner type="warning" className="mb-4">This is a legacy experiment. Metrics can no longer be edited.