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(experiments): Show result on experiments table (#57607)

Juraj Majerik0d01fd7b074d
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index bf57edd88977..4d2160071eb9 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -4031,9 +4031,9 @@ snapshots:
scenes-app-experiments--experiment-with-ratio-metric--light:
hash: v1.k794b7964.d8c33af48cb894f69c91bde6dff75fc4279bf91a1ffee6f7e9956db5d7594781.6gjRH8VDuIQUrXNgOPoZLU22d0dw8iEJSeVYJFawxac
scenes-app-experiments--experiments--dark:
- hash: v1.k794b7964.02cd09f4db8a34befa4ad20fba22f462301888e83bba0649d89a8ebe99b55901.pbzu6t-_JTPu665deXyeXVjeTLogXIAi5Mbm0hFLiMg
+ hash: v1.k794b7964.9c7c17e7ad0199de236f943126caa18c0f77f6a58348a167b9ee6b490e471568.mA00PRaPqtI0ClPEjQLkWHnDDiwBO1QNeqZAzrYnQc8
scenes-app-experiments--experiments--light:
- hash: v1.k794b7964.c3ef6e76fcd3ca5b4a450071951262f41361900dda11d9f2775851c4140bc114.z58BHK8e2mux0Imu6ItlXYuQxXDpBnbFfYNyBaKwaDk
+ hash: v1.k794b7964.66bf95e39a1394d44c0b441a8b223ab596810bce842926f8300595a043f827ad.AW8Nm6LO-qKDA48HZJdTQfpE1DJf6pfZK-SsjGuPT1k
scenes-app-feature-flags--edit-encrypted-remote-config-feature-flag--dark:
hash: v1.k794b7964.2b2645964823bde57c99f57d88bbf95d1b7aeaab346461aaa568fb9c8b0a461a._3VwJMKpJqMQRVatfYe6k695BVaNd6ZulDeta7gt_nA
scenes-app-feature-flags--edit-encrypted-remote-config-feature-flag--light:
diff --git a/frontend/src/scenes/experiments/Experiments.tsx b/frontend/src/scenes/experiments/Experiments.tsx
index b7bdb57954b3..ff0df4b03d7b 100644
--- a/frontend/src/scenes/experiments/Experiments.tsx
+++ b/frontend/src/scenes/experiments/Experiments.tsx
@@ -1,3 +1,4 @@
+import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { router } from 'kea-router'
import { useState } from 'react'
@@ -39,10 +40,12 @@ import {
AccessControlResourceType,
ActivityScope,
Experiment,
+ ExperimentConclusion,
ExperimentStatus,
ExperimentsTabs,
} from '~/types'
+import { CONCLUSION_DISPLAY_CONFIG } from './constants'
import { CopyExperimentToProjectModal } from './CopyExperimentToProjectModal'
import { DuplicateExperimentModal } from './DuplicateExperimentModal'
import { canArchiveExperiment, confirmArchiveExperiment, confirmDeleteExperiment } from './experimentActions'
@@ -335,6 +338,40 @@ const ExperimentsTable = ({
return score[statusA] > score[statusB] ? 1 : -1
},
},
+ {
+ title: 'Result',
+ key: 'conclusion',
+ render: function Render(_, experiment: Experiment) {
+ if (!experiment.conclusion) {
+ return <span className="text-secondary">—</span>
+ }
+ const config = CONCLUSION_DISPLAY_CONFIG[experiment.conclusion]
+ const tooltip = experiment.conclusion_comment
+ ? `${config.description} — ${experiment.conclusion_comment}`
+ : config.description
+ return (
+ <Tooltip title={tooltip}>
+ <div className="flex items-center gap-2 cursor-default">
+ <div className={clsx('w-2 h-2 rounded-full', config.color)} />
+ <span className="font-medium">{config.title}</span>
+ </div>
+ </Tooltip>
+ )
+ },
+ align: 'left',
+ sorter: (a, b) => {
+ const conclusionScore: Record<ExperimentConclusion, number> = {
+ [ExperimentConclusion.Won]: 1,
+ [ExperimentConclusion.Lost]: 2,
+ [ExperimentConclusion.Inconclusive]: 3,
+ [ExperimentConclusion.StoppedEarly]: 4,
+ [ExperimentConclusion.Invalid]: 5,
+ }
+ const aScore = a.conclusion ? conclusionScore[a.conclusion] : 6
+ const bScore = b.conclusion ? conclusionScore[b.conclusion] : 6
+ return aScore - bScore
+ },
+ },
{
width: 0,
render: function Render(_, experiment: Experiment) {