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.

chore(experiments): remove legacy code from experiment logic. (#57746)

Rodrigo Iloro8e8745f6cc44
diff --git a/frontend/src/scenes/experiments/ExperimentView/ExperimentView.tsx b/frontend/src/scenes/experiments/ExperimentView/ExperimentView.tsx
index f800bd0eee01..59770d192b1f 100644
--- a/frontend/src/scenes/experiments/ExperimentView/ExperimentView.tsx
+++ b/frontend/src/scenes/experiments/ExperimentView/ExperimentView.tsx
@@ -38,7 +38,6 @@ import { ExposureCriteriaModal } from './ExposureCriteria'
import { Exposures } from './Exposures'
import { Info } from './Info'
import { MultiVariantBiasWarning } from './MultiVariantBiasWarning'
-import { Overview } from './Overview'
import { ReleaseConditionsModal, ReleaseConditionsTable } from './ReleaseConditionsTable'
import { ResultsNotificationBanner } from './ResultsNotificationBanner'
import { SettingsTab } from './SettingsTab'
@@ -72,16 +71,8 @@ const AiAnalysisTab = (): JSX.Element => {
}
const MetricsTab = (): JSX.Element => {
- const {
- firstPrimaryMetric,
- primaryMetricsLengthWithSharedMetrics,
- hasMinimumExposureForResults,
- orderedPrimaryMetricsWithResults,
- orderedSecondaryMetricsWithResults,
- isExperimentLaunched,
- } = useValues(experimentLogic)
-
- const hasSinglePrimaryMetric = primaryMetricsLengthWithSharedMetrics === 1
+ const { orderedPrimaryMetricsWithResults, orderedSecondaryMetricsWithResults, isExperimentLaunched } =
+ useValues(experimentLogic)
return (
<>
@@ -92,13 +83,6 @@ const MetricsTab = (): JSX.Element => {
<MultiVariantBiasWarning />
</div>
- {/* Show overview if there's only a single primary metric */}
- {hasSinglePrimaryMetric && hasMinimumExposureForResults && (
- <div className="mb-4 mt-2">
- <Overview metricUuid={firstPrimaryMetric?.uuid || ''} />
- </div>
- )}
-
{/* Modern metrics view */}
{orderedPrimaryMetricsWithResults.length === 0 && orderedSecondaryMetricsWithResults.length === 0 ? (
<EmptyMetricsPanel isLaunched={isExperimentLaunched} />
diff --git a/frontend/src/scenes/experiments/ExperimentView/Info.tsx b/frontend/src/scenes/experiments/ExperimentView/Info.tsx
index 70df4963b2c7..ed359eac404f 100644
--- a/frontend/src/scenes/experiments/ExperimentView/Info.tsx
+++ b/frontend/src/scenes/experiments/ExperimentView/Info.tsx
@@ -27,8 +27,6 @@ import { RunningTimeNew } from './RunningTimeNew'
export function Info({ tabId }: Pick<ExperimentSceneLogicProps, 'tabId'>): JSX.Element {
const {
experiment,
- legacyPrimaryMetricsResults,
- legacySecondaryMetricsResults,
primaryMetricsResults,
secondaryMetricsResults,
primaryMetricsResultsLoading,
@@ -59,11 +57,7 @@ export function Info({ tabId }: Pick<ExperimentSceneLogicProps, 'tabId'>): JSX.E
// Get the last refresh timestamp from either legacy or new results format
// Check both primary and secondary metrics for the most recent timestamp
- const lastRefresh =
- legacyPrimaryMetricsResults?.[0]?.last_refresh ||
- legacySecondaryMetricsResults?.[0]?.last_refresh ||
- primaryMetricsResults?.[0]?.last_refresh ||
- secondaryMetricsResults?.[0]?.last_refresh
+ const lastRefresh = primaryMetricsResults?.[0]?.last_refresh || secondaryMetricsResults?.[0]?.last_refresh
const status = getExperimentStatus(experiment)
const isPaused = isExperimentPaused(experiment)
diff --git a/frontend/src/scenes/experiments/ExperimentView/Overview.tsx b/frontend/src/scenes/experiments/ExperimentView/Overview.tsx
deleted file mode 100644
index 0bfef6a115a2..000000000000
--- a/frontend/src/scenes/experiments/ExperimentView/Overview.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-import { useValues } from 'kea'
-
-import {
- CachedExperimentFunnelsQueryResponse,
- CachedExperimentTrendsQueryResponse,
- CachedLegacyExperimentQueryResponse,
-} from '~/queries/schema/schema-general'
-
-import { experimentLogic } from '../experimentLogic'
-import {
- legacyGetHighestProbabilityVariant,
- legacyGetIndexForVariant,
-} from '../legacy/calculations/legacyExperimentCalculations'
-import { VariantTag } from './components'
-
-export function WinningVariantText({
- result,
-}: {
- result:
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | CachedExperimentTrendsQueryResponse
-}): JSX.Element {
- const { getInsightType, experiment } = useValues(experimentLogic)
-
- const highestProbabilityVariant = legacyGetHighestProbabilityVariant(result)
- const index = legacyGetIndexForVariant(
- result,
- highestProbabilityVariant || '',
- getInsightType(experiment.metrics[0])
- )
- if (highestProbabilityVariant && index !== null && result) {
- const { probability } = result
-
- return (
- <div className="items-center inline-flex flex-wrap">
- <VariantTag variantKey={highestProbabilityVariant} />
- <span>&nbsp;is winning with a&nbsp;</span>
- <span className="font-semibold items-center">
- {`${(probability[highestProbabilityVariant] * 100).toFixed(2)}% probability`}&nbsp;
- </span>
- <span>of being best.&nbsp;</span>
- </div>
- )
- }
-
- return <></>
-}
-
-export function SignificanceText({
- metricUuid,
- isSecondary = false,
-}: {
- metricUuid: string
- isSecondary?: boolean
-}): JSX.Element {
- /**
- * Remove this functions from the logic and make them pure so this component can be tested
- */
- const { isPrimaryMetricSignificant, isSecondaryMetricSignificant } = useValues(experimentLogic)
-
- return (
- <div className="flex-wrap">
- <span>Your results are&nbsp;</span>
- <span className="font-semibold">
- {`${
- (isSecondary ? isSecondaryMetricSignificant(metricUuid) : isPrimaryMetricSignificant(metricUuid))
- ? 'significant'
- : 'not significant'
- }`}
- .
- </span>
- </div>
- )
-}
-
-export function Overview({ metricUuid }: { metricUuid: string }): JSX.Element {
- const { legacyPrimaryMetricsResults, experiment } = useValues(experimentLogic)
-
- // Find metric index by UUID
- const index = experiment.metrics.findIndex((m) => m.uuid === metricUuid)
- const result = index >= 0 ? legacyPrimaryMetricsResults?.[index] : null
- if (!result) {
- return <></>
- }
-
- return (
- <div>
- <div className="items-center inline-flex flex-wrap">
- <WinningVariantText result={result} />
- <SignificanceText metricUuid={metricUuid} />
- </div>
- </div>
- )
-}
diff --git a/frontend/src/scenes/experiments/ExperimentView/SummaryTable.tsx b/frontend/src/scenes/experiments/ExperimentView/SummaryTable.tsx
deleted file mode 100644
index bd0c931c6984..000000000000
--- a/frontend/src/scenes/experiments/ExperimentView/SummaryTable.tsx
+++ /dev/null
@@ -1,400 +0,0 @@
-import { useValues } from 'kea'
-import posthog from 'posthog-js'
-
-import { IconInfo } from '@posthog/icons'
-import { LemonTable, LemonTableColumns, LemonTag, Tooltip } from '@posthog/lemon-ui'
-
-import { EntityFilterInfo } from 'lib/components/EntityFilterInfo'
-import ViewRecordingsPlaylistButton from 'lib/components/ViewRecordingButton/ViewRecordingsPlaylistButton'
-import { LemonProgress } from 'lib/lemon-ui/LemonProgress'
-import { humanFriendlyNumber } from 'lib/utils'
-
-import {
- ExperimentFunnelsQuery,
- ExperimentMetric,
- ExperimentTrendsQuery,
- NodeKind,
-} from '~/queries/schema/schema-general'
-import {
- FilterLogicalOperator,
- FunnelExperimentVariant,
- InsightType,
- RecordingUniversalFilters,
- TrendExperimentVariant,
-} from '~/types'
-
-import { experimentLogic } from '../experimentLogic'
-import {
- legacyCalculateDelta,
- legacyConversionRateForVariant,
- legacyCountDataForVariant,
- legacyCredibleIntervalForVariant,
- legacyExposureCountDataForVariant,
- legacyGetHighestProbabilityVariant,
-} from '../legacy/calculations/legacyExperimentCalculations'
-import { getViewRecordingFilters, getViewRecordingFiltersLegacy, isLegacyExperimentQuery } from '../utils'
-import { VariantTag } from './components'
-
-export function SummaryTable({
- metric,
- displayOrder = 0,
- isSecondary = false,
-}: {
- metric: ExperimentMetric | ExperimentTrendsQuery | ExperimentFunnelsQuery
- displayOrder?: number
- isSecondary?: boolean
-}): JSX.Element {
- const {
- experiment,
- legacyPrimaryMetricsResults,
- legacySecondaryMetricsResults,
- tabularExperimentResults,
- getInsightType,
- experimentMathAggregationForTrends,
- } = useValues(experimentLogic)
- const insightType = getInsightType(metric)
- const result = isSecondary
- ? legacySecondaryMetricsResults?.[displayOrder]
- : legacyPrimaryMetricsResults?.[displayOrder]
- if (!result) {
- return <></>
- }
-
- const winningVariant = legacyGetHighestProbabilityVariant(result)
-
- const columns: LemonTableColumns<any> = [
- {
- key: 'variants',
- title: 'Variant',
- render: function Key(_, item): JSX.Element {
- return (
- <div className="flex items-center">
- <VariantTag variantKey={item.key} />
- </div>
- )
- },
- },
- ]
-
- if (insightType === InsightType.TRENDS) {
- columns.push({
- key: 'counts',
- title: (
- <div className="flex">
- {result.insight?.[0] && 'action' in result.insight[0] && (
- <EntityFilterInfo filter={result.insight[0].action} />
- )}
- <span className="pl-1">{experimentMathAggregationForTrends() ? 'metric' : 'count'}</span>
- </div>
- ),
- render: function Key(_, variant): JSX.Element {
- const count = legacyCountDataForVariant(result, variant.key)
- if (!count) {
- return <>—</>
- }
-
- return <div className="flex">{humanFriendlyNumber(count)}</div>
- },
- })
- columns.push({
- key: 'exposure',
- title: (
- <div className="inline-flex items-center deprecated-space-x-1">
- <div className="">Exposure</div>
- <Tooltip
- title={
- <div>
- The number of users who were exposed to this variant. By default, this is measured by
- the count of <LemonTag type="option">$feature_flag_called</LemonTag> events per unique
- user. Check your metric settings to confirm how this is measured.
- </div>
- }
- >
- <IconInfo className="text-secondary text-base" />
- </Tooltip>
- </div>
- ),
- render: function Key(_, variant): JSX.Element {
- const exposure = legacyExposureCountDataForVariant(result, variant.key)
- if (!exposure) {
- return <>—</>
- }
-
- return <div>{humanFriendlyNumber(exposure)}</div>
- },
- })
- columns.push({
- key: 'mean',
- title: 'Mean',
- render: function Key(_, v): JSX.Element {
- const variant = v as TrendExperimentVariant
- if (!variant.count || !variant.absolute_exposure) {
- return <div className="font-semibold">—</div>
- }
-
- return <div className="font-semibold">{(variant.count / variant.absolute_exposure).toFixed(2)}</div>
- },
- })
- columns.push({
- key: 'delta',
- title: (
- <div className="inline-flex items-center deprecated-space-x-1">
- <div className="">Delta %</div>
- <Tooltip title="Delta % indicates the percentage change in the mean between the control and the test variant.">
- <IconInfo className="text-secondary text-base" />
- </Tooltip>
- </div>
- ),
- render: function Key(_, v): JSX.Element {
- const variant = v as TrendExperimentVariant
-
- if (variant.key === 'control') {
- return <em>Baseline</em>
- }
-
- const deltaResult = legacyCalculateDelta(result, variant.key, insightType)
- if (!deltaResult) {
- return <div className="font-semibold">—</div>
- }
-
- return (
- <div
- className={`font-semibold ${
- deltaResult.isPositive ? 'text-success' : deltaResult.deltaPercent < 0 ? 'text-danger' : ''
- }`}
- >
- {`${deltaResult.isPositive ? '+' : ''}${deltaResult.deltaPercent.toFixed(2)}%`}
- </div>
- )
- },
- })
- columns.push({
- key: 'credibleInterval',
- title: (
- <div className="inline-flex items-center deprecated-space-x-1">
- <div className="">Credible interval (95%)</div>
- <Tooltip title="A credible interval estimates the percentage change in the mean, indicating with 95% probability how much higher or lower the test variant's mean is compared to the control.">
- <IconInfo className="text-secondary text-base" />
- </Tooltip>
- </div>
- ),
- render: function Key(_, v): JSX.Element {
- const variant = v as TrendExperimentVariant
- if (variant.key === 'control') {
- return <em>Baseline</em>
- }
-
- const credibleInterval = legacyCredibleIntervalForVariant(result || null, variant.key, insightType)
- if (!credibleInterval) {
- return <>—</>
- }
- const [lowerBound, upperBound] = credibleInterval
-
- return (
- <div className="font-semibold">{`[${lowerBound > 0 ? '+' : ''}${lowerBound.toFixed(2)}%, ${
- upperBound > 0 ? '+' : ''
- }${upperBound.toFixed(2)}%]`}</div>
- )
- },
- })
- }
-
- if (insightType === InsightType.FUNNELS) {
- // NOTE: For funnel metrics on the new engine, we show exposures and converted counts in the table,
- // as we don't yet have the detailed view as we do for the legacy funnel metrics.
- if (metric.kind === NodeKind.ExperimentMetric) {
- columns.push({
- key: 'exposures',
- title: 'Exposures',
- render: function Key(_, item): JSX.Element {
- const variant = item as FunnelExperimentVariant
- const exposures = variant.success_count + variant.failure_count
- if (!exposures) {
- return <>—</>
- }
-
- return <div className="font-semibold">{humanFriendlyNumber(exposures)}</div>
- },
- })
- columns.push({
- key: 'converted',
- title: 'Converted',
- render: function Key(_, item): JSX.Element {
- const variant = item as FunnelExperimentVariant
- const converted = variant.success_count
- if (!converted) {
- return <>—</>
- }
-
- return <div className="font-semibold">{humanFriendlyNumber(converted)}</div>
- },
- })
- }
-
- columns.push({
- key: 'conversionRate',
- title: 'Conversion rate',
- render: function Key(_, item): JSX.Element {
- const conversionRate = legacyConversionRateForVariant(result, item.key)
- if (!conversionRate) {
- return <>—</>
- }
-
- return <div className="font-semibold">{`${conversionRate.toFixed(2)}%`}</div>
- },
- })
-
- columns.push({
- key: 'delta',
- title: (
- <div className="inline-flex items-center deprecated-space-x-1">
- <div className="">Delta %</div>
- <Tooltip title="Delta % indicates the percentage change in the conversion rate between the control and the test variant.">
- <IconInfo className="text-secondary text-base" />
- </Tooltip>
- </div>
- ),
- render: function Key(_, item): JSX.Element {
- if (item.key === 'control') {
- return <em>Baseline</em>
- }
-
- const controlConversionRate = legacyConversionRateForVariant(result, 'control')
- const variantConversionRate = legacyConversionRateForVariant(result, item.key)
-
- if (!controlConversionRate || !variantConversionRate) {
- return <>—</>
- }
-
- const delta = ((variantConversionRate - controlConversionRate) / controlConversionRate) * 100
-
- return (
- <div className={`font-semibold ${delta > 0 ? 'text-success' : delta < 0 ? 'text-danger' : ''}`}>{`${
- delta > 0 ? '+' : ''
- }${delta.toFixed(2)}%`}</div>
- )
- },
- })
-
- columns.push({
- key: 'credibleInterval',
- title: (
- <div className="inline-flex items-center deprecated-space-x-1">
- <div className="">Credible interval (95%)</div>
- <Tooltip title="A credible interval estimates the percentage change in the conversion rate, indicating with 95% probability how much higher or lower the test variant's conversion rate is compared to the control.">
- <IconInfo className="text-secondary text-base" />
- </Tooltip>
- </div>
- ),
- render: function Key(_, item): JSX.Element {
- if (item.key === 'control') {
- return <em>Baseline</em>
- }
-
- const credibleInterval = legacyCredibleIntervalForVariant(result || null, item.key, insightType)
- if (!credibleInterval) {
- return <>—</>
- }
- const [lowerBound, upperBound] = credibleInterval
-
- return (
- <div className="font-semibold">{`[${lowerBound > 0 ? '+' : ''}${lowerBound.toFixed(2)}%, ${
- upperBound > 0 ? '+' : ''
- }${upperBound.toFixed(2)}%]`}</div>
- )
- },
- })
- }
-
- columns.push({
- key: 'winProbability',
- title: 'Win probability',
- sorter: (a, b) => {
- const aPercentage = (result?.probability?.[a.key] || 0) * 100
- const bPercentage = (result?.probability?.[b.key] || 0) * 100
- return aPercentage - bPercentage
- },
- render: function Key(_, item): JSX.Element {
- const variantKey = item.key
- const percentage = result?.probability?.[variantKey] !== undefined && result.probability?.[variantKey] * 100
- const isWinning = variantKey === winningVariant
-
- // Only show the win probability if the conversion rate exists
- // TODO: move this to the backend
- const conversionRate = legacyConversionRateForVariant(result, variantKey)
- const hasValidConversionRate = conversionRate !== null && conversionRate !== undefined
-
- return (
- <>
- {percentage && (insightType === InsightType.FUNNELS ? hasValidConversionRate : true) ? (
- <span className="inline-flex items-center w-52 deprecated-space-x-4">
- <LemonProgress className="inline-flex w-3/4" percent={percentage} />
- <span className={`w-1/4 font-semibold ${isWinning && 'text-success'}`}>
- {percentage.toFixed(2)}%
- </span>
- </span>
- ) : (
- '—'
- )}
- </>
- )
- },
- })
-
- columns.push({
- key: 'recordings',
- title: '',
- render: function Key(_, item): JSX.Element {
- const variantKey = item.key
-
- const filters = isLegacyExperimentQuery(metric)
- ? getViewRecordingFiltersLegacy(metric, experiment.feature_flag_key, variantKey)
- : getViewRecordingFilters(experiment, metric, variantKey)
-
- const filterGroup: Partial<RecordingUniversalFilters> = {
- filter_group: {
- type: FilterLogicalOperator.And,
- values: [
- {
- type: FilterLogicalOperator.And,
- values: filters,
- },
- ],
- },
- date_from: experiment?.start_date,
- date_to: experiment?.end_date,
- filter_test_accounts:
- metric.kind === NodeKind.ExperimentMetric
- ? (experiment.exposure_criteria?.filterTestAccounts ?? false)
- : metric.kind === NodeKind.ExperimentTrendsQuery
- ? metric.count_query.filterTestAccounts
- : metric.funnels_query.filterTestAccounts,
- }
-
- return (
- <ViewRecordingsPlaylistButton
- filters={filterGroup}
- size="xsmall"
- type="secondary"
- tooltip="Watch recordings of people who were exposed to this variant."
- disabled={filters.length === 0}
- disabledReason={filters.length === 0 ? 'Unable to identify recordings for this metric' : undefined}
- data-attr="experiment-summary-view-recordings"
- onClick={() => {
- posthog.capture('viewed recordings from experiment', { variant: variantKey })
- }}
- />
- )
- },
- })
-
- return (
- <div className="mb-4" data-attr="experiment-results">
- <LemonTable
- loading={false}
- columns={columns}
- dataSource={tabularExperimentResults(displayOrder, isSecondary)}
- />
- </div>
- )
-}
diff --git a/frontend/src/scenes/experiments/ExperimentView/components.tsx b/frontend/src/scenes/experiments/ExperimentView/components.tsx
index 457885a7be09..1a6e6ece2c27 100644
--- a/frontend/src/scenes/experiments/ExperimentView/components.tsx
+++ b/frontend/src/scenes/experiments/ExperimentView/components.tsx
@@ -26,7 +26,6 @@ import {
LemonSkeleton,
LemonSwitch,
LemonTag,
- LemonTagType,
LemonTextArea,
Link,
Tooltip,
@@ -79,7 +78,7 @@ export function VariantTag({
fontSize?: number
className?: string
}): JSX.Element {
- const { experiment, legacyPrimaryMetricsResults, usesNewQueryRunner } = useValues(experimentLogic)
+ const { experiment } = useValues(experimentLogic)
if (variantKey === EXPERIMENT_VARIANT_MULTIPLE) {
return (
@@ -89,10 +88,6 @@ export function VariantTag({
)
}
- if (!legacyPrimaryMetricsResults) {
- return <></>
- }
-
const variantColor = experiment.feature_flag?.filters.multivariate?.variants
? getVariantColor(variantKey, experiment.feature_flag?.filters.multivariate?.variants)
: 'var(--text-muted)'
@@ -116,14 +111,11 @@ export function VariantTag({
return (
<span className={clsx('flex items-center min-w-0', className)}>
- {/* Only show color if using new query runner - legacy experiments are using the old funnel component */}
- {usesNewQueryRunner && (
- <div
- className="w-2 h-2 rounded-full shrink-0"
- // eslint-disable-next-line react/forbid-dom-props
- style={{ backgroundColor: variantColor }}
- />
- )}
+ <div
+ className="w-2 h-2 rounded-full shrink-0"
+ // eslint-disable-next-line react/forbid-dom-props
+ style={{ backgroundColor: variantColor }}
+ />
<span
className="ml-2 text-xs font-semibold truncate text-secondary"
// eslint-disable-next-line react/forbid-dom-props
@@ -135,40 +127,6 @@ export function VariantTag({
)
}
-export function ResultsTag({ metricUuid }: { metricUuid?: string }): JSX.Element {
- const { isPrimaryMetricSignificant, significanceDetails, experiment } = useValues(experimentLogic)
-
- // Use first primary metric UUID if not provided
- const uuid = metricUuid || experiment.metrics?.[0]?.uuid || ''
- if (!uuid) {
- return (
- <LemonTag type="primary">
- <b className="uppercase">Not significant</b>
- </LemonTag>
- )
- }
-
- const result: { color: LemonTagType; label: string } = isPrimaryMetricSignificant(uuid)
- ? { color: 'success', label: 'Significant' }
- : { color: 'primary', label: 'Not significant' }
-
- if (significanceDetails(uuid)) {
- return (
- <Tooltip title={significanceDetails(uuid)}>
- <LemonTag className="cursor-pointer" type={result.color}>
- <b className="uppercase">{result.label}</b>
- </LemonTag>
- </Tooltip>
- )
- }
-
- return (
- <LemonTag type={result.color}>
- <b className="uppercase">{result.label}</b>
- </LemonTag>
- )
-}
-
export function EllipsisAnimation(): JSX.Element {
const [ellipsis, setEllipsis] = useState('.')
const { isVisible: isPageVisible } = usePageVisibility()
diff --git a/frontend/src/scenes/experiments/experimentLogic.test.ts b/frontend/src/scenes/experiments/experimentLogic.test.ts
index 58649df02886..bdee7b887af5 100644
--- a/frontend/src/scenes/experiments/experimentLogic.test.ts
+++ b/frontend/src/scenes/experiments/experimentLogic.test.ts
@@ -149,26 +149,16 @@ describe('experimentLogic', () => {
const promise = logic.asyncActions.loadPrimaryMetricsResults(true)
- await expectLogic(logic)
- .toDispatchActions(['setPrimaryMetricsResultsLoading', 'setLegacyPrimaryMetricsResults'])
- .toMatchValues({
- legacyPrimaryMetricsResults: [],
- primaryMetricsResultsLoading: true,
- primaryMetricsResultsErrors: [],
- })
+ await expectLogic(logic).toDispatchActions(['setPrimaryMetricsResultsLoading']).toMatchValues({
+ primaryMetricsResultsLoading: true,
+ primaryMetricsResultsErrors: [],
+ })
await promise
await expectLogic(logic)
.toDispatchActions(['setPrimaryMetricsResultsLoading'])
.toMatchValues({
- legacyPrimaryMetricsResults: [
- {
- ...experimentMetricResultsSuccessJson.query_status.results,
- fakeInsightId: expect.any(String),
- },
- null,
- ],
primaryMetricsResultsLoading: false,
primaryMetricsResultsErrors: [
null,
@@ -227,26 +217,16 @@ describe('experimentLogic', () => {
const promise = logic.asyncActions.loadSecondaryMetricsResults(true)
- await expectLogic(logic)
- .toDispatchActions(['setSecondaryMetricsResultsLoading', 'setLegacySecondaryMetricsResults'])
- .toMatchValues({
- legacySecondaryMetricsResults: [],
- secondaryMetricsResultsLoading: true,
- secondaryMetricsResultsErrors: [],
- })
+ await expectLogic(logic).toDispatchActions(['setSecondaryMetricsResultsLoading']).toMatchValues({
+ secondaryMetricsResultsLoading: true,
+ secondaryMetricsResultsErrors: [],
+ })
await promise
await expectLogic(logic)
.toDispatchActions(['setSecondaryMetricsResultsLoading'])
.toMatchValues({
- legacySecondaryMetricsResults: [
- null,
- {
- ...experimentMetricResultsSuccessJson.query_status.results,
- fakeInsightId: expect.any(String),
- },
- ],
secondaryMetricsResultsLoading: false,
secondaryMetricsResultsErrors: [
{
@@ -294,16 +274,9 @@ describe('experimentLogic', () => {
await logic.asyncActions.refreshExperimentResults(true, 'manual')
+ // Verify loading states are properly reset after refresh completes
expect(logic.values.primaryMetricsResultsLoading).toBe(false)
expect(logic.values.secondaryMetricsResultsLoading).toBe(false)
-
- const successfulCount =
- logic.values.legacyPrimaryMetricsResults.filter(Boolean).length +
- logic.values.primaryMetricsResults.filter(Boolean).length +
- logic.values.legacySecondaryMetricsResults.filter(Boolean).length +
- logic.values.secondaryMetricsResults.filter(Boolean).length
-
- expect(successfulCount).toBeGreaterThan(0)
})
})
diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsx
index 452352129567..5243ec7196f2 100644
--- a/frontend/src/scenes/experiments/experimentLogic.tsx
+++ b/frontend/src/scenes/experiments/experimentLogic.tsx
@@ -36,10 +36,7 @@ import { QUERY_TIMEOUT_ERROR_MESSAGE, performQuery } from '~/queries/query'
import {
AnyEntityNode,
Breakdown,
- CachedExperimentFunnelsQueryResponse,
CachedExperimentQueryResponse,
- CachedExperimentTrendsQueryResponse,
- CachedLegacyExperimentQueryResponse,
CachedNewExperimentQueryResponse,
ExperimentExposureCriteria,
ExperimentExposureQueryResponse,
@@ -66,11 +63,9 @@ import {
ExperimentConclusion,
ExperimentStatsMethod,
FeatureFlagType,
- FunnelExperimentVariant,
InsightType,
MultivariateFlagVariant,
PropertyMathType,
- TrendExperimentVariant,
} from '~/types'
import {
@@ -89,9 +84,7 @@ import {
} from './experimentsLogic'
import { holdoutsLogic } from './holdoutsLogic'
import {
- legacyConversionRateForVariant,
legacyExpectedRunningTime,
- legacyGetSignificanceDetails,
legacyMinimumSampleSizePerVariant,
legacyRecommendedExposureForCountData,
} from './legacy/calculations/legacyExperimentCalculations'
@@ -234,14 +227,6 @@ interface MetricLoadingConfig {
metricIndexOffset: number
orderedUuids?: string[] | null
featureFlags: FeatureFlagsSet
- onSetLegacyResults: (
- results: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentTrendsQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | null
- )[]
- ) => void
onSetResults: (results: CachedNewExperimentQueryResponse[]) => void
onSetErrors: (errors: any[]) => void
}
@@ -417,17 +402,9 @@ const loadMetrics = async ({
metricIndexOffset,
orderedUuids,
featureFlags,
- onSetLegacyResults,
onSetResults,
onSetErrors,
}: MetricLoadingConfig): Promise<MetricLoadingSummary> => {
- const legacyResults: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentTrendsQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | null
- )[] = []
-
const results: CachedNewExperimentQueryResponse[] = []
const currentErrors = new Array(metrics.length).fill(null)
@@ -448,18 +425,10 @@ const loadMetrics = async ({
const metricKind = metric.kind || 'unknown'
try {
- let queryWithExperimentId
- if (metric.kind === NodeKind.ExperimentMetric) {
- queryWithExperimentId = {
- kind: NodeKind.ExperimentQuery,
- metric: metric,
- experiment_id: experimentId,
- }
- } else {
- queryWithExperimentId = {
- ...metric,
- experiment_id: experimentId,
- }
+ const queryWithExperimentId = {
+ kind: NodeKind.ExperimentQuery,
+ metric: metric,
+ experiment_id: experimentId,
}
response = await performQuery(
setLatestVersionsOnQuery(queryWithExperimentId),
@@ -470,32 +439,9 @@ const loadMetrics = async ({
const durationMs = Math.round(performance.now() - startTime)
const isCached = !!response?.is_cached
- // Convert ExperimentQuery responses to typed responses
- if (
- metric.kind === NodeKind.ExperimentMetric ||
- queryWithExperimentId.kind === NodeKind.ExperimentQuery
- ) {
- const typedResponse = convertToTypedExperimentResponse(response as CachedExperimentQueryResponse)
- if (typedResponse) {
- if (isLegacyExperimentResponse(typedResponse)) {
- legacyResults[originalIndex] = {
- ...typedResponse,
- fakeInsightId: Math.random().toString(36).substring(2, 15),
- } as CachedLegacyExperimentQueryResponse & { fakeInsightId: string }
- } else if (isNewExperimentResponse(typedResponse)) {
- results[originalIndex] = typedResponse
- }
- }
- } else {
- // For trends/funnels queries, keep original response
- legacyResults[originalIndex] = {
- ...response,
- fakeInsightId: Math.random().toString(36).substring(2, 15),
- } as (CachedExperimentTrendsQueryResponse | CachedExperimentFunnelsQueryResponse) & {
- fakeInsightId: string
- }
+ if (isNewExperimentResponse(response as CachedExperimentQueryResponse)) {
+ results[originalIndex] = response as CachedNewExperimentQueryResponse
}
- onSetLegacyResults([...legacyResults])
onSetResults([...results])
successfulCount++
@@ -559,8 +505,6 @@ const loadMetrics = async ({
status_code: statusCode,
})
- legacyResults[originalIndex] = null
- onSetLegacyResults([...legacyResults])
onSetResults([...results])
}
}
@@ -571,36 +515,12 @@ const loadMetrics = async ({
return { successfulCount, erroredCount, cachedCount }
}
-// Type guards to distinguish between legacy and new experiment responses
-export function isLegacyExperimentResponse(
- response: CachedExperimentQueryResponse
-): response is CachedLegacyExperimentQueryResponse {
- return 'variants' in response && response.variants !== null
-}
-
export function isNewExperimentResponse(
response: CachedExperimentQueryResponse
): response is CachedNewExperimentQueryResponse {
return 'baseline' in response && response.baseline !== null
}
-// Union type for strongly typed experiment responses
-export type TypedExperimentResponse = CachedLegacyExperimentQueryResponse | CachedNewExperimentQueryResponse
-
-// Utility function to convert generic response to typed response
-function convertToTypedExperimentResponse(response: CachedExperimentQueryResponse): TypedExperimentResponse | null {
- if (isLegacyExperimentResponse(response)) {
- return response
- }
-
- if (isNewExperimentResponse(response)) {
- return response
- }
-
- // If response doesn't match either pattern, return null
- return null
-}
-
const sharedMetricsToExperimentMetrics = (
sharedMetrics: ExperimentSavedMetric[],
type: 'primary' | 'secondary'
@@ -849,14 +769,6 @@ export const experimentLogic = kea<experimentLogicType>([
removeMetricBreakdown: (uuid: string, index: number, breakdown: Breakdown) => ({ uuid, index, breakdown }),
// METRICS RESULTS
clearMetricsResults: true,
- setLegacyPrimaryMetricsResults: (
- results: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentTrendsQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | null
- )[]
- ) => ({ results }),
setPrimaryMetricsResults: (results: CachedNewExperimentQueryResponse[]) => ({ results }),
setPrimaryMetricsResultsLoading: (loading: boolean) => ({ loading }),
loadPrimaryMetricsResults: (refresh?: boolean, refreshId?: string) => ({ refresh, refreshId }),
@@ -867,14 +779,6 @@ export const experimentLogic = kea<experimentLogicType>([
setSecondaryMetricsResultsErrors: (errors: any[]) => ({ errors }),
retrySecondaryMetric: (index: number) => ({ index }),
setSecondaryMetricsResultsLoading: (loading: boolean) => ({ loading }),
- setLegacySecondaryMetricsResults: (
- results: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentTrendsQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | null
- )[]
- ) => ({ results }),
updateDistribution: (variants: MultivariateFlagVariant[], rolloutPercentage?: number) => ({
variants,
rolloutPercentage,
@@ -1198,18 +1102,6 @@ export const experimentLogic = kea<experimentLogicType>([
},
],
// PRIMARY METRICS
- legacyPrimaryMetricsResults: [
- [] as (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentTrendsQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | null
- )[],
- {
- setLegacyPrimaryMetricsResults: (_, { results }) => results,
- clearMetricsResults: () => [],
- },
- ],
primaryMetricsResults: [
[] as CachedNewExperimentQueryResponse[],
{
@@ -1235,18 +1127,6 @@ export const experimentLogic = kea<experimentLogicType>([
},
],
// SECONDARY METRICS
- legacySecondaryMetricsResults: [
- [] as (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentTrendsQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | null
- )[],
- {
- setLegacySecondaryMetricsResults: (_, { results }) => results,
- clearMetricsResults: () => [],
- },
- ],
secondaryMetricsResults: [
[] as CachedNewExperimentQueryResponse[],
{
@@ -2072,7 +1952,6 @@ export const experimentLogic = kea<experimentLogicType>([
},
loadPrimaryMetricsResults: async ({ refresh, refreshId }: { refresh?: boolean; refreshId?: string }) => {
actions.setPrimaryMetricsResultsLoading(true)
- actions.setLegacyPrimaryMetricsResults([])
actions.setPrimaryMetricsResults([])
const sharedMetrics: ExperimentMetric[] = sharedMetricsToExperimentMetrics(
@@ -2094,7 +1973,6 @@ export const experimentLogic = kea<experimentLogicType>([
metricIndexOffset: 0,
orderedUuids: values.experiment?.primary_metrics_ordered_uuids,
featureFlags: values.featureFlags,
- onSetLegacyResults: actions.setLegacyPrimaryMetricsResults,
onSetResults: actions.setPrimaryMetricsResults,
onSetErrors: actions.setPrimaryMetricsResultsErrors,
})
@@ -2113,7 +1991,6 @@ export const experimentLogic = kea<experimentLogicType>([
},
loadSecondaryMetricsResults: async ({ refresh, refreshId }: { refresh?: boolean; refreshId?: string }) => {
actions.setSecondaryMetricsResultsLoading(true)
- actions.setLegacySecondaryMetricsResults([])
actions.setSecondaryMetricsResults([])
const sharedMetrics: ExperimentMetric[] = sharedMetricsToExperimentMetrics(
@@ -2134,7 +2011,6 @@ export const experimentLogic = kea<experimentLogicType>([
metricIndexOffset: 0,
orderedUuids: values.experiment?.secondary_metrics_ordered_uuids,
featureFlags: values.featureFlags,
- onSetLegacyResults: actions.setLegacySecondaryMetricsResults,
onSetResults: actions.setSecondaryMetricsResults,
onSetErrors: actions.setSecondaryMetricsResultsErrors,
})
@@ -2168,7 +2044,6 @@ export const experimentLogic = kea<experimentLogicType>([
// Create single-item arrays for this metric
const singleMetricArray = [metricToRetry]
- const currentLegacyResults = [...values.legacyPrimaryMetricsResults]
const currentResults = [...values.primaryMetricsResults]
// Load just this one metric
@@ -2182,10 +2057,6 @@ export const experimentLogic = kea<experimentLogicType>([
isRetry: true,
metricIndexOffset: index,
featureFlags: values.featureFlags,
- onSetLegacyResults: (results) => {
- currentLegacyResults[index] = results[0]
- actions.setLegacyPrimaryMetricsResults(currentLegacyResults)
- },
onSetResults: (results) => {
currentResults[index] = results[0]
actions.setPrimaryMetricsResults(currentResults)
@@ -2217,7 +2088,6 @@ export const experimentLogic = kea<experimentLogicType>([
// Create single-item arrays for this metric
const singleMetricArray = [metricToRetry]
- const currentLegacyResults = [...values.legacySecondaryMetricsResults]
const currentResults = [...values.secondaryMetricsResults]
// Load just this one metric
@@ -2231,10 +2101,6 @@ export const experimentLogic = kea<experimentLogicType>([
isRetry: true,
metricIndexOffset: index,
featureFlags: values.featureFlags,
- onSetLegacyResults: (results) => {
- currentLegacyResults[index] = results[0]
- actions.setLegacySecondaryMetricsResults(currentLegacyResults)
- },
onSetResults: (results) => {
currentResults[index] = results[0]
actions.setSecondaryMetricsResults(currentResults)
@@ -2564,80 +2430,6 @@ export const experimentLogic = kea<experimentLogicType>([
return newExperiment?.parameters?.minimum_detectable_effect ?? DEFAULT_MDE
},
],
- isPrimaryMetricSignificant: [
- (s) => [s.legacyPrimaryMetricsResults, s.experiment],
- (
- legacyPrimaryMetricsResults: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | CachedExperimentTrendsQueryResponse
- | null
- )[],
- experiment: Experiment
- ) =>
- (metricUuid: string): boolean => {
- // Find metric index by UUID
- const index = experiment.metrics.findIndex((m) => m.uuid === metricUuid)
- if (index === -1) {
- return false
- }
-
- const result = legacyPrimaryMetricsResults?.[index]
- if (!result) {
- return false
- }
-
- return result.significant || false
- },
- ],
- isSecondaryMetricSignificant: [
- (s) => [s.legacySecondaryMetricsResults, s.experiment],
- (
- legacySecondaryMetricsResults: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | CachedExperimentTrendsQueryResponse
- | null
- )[],
- experiment: Experiment
- ) =>
- (metricUuid: string): boolean => {
- // Find metric index by UUID
- const index = experiment.metrics_secondary.findIndex((m) => m.uuid === metricUuid)
- if (index === -1) {
- return false
- }
-
- const result = legacySecondaryMetricsResults?.[index]
- if (!result) {
- return false
- }
-
- return result.significant || false
- },
- ],
- significanceDetails: [
- (s) => [s.legacyPrimaryMetricsResults, s.experiment],
- (
- legacyPrimaryMetricsResults: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | CachedExperimentTrendsQueryResponse
- | null
- )[],
- experiment: Experiment
- ) =>
- (metricUuid: string): string => {
- // Find metric index by UUID
- const index = experiment.metrics.findIndex((m) => m.uuid === metricUuid)
- if (index === -1) {
- return ''
- }
-
- const results = legacyPrimaryMetricsResults?.[index]
- return legacyGetSignificanceDetails(results)
- },
- ],
recommendedSampleSize: [
(s) => [s.conversionMetrics, s.variants, s.minimumDetectableEffect],
(conversionMetrics, variants, minimumDetectableEffect): number => {
@@ -2696,151 +2488,6 @@ export const experimentLogic = kea<experimentLogicType>([
return runningTime
},
],
- tabularExperimentResults: [
- (s) => [s.experiment, s.legacyPrimaryMetricsResults, s.legacySecondaryMetricsResults, s.getInsightType],
- (
- experiment,
- legacyPrimaryMetricsResults: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | CachedExperimentTrendsQueryResponse
- | null
- )[],
- legacySecondaryMetricsResults: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | CachedExperimentTrendsQueryResponse
- | null
- )[],
- getInsightType
- ) =>
- (metricIdentifier: number | string = 0, isSecondary: boolean = false): any[] => {
- let index: number
- if (typeof metricIdentifier === 'string') {
- // Find index by UUID
- const metrics = isSecondary ? experiment.metrics_secondary : experiment.metrics
- index = metrics.findIndex((m) => m.uuid === metricIdentifier)
- if (index === -1) {
- return []
- }
- } else {
- index = metricIdentifier
- }
-
- const tabularResults = []
- const metricType = isSecondary
- ? getInsightType(experiment.metrics_secondary[index])
- : getInsightType(experiment.metrics[index])
- const result = isSecondary
- ? legacySecondaryMetricsResults[index]
- : legacyPrimaryMetricsResults[index]
-
- if (result) {
- for (const variantObj of result.variants) {
- if (metricType === InsightType.FUNNELS) {
- const { key, success_count, failure_count } = variantObj as FunnelExperimentVariant
- tabularResults.push({ key, success_count, failure_count })
- } else if (metricType === InsightType.TRENDS) {
- const { key, count, exposure, absolute_exposure } = variantObj as TrendExperimentVariant
- tabularResults.push({ key, count, exposure, absolute_exposure })
- }
- }
- }
-
- if (experiment.feature_flag?.filters.multivariate?.variants) {
- for (const { key } of experiment.feature_flag.filters.multivariate.variants) {
- if (tabularResults.find((variantObj) => variantObj.key === key)) {
- continue
- }
-
- if (metricType === InsightType.FUNNELS) {
- tabularResults.push({ key, success_count: null, failure_count: null })
- } else if (metricType === InsightType.TRENDS) {
- tabularResults.push({ key, count: null, exposure: null, absolute_exposure: null })
- }
- }
- }
-
- return tabularResults
- },
- ],
- sortedWinProbabilities: [
- (s) => [s.legacyPrimaryMetricsResults, s.experiment],
- (
- legacyPrimaryMetricsResults: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | CachedExperimentTrendsQueryResponse
- | null
- )[],
- experiment: Experiment
- ) =>
- (metricIdentifier: number | string = 0) => {
- let index: number
- if (typeof metricIdentifier === 'string') {
- // Find index by UUID
- index = experiment.metrics.findIndex((m) => m.uuid === metricIdentifier)
- if (index === -1) {
- return []
- }
- } else {
- index = metricIdentifier
- }
-
- const result = legacyPrimaryMetricsResults?.[index]
-
- if (!result) {
- return []
- }
-
- return Object.keys(result.probability)
- .map((key) => ({
- key,
- winProbability: result.probability[key],
- conversionRate: legacyConversionRateForVariant(result, key),
- }))
- .sort((a, b) => b.winProbability - a.winProbability)
- },
- ],
- funnelResultsPersonsTotal: [
- (s) => [s.experiment, s.legacyPrimaryMetricsResults, s.getInsightType],
- (
- experiment,
- legacyPrimaryMetricsResults: (
- | CachedLegacyExperimentQueryResponse
- | CachedExperimentFunnelsQueryResponse
- | CachedExperimentTrendsQueryResponse
- | null
- )[],
- getInsightType
- ) =>
- (metricIdentifier: number | string = 0): number => {
- let index: number
- if (typeof metricIdentifier === 'string') {
- // Find index by UUID
- index = experiment.metrics.findIndex((m) => m.uuid === metricIdentifier)
- if (index === -1) {
- return 0
- }
- } else {
- index = metricIdentifier
- }
-
- const result = legacyPrimaryMetricsResults?.[index]
-
- if (getInsightType(experiment.metrics[index]) !== InsightType.FUNNELS || !result) {
- return 0
- }
-
- let sum = 0
- result.insight.forEach((variantResult) => {
- if (variantResult[0]?.count) {
- sum += variantResult[0].count
- }
- })
- return sum
- },
- ],
actualRunningTime: [
(s) => [s.experiment],
(experiment: Experiment): number => {
diff --git a/frontend/src/scenes/experiments/legacy/components/LegacySummaryTable.tsx b/frontend/src/scenes/experiments/legacy/components/LegacySummaryTable.tsx
index 567f0439f555..eae124577120 100644
--- a/frontend/src/scenes/experiments/legacy/components/LegacySummaryTable.tsx
+++ b/frontend/src/scenes/experiments/legacy/components/LegacySummaryTable.tsx
@@ -29,7 +29,6 @@ import { FilterLogicalOperator, InsightType, RecordingUniversalFilters, TrendExp
/**
* @deprecated
* This component supports legacy experiment metrics (ExperimentTrendsQuery/ExperimentFunnelsQuery).
- * For new experiments, use the modern SummaryTable component.
*/
export function LegacySummaryTable({
metric,
diff --git a/frontend/src/scenes/experiments/legacy/metricsView/LegacyOverview.tsx b/frontend/src/scenes/experiments/legacy/metricsView/LegacyOverview.tsx
index cf68ccd1b761..50e487a9c25c 100644
--- a/frontend/src/scenes/experiments/legacy/metricsView/LegacyOverview.tsx
+++ b/frontend/src/scenes/experiments/legacy/metricsView/LegacyOverview.tsx
@@ -91,7 +91,6 @@ export function LegacySignificanceText({
/**
* @deprecated
- * Use the Overview component from the experimentLogic instead.
*/
export function LegacyOverview({ metricUuid }: { metricUuid: string }): JSX.Element {
const { legacyPrimaryMetricsResults, experiment } = useValues(legacyExperimentLogic)
diff --git a/frontend/src/scenes/notebooks/Nodes/NotebookNodeExperiment.tsx b/frontend/src/scenes/notebooks/Nodes/NotebookNodeExperiment.tsx
index eb9925805343..072056b097de 100644
--- a/frontend/src/scenes/notebooks/Nodes/NotebookNodeExperiment.tsx
+++ b/frontend/src/scenes/notebooks/Nodes/NotebookNodeExperiment.tsx
@@ -8,10 +8,8 @@ import { NotFound } from 'lib/components/NotFound'
import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { experimentLogic } from 'scenes/experiments/experimentLogic'
import { getExperimentStatus } from 'scenes/experiments/experimentsLogic'
-import { ResultsTag, StatusTag } from 'scenes/experiments/ExperimentView/components'
+import { StatusTag } from 'scenes/experiments/ExperimentView/components'
import { Info } from 'scenes/experiments/ExperimentView/Info'
-import { SummaryTable } from 'scenes/experiments/ExperimentView/SummaryTable'
-import { LegacyResultsQuery } from 'scenes/experiments/legacy'
import { createPostHogWidgetNode } from 'scenes/notebooks/Nodes/NodeWrapper'
import { urls } from 'scenes/urls'
@@ -22,8 +20,7 @@ import { INTEGER_REGEX_MATCH_GROUPS, OPTIONAL_PROJECT_NON_CAPTURE_GROUP } from '
const Component = ({ attributes }: NotebookNodeProps<NotebookNodeExperimentAttributes>): JSX.Element => {
const { id } = attributes
- const { experiment, experimentLoading, experimentMissing, isExperimentLaunched, legacyPrimaryMetricsResults } =
- useValues(experimentLogic({ experimentId: id }))
+ const { experiment, experimentLoading, experimentMissing } = useValues(experimentLogic({ experimentId: id }))
const { loadExperiment } = useActions(experimentLogic({ experimentId: id }))
const { expanded } = useValues(notebookNodeLogic)
const { insertAfter, setActions } = useActions(notebookNodeLogic)
@@ -46,10 +43,6 @@ const Component = ({ attributes }: NotebookNodeProps<NotebookNodeExperimentAttri
return <NotFound object="experiment" />
}
- if (!legacyPrimaryMetricsResults) {
- return <></>
- }
-
return (
<div>
<BindLogic logic={experimentLogic} props={{ experimentId: id }}>
@@ -61,7 +54,6 @@ const Component = ({ attributes }: NotebookNodeProps<NotebookNodeExperimentAttri
<>
<span className="flex-1 font-semibold truncate">{experiment.name}</span>
<StatusTag status={getExperimentStatus(experiment)} />
- <ResultsTag />
</>
)}
</div>
@@ -82,23 +74,6 @@ const Component = ({ attributes }: NotebookNodeProps<NotebookNodeExperimentAttri
</div>
</>
)}
- {isExperimentLaunched && (
- <>
- <LemonDivider className="my-0" />
- <div className="p-2">
- <SummaryTable metric={experiment.metrics[0]} />
- {/* TODO: Only show results if the metric is a trends or funnels query. Not supported yet with new query runner */}
- {legacyPrimaryMetricsResults[0] &&
- (legacyPrimaryMetricsResults[0].kind === 'ExperimentTrendsQuery' ||
- legacyPrimaryMetricsResults[0].kind === 'ExperimentFunnelsQuery') && (
- <LegacyResultsQuery
- result={legacyPrimaryMetricsResults[0]}
- showTable={true}
- />
- )}
- </div>
- </>
- )}
</>
) : null}
</BindLogic>