: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): show health findings in one panel (#113732)
Marcel Poelker9839e15a3f71
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex c00e51bc30d6..5faa438c2564 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -10155,169 +10155,173 @@ snapshots:scenes-app-events-mcp-tool-calls--mcp-tool-calls--light:hash: v1.k794b7964.a70db27155e0ba6979890a1d3b328a91d7f2cae9e89d37cb7346fa2d79aaec6d.ybMAg6DfJ6iwBrtLWjqVo9qC-a412ihqd6H6KiAYkgcscenes-app-experiments--draft-experiment--dark:- hash: v1.k794b7964.7c59ca54afcd73d10c29d9a0c48840fc25b7ce8ff3e98f364a0f5b41d6970540.5yFKLoLG68uVzxl6VegqEVbccgtpqiXLQrOVmcft2iU+ hash: v1.k794b7964.8567c7de46a276827ae397d60c8f8212d1489413aa8cde4349373904b5f0a1f2.1Zas9UmpkjXnqKch9wSTqnVYPk96zd_AxDjW5ErgedAscenes-app-experiments--draft-experiment--light:- hash: v1.k794b7964.a11383b23d57f11e3546c79f003e82aa4446b79066d8c64e53712246d53f1923.XFfY1pqa526biFd8qW3mJu92pY3fgadcZa5PgxMwTrM+ hash: v1.k794b7964.b50208dcd673a881bd8ea9be4aefbfb7312d548397f800b8450ad54be5efca4c.zEPA7Gg8lrCW6B9bBy_JJAJsQEhYavo84v0Xlt6mTNsscenes-app-experiments--experiment-asymmetric-intervals--dark:- hash: v1.k794b7964.55da810b9023d29f594bbcc6dcdfc61efaf917fa80998f38ac0905398027b850.24OzWlGjsOrKFLgpjGoxNGxAoDOkt0jzZqpwPciYQrk+ hash: v1.k794b7964.9503cb8e56ec366b3af2944fe7cf817676397a17eed8c02d4673da57369db86f.crkLxn1p_Mt5h9pk5DKd29I8rbKJ0q8PnDW8swxR5osscenes-app-experiments--experiment-asymmetric-intervals--light:- hash: v1.k794b7964.1333515d02b39ded5908bd47c578f5c2db86ab6895b708b9b0cf7c0f343cfe0c.SaPgNDD5-xmPYtDYIKM09CVXN5WmlM0D6digFgnSIoU+ hash: v1.k794b7964.46dff0e253905ccd87ea57330cd95e07e608780586ada07cdf68ea2f551ecb09.rdV9qyoU3V0ARSj4xvOT1oxxqpMwzbz4WT95BxOxxlgscenes-app-experiments--experiment-code-tab--dark:- hash: v1.k794b7964.978c1007dc3c6e994b34b5509f3f9897908aa70d0f5b02333d11358a9df855e6.NrOXbsz_2Be9oSfuEDI6WzIi15CRsLGs3P_T6SXFG78+ hash: v1.k794b7964.0e2072f498c7478351096512b75aa069d4430f33272df347f48f9669b04e9f29.WQ5XMHuX8JRqT_Njy7AkPqLo1aqQyj8qkm2Ao7GV7MUscenes-app-experiments--experiment-code-tab--light:- hash: v1.k794b7964.d70b268e159d9a42c627da0ef66e9dcd9280e9d8db5e9097dc243b1d985f8973.nnln_ZV5GUDHF-buc3NQjxQjxHQK5f8CAle9bfodCic+ hash: v1.k794b7964.56dc513e8e16389385eee4851364c1665014fbc00a56dafd55a3fbb48f9b30ea.gu2gM8R5ufbtCONKIeQw-ep-T3BCjdew13Ft40J1lFYscenes-app-experiments--experiment-exposures-expanded--dark:- hash: v1.k794b7964.c7126a10e93eecac9f562a68945c1d6d7669f4d426250199256ee68b5a555185.hufODDyz8jq-ARkOtPYbpE5gLG7hVvwg_ADS8js9uNY+ hash: v1.k794b7964.2476671a4fbbb6261c27f774dd8c4a8ccf80ebe4c4462fefc7f54234d8236b33.iOam7pLvhu7bWiF6w_54GtS9K_LEZ_RVCximpiMbcJoscenes-app-experiments--experiment-exposures-expanded--light:- hash: v1.k794b7964.e95307b2243c27d8bb2c544948ef787ef2532a11561d9ebef871ee4d6036da48.J6I6LicBziaTBtc3ySyjfoFRSLzRsDDhvEMUhoDlTuE+ hash: v1.k794b7964.fcaf67bc1777521eb74db5169bf6c11b2aad41650634ac76dc53f87b8859e795.0N7NO_E6XT8j0BBo3VpuhxGB_8dIx6EV40vP9LO27T4scenes-app-experiments--experiment-frequentist-five-variants--dark:- hash: v1.k794b7964.096eb2cf79eb7c41adaf9dcd41cc32c21743b9ae319069fc62d6db5c9a16036b.cZpNYCBl70Ung05nUW7yhjovnZLziU7vZq4QQX7iiTc+ hash: v1.k794b7964.e32d9f697604eea7a395a501d41188e830cfc88acb4c35f5095cf59bd9ffb9ce.kxaATmTJfthmg3nWXmONx8j15fVy5VOzHxWYJv8P_1Ascenes-app-experiments--experiment-frequentist-five-variants--light:- hash: v1.k794b7964.6eb0e8b464ed1c8502aea92b39be8730c428543f0d6c6ef39396b7723952f512.f3vJ7foRbcQmlmbb9pYTZ-TGnTNFdxT7JIfToeMvjZg+ hash: v1.k794b7964.b3d31fe5db1ec92976982048eba355a17f3515dc7b0bc88f03be82645fd8098f.eMQi51Xwi7Oyo7G3Vm0ACwx38TJw41AZrF4hmUUFKLUscenes-app-experiments--experiment-frequentist-two-variants--dark:- hash: v1.k794b7964.04a8c78dc592ece25384e6cdc0d58389c845f9620fa65d9dd45847e04364286a.vKOKP3PtZZXbwA31A7LsCjkJcDiTMbQlE4-oRuvl7JM+ hash: v1.k794b7964.a25f6387d22c77967cb2b9acfe1648dd07722e2d0ed45644f3fe62faf54a2b29.-XavqItCBU9Ig1IyH-rs_pnCy0QSIQWOqL34B5Nv9O4scenes-app-experiments--experiment-frequentist-two-variants--light:- hash: v1.k794b7964.9278002f0b2f51a5b9cf3bc231cda6c0eeb264135edac3c8824e897b7bf9c9ef.9e9kjnW5qZAebD4qhBW8WTn8YyqAJuI0jlkKsiZVrAc+ hash: v1.k794b7964.2e358d97599c5befaf03b527d6c987a029ff751224c6253104b58406d8cf18cc.sqZ2G8jf9EhH06ykGB3pF55Po8NN9c2h0Wnuh1Y6MFAscenes-app-experiments--experiment-recordings-dropped-metric--dark:- hash: v1.k794b7964.a16e4b7300a094f7782cc6c79b8bf5373f6949f97c47c195e1120945dd1d3395.Zfr6BE8lWgqrCzeizij6xgAxtxSPJgAuNP2UMima5IM+ hash: v1.k794b7964.d0a971d779cfbcdb7646843226b1bb67d53a3b780f976604c69c0d52b899d01f.h7g8p5li7J1eNxa54I9U0RF3d03oLiHNA6nrCJXmSS8scenes-app-experiments--experiment-recordings-dropped-metric--light:- hash: v1.k794b7964.26b5890dd4e9f3b17fe38c20e308091e7fb9650beeb9387259b5e0220f46a70a.NMROBp4_ceN_24NJ0_CcMU1OHS8du6WB46xJL-moqAk+ hash: v1.k794b7964.7b1f718f5485ea38d28ada5c2b1e1051b55318c8a0e94903e107416784a548b5.3my93FvNVpcUOp0kunTd0ww8_a7Jo2Zd7HMGPSA96jUscenes-app-experiments--experiment-recordings-dropped-metric-narrow--dark:- hash: v1.k794b7964.dd8fa12e2c54d3db9939dc6357d3b87c8d95f01a06927fc5a8372caa3e2a6dd9.cCZctJ5iukRDmLjBi9Q_JVwE4P_lFaGe8_SGPq16o3Y+ hash: v1.k794b7964.a4e399e686051779074763ca122ce9334c980a7332611f7da4e901d5866e212c.aG8Ry6qKVOCfru0ksZ-2xCNF6B9UpNC8gSb95WOZOnoscenes-app-experiments--experiment-recordings-dropped-metric-narrow--light:- hash: v1.k794b7964.9a0903532a5e9b38f7c332812a0dc0270b52b2c8e9985c036112a1383d3cf7c3.Q-8PYRz2E1r4DSZrgwLMGavzkChZZu1t8Wd61TZT2Ns+ hash: v1.k794b7964.ed292204eac7df4ef8c9ddb6d2dd7ec02ca31f7d90a5970fb2b648059e77f4a8.uGMs0Vv7nRZNoXbSr5kaU5x7B6pd4_yyEsaim3GAKfYscenes-app-experiments--experiment-recordings-empty-ended-past-retention--dark:- hash: v1.k794b7964.95739c24f1dc6a6dc1593ac101968783dfb53728914713495b3b960784a200ed.WJ4WBLSJxjEYOCt1-2lPPKexd64E9BM3MsNCt4t3F4s+ hash: v1.k794b7964.e51475c1a28c26673723feb65ae6b05e089c7478f5aac779e76447e763d2686a.-pqX0xizuBryjYfL7srNoyXd6p1CKoQVKay7ApMCUs4scenes-app-experiments--experiment-recordings-empty-ended-past-retention--light:- hash: v1.k794b7964.b758e78290d8c1bb043ce180faeb1cbf72768a116f172ded18d26f14b6fb86cf.6KYeJAUhrKZVCvk6WNRNL918CK2vr27b4WnzcDzojLo+ hash: v1.k794b7964.4fa9a0404413bfabeddd9c7d4f34787e6b4b4e6e5629b4ad68b602ab2786a513.vacE62AQgr0seSYywiDcpbAvKtGvd64atdPW4ZytpUwscenes-app-experiments--experiment-recordings-empty-from-results-row--dark:- hash: v1.k794b7964.f0d8c1c09eac4febac4b51b128ebb5704331ae23abe0e21e5b6a38e984982458.k7liTCfgWjCCJw9-mRQH7kkZR1I82wjdGH5uQ-ARXKA+ hash: v1.k794b7964.086de962780fed366b6f46d18c9dccd5eacab1e9a0f5f530695477bf26ae077e.D11saNxohQMeOmiq1GXRf_Iut2iuwaY2rcmM-uoLMeMscenes-app-experiments--experiment-recordings-empty-from-results-row--light:- hash: v1.k794b7964.68c86e59711898947a1f0c8ac2d16e27afe7016e79cd1bce5fc3fa11d2a7fe8a.l8LF6r8K-PEbE3D_jxHwB3Neh4NBUQw1YOmKclsvjWk+ hash: v1.k794b7964.760e9598f68549a5bac11426a83e23eaf7eff5d4fce3ce9bafd9147048ebd274.j7Wv58zD5pyVYs5oeGD9aL-9vz6euqV8YLuZv9lejqEscenes-app-experiments--experiment-recordings-empty-in-session-has-none--dark:- hash: v1.k794b7964.b4470c6014592d9610d770107d51c1dfbe5971145d0a100b331b4b805faa1c9b.NIn5y__oJgxhsb8l0JsFHN8UBXTdzTVtTL4i4zK0xU8+ hash: v1.k794b7964.8703e31521714ea21b1973d068d21aabbcebf8d36008260a9f80925ba19d6df3.4jcXO4YaZnOomTFBS_8URU8UKO2pmrawR4NhZTe-OHoscenes-app-experiments--experiment-recordings-empty-in-session-has-none--light:- hash: v1.k794b7964.ebc30b12840a45c0b19d0c5048d09e5b881ba9ff95bae52ee1c7ee61790ee531.u8_oQ5G1opJTbsZyyV1PRhtqjQbEImYbypoFcfbhLns+ hash: v1.k794b7964.4189db4710167637f617d366fc88d32fb88bd2a507464af23a3cad1513f2ea68.gzXxqG86w9revNZTkix-zdoESlopggpa6aMKAl6G_gEscenes-app-experiments--experiment-recordings-empty-metric-filter-failed--dark:- hash: v1.k794b7964.7351e934595a3781d250ce6eafbe27c11ea6db497c811df26aa4d1890b103b9b.CaNhp0bksP4PL_L0IjDZ6ad7FvsVv2P-GHGTrw2nzjo+ hash: v1.k794b7964.4310cf8c6c15629d670fb7d2af1aa0c35dc10f7856b25ce15723d08339303edf.vJ8H-vDbSTneWOauzIKEbiUVKgNq7hW48m5WQeJfTN4scenes-app-experiments--experiment-recordings-empty-metric-filter-failed--light:- hash: v1.k794b7964.ca04d527bbb99fcc795bf8fac86b43d7f98b3e2e77654d6f0c63e4b705403b18.W-V17b7RcfSM5yECKj13_dzc_BysEUJb46-908b8AeQ+ hash: v1.k794b7964.dc633ba968fb0f88f08fcc10cf701184eea471e285a1b3012aee2aa8354a3c7c.-9J6nCmRSyi-jWid95tlF45l6LDaUrM1BBt5xi05tfgscenes-app-experiments--experiment-recordings-empty-metric-filter-matched-nothing--dark:- hash: v1.k794b7964.135814cf20dfaf5afa0c9cee05be594b5b885aab456575f997b7b735a217a226.9H5yPt59Lq7hHmQs1W5aDH6FDWoArWvv-v2iqISiA4Q+ hash: v1.k794b7964.c64848162e49acb173ebf3cad8c14b7b84bcdec8110b2b3164495d279db5fa0b.AGJ1PyLnj-eC9Nfb43l5gWqVMEpd7KeopDfpypA-N8Uscenes-app-experiments--experiment-recordings-empty-metric-filter-matched-nothing--light:- hash: v1.k794b7964.2b657c3e1a387872a1600add46f404e7db8c3a0e2a365ed4d504b59a5f484fd8.kuEreszWLoQa5e3ZIf9Wn_tnf1m4p_J0eo0JyaylPZ8+ hash: v1.k794b7964.88b6f080474a60d89774a3760dffc132bb57e9ae3b554b96039683301999b591.nQdb5u0Ap9ikaTiS7Y9VcUHSgie_BVbMa9ImgJwNxY0scenes-app-experiments--experiment-recordings-empty-too-early--dark:- hash: v1.k794b7964.58bd81f88f952d8ee84ebf27fbdfef151bd18bc7357d677d3376a300db8a9274.K7bAhu3x_FpTPc5ddkwJ7Gkfo8WHxAhcQx1r2w9by9U+ hash: v1.k794b7964.f8181493ac97d2f5ffb83c9b07886cdad2d6c96643bf94961dcd7e1118a394c6.F12-nLksphUvkSB8kvrefnHTuPE5AZowuw89B6J2fo8scenes-app-experiments--experiment-recordings-empty-too-early--light:- hash: v1.k794b7964.fa2a48c1ae0dd5d6b2a57fa98f52315a872989f1fd5bfe4ae5e01ff3e0044978.Js0_UrWGsAeGsp25S4-yqAEhA-KW8WkPyjBkepH12Bg+ hash: v1.k794b7964.85762377115f748c945b24bae1a6fbb6bee46ba27e9c48ebdb62ba24b6876a7f.PXhWKtOJpe8O9nsy8ox4KLOUcP-XcZO6wsV9arjWiE4scenes-app-experiments--experiment-recordings-empty-too-early-with-variant-selected--dark:- hash: v1.k794b7964.855ed091df81b671a399f5090f6996238ad2ac429b18ff4c9747ce7cdf558bd2.c2_vyatyNpei0zSp0oJbtV5rydMib4Yk99l0f1kSbiA+ hash: v1.k794b7964.bb763606f1f1fbefe737b9f603b628bb3dec4fefad6c5cbc8262dd60baf8ba33.whraLgNyB2viu3_pznctIEed3_I7SUTX50_9ZDP-wW0scenes-app-experiments--experiment-recordings-empty-too-early-with-variant-selected--light:- hash: v1.k794b7964.7a64000d7301ec1863d82dd846940f8e512031c7e3c6e17ee5b74fd9858d1d3c.izPZ_jXEhRK81GrGi5_2TDqjlkSCEEYhAjONJZS1Q-8+ hash: v1.k794b7964.d78ff849defd3dc2f8d2cd69e336464e39b51a33a33f73fb9e0caf1be8d04cc7.Z0UHVNrZZU6Ia1b356JLEO2NuFtPgkY5xQVg9GeX9K8scenes-app-experiments--experiment-recordings-empty-unknown-in-window--dark:- hash: v1.k794b7964.f6caddecc746a94b260231659794405ae61324c3ab4ac63393ff08b2dc9a6f70.74ESVoz2PkDDmFKYWLQsQa_p0dMJhquOqF0RGtTRYhI+ hash: v1.k794b7964.dd964a00df4b5efb32c6a987633e16c58c1e9bf218eeb3220af92057990dd8af.GFnIzcRP73g9Wt2yWSLoR2dxKeG2NWtYKoPHllB3HDUscenes-app-experiments--experiment-recordings-empty-unknown-in-window--light:- hash: v1.k794b7964.e2324ce9c03e3f17902bbbe0f0692b5bc4e2dc445b2c268f026d080da5881513.3k8gSxW4gFo36dKOqGdxEAyQDFZ8ofYWPPVR9mHfOYk+ hash: v1.k794b7964.4688d6d7cad117d1f5ab5a01a79ae42a05bb1a25878f7e3120b78b9953e96912._NT3K3-LQ7N5KLT7aDPsWwt7jQwsPq7RKBBjYkuJkE8scenes-app-experiments--experiment-recordings-empty-variant-has-none--dark:- hash: v1.k794b7964.382bf277bd363d664f23a6f9c06f1f5adf906135c131385491443fd4d3a95f5a.hbfNTHxmIbsnE1JJLtxV3XMdvnrtCLstBxtON6iqk6U+ hash: v1.k794b7964.21de115d18bf6bb82cd835920ba9b254f78b3cbd369500483c0e24c5c33429de.w4O7TIghoodacd5KxKkYm0Q2mqYT8GYXjuxJ9sxoiVYscenes-app-experiments--experiment-recordings-empty-variant-has-none--light:- hash: v1.k794b7964.e6c71cb48932f6dd3afc8c14f4be9244ff67d821043b2e235ab160a159622f0e.ey1wcFGrbWtWlRcg2F3DkZtKkJxEtUSLw9eq8udKYiw+ hash: v1.k794b7964.418fd99d93cdea964c04521f36b3b1a833f3c413b4e167b2e73705e6d394f2ab.zuCJN7_y6mumcky-DbPmfBiLa8Wd4RYZkn64q6K_ZjMscenes-app-experiments--experiment-recordings-list-load-failed--dark:- hash: v1.k794b7964.87508fbd7ec4bdf045a9a781f51f3af098585636a12607d770e950a83e9d74e7.xiAGGedwNdfKlfu4eMbO18rF9yPIglxLKvFRRlM6oj0+ hash: v1.k794b7964.7f95ec8625de23f5bcc82edb72a3f7ec32fd0bc126859af0ed70f37737758974.vbZodBjTD_lmeBgCtZAWEerpL4SWd4THgtbh2YQEvJAscenes-app-experiments--experiment-recordings-list-load-failed--light:- hash: v1.k794b7964.d7d2376bde32f2fb206835d547f4688e2ba98d3456363a6ba2e5b9d4de3cb370.YWem31SNQmBbipvo8YdEj2tbbC5Yr-U5EuPkvOTFl50+ hash: v1.k794b7964.d968af19f591dbd8d9dd56e277c90084e5743bd1bc4f890c3256e5a4148aa5e8.OrzP_Wz4QBG0qi5s4km2Ez9_3h5FpO8H_oQ64LMVcSEscenes-app-experiments--experiment-recordings-unavailable-group-aggregated--dark:- hash: v1.k794b7964.2576b51bdc51c6aca180ee4cb6732fb45d040d86c1e2daa6f13529c6a298eee6.wRWk7O3G5bHgYgkTv2GwwskwDAMgcBj3kR_FBYWvWoA+ hash: v1.k794b7964.69a70ca6c190ab75b3b93ddc39d5c0b0681953eb903e9d8e70bbb6ff68cb2aa9.Qne07YnX0iStsQwk5cDVWqcJRPBG2eo07WTgnb_Z-dYscenes-app-experiments--experiment-recordings-unavailable-group-aggregated--light:- hash: v1.k794b7964.04a23effdec71d8057f3fc27053954cb0815870f6cb2f456218550855d392223.J85JQcbMCggTVZuFrDv6c49T62VnCIw8FB08nRoxlYo+ hash: v1.k794b7964.c6b197ae1b260f15f33fdc2251eff7246956772fccfceb286b6cda0c9ed5de81.y9y06Hk4JXU2-aap9VGPbLhBgdGo2bJm19XxKxFxVdsscenes-app-experiments--experiment-replay-scanner-backlink--dark:- hash: v1.k794b7964.3680d09c3ab1accb12f91c51f31aec6e9ca6376c901c1157a5cdf7501e20b351.cxf1S8x4ku4ZSWpjIedky5H-biZuE1fMdlK2b9EPQvU+ hash: v1.k794b7964.cd6862ecf47a68f070f2f333c3f607cdeb2b3f7ffc0738f95cf8bb8b1f7f6f76.kehuIJHFlk8zkZ2Ls3DtOZ0sNZeaca_9tySnCIN8Hd4scenes-app-experiments--experiment-replay-scanner-backlink--light:- hash: v1.k794b7964.7110f111fa6be1524185938efbac21c546c4e5a0fad316707bff7bca04482843.vV3KGyuP_0zqnbAqhMXupopKrjLcvgRFv4UL3LWez_Y+ hash: v1.k794b7964.9419bc808495f0a343293f26a06605e933f2a47bbaf698294fae2ac4cf477c65.FMInh_LM8Ux5fopKYeVHs4jfyfl01C-89G1jww94VdEscenes-app-experiments--experiment-results-row-recording-links-funnel--dark:- hash: v1.k794b7964.910c0e5d4fd3e8d4911da8f7230c592b7b16fdee8184d71517afc00b9afab812.kF6VlgHDMR6WBIc5KnQft3BoZaXXPxtMXiM5_Pnhw6M+ hash: v1.k794b7964.f5d679ed87f8fe92f1982b94fc7bada993551c994d8f1b45c7df55499eb51040.JK2tItvyzYgTOayd3lwMqU5PHlaJ30gu8JKGL4D9mGwscenes-app-experiments--experiment-results-row-recording-links-funnel--light:- hash: v1.k794b7964.07acdbf8d15e768726aa01ed278a2c0f7263c8f6c2cb2b952331ffbeffd0ac35.m4gBqs2HlnOja0gw60tzPU4AnWxLc1UsiLX46YZKww0+ hash: v1.k794b7964.350df288da334510b8572e6a4877b47982229d87c61b1dba5281ffd15aa3f1ce.0P-BlEOEW_wGJTS5KYkJ1hGn-XTQ0CAj4pHM4bmE3Z4scenes-app-experiments--experiment-results-row-recording-links-funnel-menu--dark:- hash: v1.k794b7964.ab5be64e2295f5c07fa781a71f19b27807947d10bb3f90f568a719c3db6145c4.IHNOcyjGoCUhE7dhgny8xj6DOh-s8917tdHcz4DI3nQ+ hash: v1.k794b7964.c8dc5d4da1495a05ab91aa2712e7afe2a361cc7fd1ec1faf492f61fd91401b5c.pZ4zDzkqs1X3shXxVZGVg_v_t66dkjIvppLqrX3Opu8scenes-app-experiments--experiment-results-row-recording-links-funnel-menu--light:- hash: v1.k794b7964.9615492ed9e4bc337149d87cbd946de35aef5af2ec1c0ba7f4d0fcb3dc31d4f7.sXS9upw0PQDLcsoc9b9MLYU1so46n_rbLx0mlGLU2HM+ hash: v1.k794b7964.13c56267c49a59c09baf63b7c3ecefd3f84e829039b3ded3f50192723641d338.ZtyCRPwCFD5MqZmJb-pRhH_qAzouaM8w3tiWRNiXkSwscenes-app-experiments--experiment-results-row-recording-links-mean-menu--dark:- hash: v1.k794b7964.d6d6be1b89a10db282316bc48fa35ae7d56d5de361a462755c5703a53cd26b8a.S56OaEC8rSStc6Xldqy65ootCx0QhJLggXedADAgN_o+ hash: v1.k794b7964.439dc24e773a3de3682b1eebe504128d5f2b7a8372a3935661d55b16d5c89818.hLERz83o2PbQOOrPYfZL266nnANHwF0pHM3Nr6Z9jywscenes-app-experiments--experiment-results-row-recording-links-mean-menu--light:- hash: v1.k794b7964.73bb0dfab54e1a51ed29ec43fa0e931aad7ab3c084c3a520cbfb2291f0ff56ba.F7Bpbd_81Kj3W5o37VA0CyHRP3jjdTFs4JRKJLe6SBM+ hash: v1.k794b7964.cf10a54b76dd971b94360966020c552dd581673dc9513c9443ef3950afcf365e.IL-fo6WG4PFYW1JRQLVAuKl_xWETR6WHxTvchhMQ9kcscenes-app-experiments--experiment-results-row-recording-links-narrow--dark:- hash: v1.k794b7964.163a6dd9120a5181d12ae59f1ca3f81ad8099fea2e03f38f0943b9b2660445d6.6ljPSeXiutaI4d3dmRSb9QlxaF6bP1Vt0RgB82FokwI+ hash: v1.k794b7964.77971651a10c2bf00ff703be5e81b863a9d351c7fc36b5320375c440a7595ba5.bBt8hcCx5O_CZzg7h5HvjO_yv0PgvQDJDE-8r-aKAngscenes-app-experiments--experiment-results-row-recording-links-narrow--light:- hash: v1.k794b7964.57be94797497b4d67d340ef2a54f51319bd6647e3cc946bc03e50d26f67f9878.Rt94foTJLog9IdAknK2fd3o96ZezftdQe5I2Uuo48Lk+ hash: v1.k794b7964.675e0a133687c40d1500788c26993f39c674e32fc7c33c354168e9afab3aefb2.pfxK4sL2PAlUKYSLSFcdbG9x1Yw2kG8UltowPWRtessscenes-app-experiments--experiment-results-row-recording-links-unselectable-metric--dark:- hash: v1.k794b7964.7ad5e52d2408c4e257feac43ac402d153cd5e542eafdb4068a3eeeb28baf562e.nSlhjw44KpWp5u7IMBamk1e1KMybdS0vSw0ktrWswzg+ hash: v1.k794b7964.626965f68e9a8a3a2a64bbfec21e45e22acfbc339b6ccf29c041b63dbbb20312.RiQmxn6DhvdjbHJFenkt_EGPkljGqy68Mr3PF5oZbv4scenes-app-experiments--experiment-results-row-recording-links-unselectable-metric--light:- hash: v1.k794b7964.58b7676f8bd8763103eaca96fa9c0d4c31d7583d0cf8a3ddf6f16c4071c23f5f.iGUQnDyZ7dLJrOTLJEhuUW33qoahXIGJybgOmAYNQdE+ hash: v1.k794b7964.2e4278221f08b3c464432e5ff569a8f6e727e98e442bb5c592f2db99cd30e9f1.MepjeEAlQ7w1L3_yGTxYQIHuJGbEaplsBNCiH_1WywMscenes-app-experiments--experiment-stopped-with-conclusion--dark:- hash: v1.k794b7964.a5ee3012bcba61a53f9db100b86e89241ab9d4ca9c4b64a70068e836a5f9027f.b8I1067SZl1gfBp2e6SdHw-CfIP52q-Z0TbCUw4qDVo+ hash: v1.k794b7964.a738c35c2a29d993ad97ff5d8c5d7df8cd3070fd199a681c0b64293460b651df.r7Mc6OPtHOiWjoANnR9tB_3GTqBz49gJMLarfT7zQ8cscenes-app-experiments--experiment-stopped-with-conclusion--light:- hash: v1.k794b7964.8f12ec9d219da268e569da2de50c4adc57b1524155fb55b4a2b4ed71b94b0d03.szbmT9Q77jfG0Je04Utc_q5rU9uxmfnqiCSgnvob-GY+ hash: v1.k794b7964.499a72ad9799ec282e0252a35d23accd08dcfc8c7e03531ff5f84b0d7e29d5d1.Akj7xLYPOSExZth6yL2yn3BrbhTDnliRDkrNGfj6KYcscenes-app-experiments--experiment-stopped-with-long-conclusion--dark:- hash: v1.k794b7964.4e46dd1e429c74b1216358f37a066c402be52274d48f2cd27bcf6690878837bb.BZp0Z2PtgIo5qOJbnJAYsfXhcBF-WDktoy81iOq7fs8+ hash: v1.k794b7964.a7a3c9589539aaa621af4e70c3313782287bf1020eba5999b76f01785047161f.SkSoczWCweoVxvUNQmtkx2S11ZqTM_ChiYhRApET9QIscenes-app-experiments--experiment-stopped-with-long-conclusion--light:- hash: v1.k794b7964.5a696eb4a3523ab07c488513a92b30c3a8520e12e7029777d07332752406fbe4.e08UDo_rpK19Ku7MmfYqx0_-aN9FJCn6R-N8HcLMIr4+ hash: v1.k794b7964.b163b130667cdfe7b7177fbcf2bed8ab7d0f24e02c4ff1a0c355c0011ade05a5.Yy8IcjsHyUD-X729SZjXBN_iXq-dfmT7vPGO9t873coscenes-app-experiments--experiment-watch-shelf-no-recordings--dark:- hash: v1.k794b7964.69841d145dcfbf8f1b7b130bad079b5406311f38813de70a551e61ab6434ab26.zz4ymMg9RftETimYCD9XAxBpVzHnLZt1vgf2FGJzXrA+ hash: v1.k794b7964.55a6f0707672107a29638471812d8af31673ab1e9aca3155e739dcaec4e4c4ab.YXe1dzcS3NzGm4uojnVEH6FPu7iR94ngqLoGz-52aT4scenes-app-experiments--experiment-watch-shelf-no-recordings--light:- hash: v1.k794b7964.2707220948252ec85b62b0423cd2ea97e11a2a1f5ccb68c98ae6d0c9710c5fab.kZm7zSqWJlsWfo4VSY_tUAJpMIWW2ue_t6RVz6NqVxE+ hash: v1.k794b7964.bdd35332d5f7973b0ae2a28e817da302fee8c5bddd0e30ba0bbfec834c6415e0.KOE9tK0x16f0z1IrPtYecvYU4RrDZnr7MczMItR4QsQscenes-app-experiments--experiment-watch-shelf-no-separation--dark:- hash: v1.k794b7964.a24811ab237e92bd35c943e24553037349bc38840ccc4132954da9ab1e050cf4.vAcBQmh34gPH6x5UETkHggM-OLYpv02hqx4WkjpvPGo+ hash: v1.k794b7964.435b3615a8d9acedf3f742e9fb902941a38fc223964163619921e88f5b140b25.Xy8ouVk4KYkw8hQljZSGDi4VvYgFuq3nKx6sg5rVqggscenes-app-experiments--experiment-watch-shelf-no-separation--light:- hash: v1.k794b7964.f7e8cbdf3f93ed1bdf58d3c70a41dbf7db7cd36c365a417dce8da1b5e4aba6f7.1oxZ4HMtgAdHQ32-gEOTvnvNRoVnXp7sskp-4vAYfus+ hash: v1.k794b7964.794915f612b62fda1e420b45bc6cd633d55e7936c6ee811481022e8f2bae89ea.XSXwPYSxJJmjkQAuvcXlMlUkLpLkcwV8afagSknpgvAscenes-app-experiments--experiment-watch-shelf-no-session-linked-exposures--dark:- hash: v1.k794b7964.aefe362e6821a5a92196db070e561a81f7db1b9cbafb9dff3c1af3f348f220e7.DKoVgDirZMTiODMKhlBpdwxqQPjRFbQ9W9uHy5c_llY+ hash: v1.k794b7964.8c3e98427ae7ab97f315d6e09fcd5b7878dc55e4e1961e7ae47dc05c1579e574.ueEhmngLaPWG5KfYDBvWtZXkxVJsF3YMmAAlwoExHWAscenes-app-experiments--experiment-watch-shelf-no-session-linked-exposures--light:- hash: v1.k794b7964.5418fea61eec0e695bdd99d6488db30efd4411247daf01053afc2c9b4c71fd41.UVE2kTrxhLIn_bU_N01AgcUOKR3FgXoNdHjwoLDYXNU+ hash: v1.k794b7964.31db760212d92b52b790aac23d4d19cef1aaf5907279e1cc4001bad6e951a33f.s8HbaxbSTxJ9DtnvmhQge1u2zpQgTJaBd-wodykUX7Escenes-app-experiments--experiment-watch-shelf-refused--dark:- hash: v1.k794b7964.ede6eb0d7d4761941526665cda84a1588588ccfc24f2f0b705721fabce5ab647.a-OL7Mqqv-dq6hmXU55qXCAClBPk12fxAv9xUJu4Lig+ hash: v1.k794b7964.40da6b8fabf18357f808832f80c20407c782d514a055af882aa698518aa4f7b8.v_fBfohavWH50CmLsNbSyce7riCSBxKrsK64wL0fzlgscenes-app-experiments--experiment-watch-shelf-refused--light:- hash: v1.k794b7964.7ec0f5d3b60d17886cd1694dc3b5c3e9af4d853bc551f1416dcbca559f8c9bba.DkgP-Q6eOQqoLTFrAnC5ljnO2Er62jWLEqhOLBl_jS4+ hash: v1.k794b7964.8be4fdb3076caff99eaba9a73fc4b123986c36ee0b69dcba1bdcd50c65087742.N--catODrnhJ2YAjn_1yoPbjSSdB4Ut2oZdhcvLKzaYscenes-app-experiments--experiment-watch-shelf-refused-narrow--dark:- hash: v1.k794b7964.9e675f299b9b10a545f18e0df035b3c84e8d782a274c72278b50be20272aa478.Ow2Lqn1s09n3LsZG2zbsC7ORMykNLeG_OXCaEE1Z0l8+ hash: v1.k794b7964.9ee14bd6c84e859ba6846e92980a88094e63182e13ed0b25c332fd75afcfbd3d.Pu-wBokkxe3YDiGYg8C7Cxf-aNomUoQNqOlGK0xnGAAscenes-app-experiments--experiment-watch-shelf-refused-narrow--light:- hash: v1.k794b7964.1b73203a3057df8a1d4d550ba75a8165047827f1d29610f937e8363e483ff50d.iWx8rfz1dW4jrwVBxockCgsBzrAKbG0XBM2Y8p3YoCM+ hash: v1.k794b7964.112e930b5caaa975531c0b92283101ebc7d1b23fcea4054109a8a3e332fb2617.qZeOPIwoVkumEGWbVnFZWOi4OuHox2A71sSvCgMXC2Mscenes-app-experiments--experiment-watch-shelf-too-early--dark:- hash: v1.k794b7964.82bf27f334d428ca37c6f7de89c2bb1b6b798b3da2aa48e6b912072c1533156e.qVMvy5QCwoVbzkcp8ecdVzjtnc0x4j9sgI_e7Hv70Vw+ hash: v1.k794b7964.248031b6d56bfe26e0c93df36b175a933229cd7d5e67233b05bd3a8d4f6cecd2.rHKHYKOtphfcEY6mH9PcFcnb7b90nBejKwYZztqPf48scenes-app-experiments--experiment-watch-shelf-too-early--light:- hash: v1.k794b7964.e9e007b28f3f8dd2dbdf96533794141a1be58a792f660d3ef97783494f32f6fc.Vx8vpM4bzEI9s6lq1kC1HvTvkX98ugV7A1TNPMB3MWk+ hash: v1.k794b7964.17ab578289aa3fa7e8dcb2f626c2a861e44e00dc59f1755e13e9b09803c2cc50.6-7kpEcC1PLMWBFj4Hcg16B09Ao8OCEQAnqh2DPwUHsscenes-app-experiments--experiment-watch-shelf-too-early-truncated--dark:- hash: v1.k794b7964.33675fb22a21a9befb0d3f5755dd318157c48b24ea96f9a49447cf135eac5c63.z63ejsagl_hs2gNC1f1P-zZbGYRz4RczYKy_qXxTErE+ hash: v1.k794b7964.b2c891959df2a7969282bb86f13c1c81b928df5fd3cf3d15e238c954e2781238.3wvONcwylS5KRMQj5lrF6bPPgr5lWh7e-iF8OnQaGBQscenes-app-experiments--experiment-watch-shelf-too-early-truncated--light:- hash: v1.k794b7964.f7e5ff4ffb1c0a283c81e859b186f417f4162e0deadc73ee5c6ecf483ab00975.QLJVXEi8QysnSLbPDT205KvubgzsiTvWoRQr4XqbHYY+ hash: v1.k794b7964.04398c1155fdeaccf3e8ccef7fffeb5e74e42205cacd72e85bef540335c9ec5f.gWBqQ0ElX1wao-0VLXHxyQP8U8Wyjez_LlE7fMvN_-Mscenes-app-experiments--experiment-with-funnel-metric--dark:- hash: v1.k794b7964.910c0e5d4fd3e8d4911da8f7230c592b7b16fdee8184d71517afc00b9afab812.t5TguM4NJJIiRBUcvc64p3ozqYFq0GuKVyT_srf7Vks+ hash: v1.k794b7964.f5d679ed87f8fe92f1982b94fc7bada993551c994d8f1b45c7df55499eb51040.VSZ4G1GCpz3rye10oUjjlhoUg2CP2-In-099pM0hO8cscenes-app-experiments--experiment-with-funnel-metric--light:- hash: v1.k794b7964.07acdbf8d15e768726aa01ed278a2c0f7263c8f6c2cb2b952331ffbeffd0ac35.YGCr61e1buStY5IVl_dJkktKLtw-Svyj4SCJhF9vPag+ hash: v1.k794b7964.350df288da334510b8572e6a4877b47982229d87c61b1dba5281ffd15aa3f1ce.JknHvGrcyfERSvASSKopVCiDTu8Y_Jgq0fdELfDqmiI+ scenes-app-experiments--experiment-with-health-findings--dark:+ hash: v1.k794b7964.bf3245d485cdf4423f638c7d0f4f6a6cbd7b9973a714b6d97754f9d759f9db52.u8I1lVXq8xvgY0M_lVcDOsb9SfALFXkvgsVLUAIE0ww+ scenes-app-experiments--experiment-with-health-findings--light:+ hash: v1.k794b7964.04d7f04f53aeb6ca300aacdf85f342f63ac09efafd0aff92b67d1c8e4d6bc6b5.4nAbtk7eJ-PGKzdL8yAHskpYkI_nBHEtYh0-ZFWKNI4scenes-app-experiments--experiment-with-long-flag-key--dark:- hash: v1.k794b7964.b565d4f8003e29835ff503feff57a06a8556f6b902a97876d953cf0d2472d1af.LR4Cs41rNzjzwWicjHr20NPwAEkIzP9RtBJcqVuX_bY+ hash: v1.k794b7964.b7a46ab94f81bc60a01d50dde7143760c3465cb1bac08aced7c66abd4b9f9b35.v7VFeRPn1_vgpB2H4CPX0G6kMpEzCiFO-AC-B36CkjEscenes-app-experiments--experiment-with-long-flag-key--light:- hash: v1.k794b7964.2e319c8faee626ca290f980b3f23e4fb83eccc8ab1d22bc8529613c9fb293c45.r4dygVcq7yy1Fg1gE83nrHzSeE6JvNS8uNfWTl9fRRg+ hash: v1.k794b7964.c9332a55196312087c9594e12b5349271c935d92765ff1f66f04f3ac855a6b8c.lWPEabDfKU_u202Mi5UIyC4Ppqp2X8kvetes4H6V7T4scenes-app-experiments--experiment-with-mean-metric--dark:- hash: v1.k794b7964.f817d39b9e781b945e9a4867f9c75e1e24ae6db2823b3299a13c13b820ca66d4.GdKSLaeMMDPhzZ-KWdmyuEpqIyNhs-cItJhn3MaAuGc+ hash: v1.k794b7964.c3b45bc275fe00b7b435a4f5d23e0e2c76b16a78f4cbefbf626845b1382a5354.tUznNrRWbai5HKSP-h0jxYT0t_Tz8OwI0kffaRNwKCAscenes-app-experiments--experiment-with-mean-metric--light:- hash: v1.k794b7964.9ad3398f423acbf6150f28c5ab560158f5241cfbc95cec4b7a1690420b395b90.h2ZFmqlfHE80EvvJjxgY_sUgJTes-k1jdc82yChmyRM+ hash: v1.k794b7964.63c69052fc983109da7b90fe90dcac3aa910bc158fec9c6c236b6234def6598f.rUMlUbL-m2zCyH3yv4_fqOUf24kW68nwvZFsK1UmA50scenes-app-experiments--experiment-with-multi-step-funnel-metric--dark:- hash: v1.k794b7964.7b12a04f5d1e928cfdeb7717d48f1ccf4f482ffa84b7c90bfb73408a30d99747.AD3c204Kl_c8mJC1Fnw9k13ltR47mG_4N0mPFAM-wmE+ hash: v1.k794b7964.2cdd4577ab0cfb3da2a4a483812d1bca70f70e1025877a2f6db93d9eaee8a44c.woyEtTHpnyOcvxl3BeCCFqLZqJSdOgOVOyglKq7ZK-8scenes-app-experiments--experiment-with-multi-step-funnel-metric--light:- hash: v1.k794b7964.373ad4997e53fff920eae240f3636692f9c44d506c24415ef97d6f21641db835._bJ-yH3SuhklRTdrwETWgsDKJH8mhf-tkQTTxqPsn6s+ hash: v1.k794b7964.e3b9ce0017db7795435b754eae7b7b36a500cde66227bbcb51853adb72b3daaa.wo_md3OxZ-dUGDb8tqccuQL_n8I3hKdONcogT5LuENcscenes-app-experiments--experiment-with-multiple-metrics--dark:- hash: v1.k794b7964.abaf9111cbf345951d9d7e9e68574d57df522c42fff4991f1dc30993e5c253f6.D8J9SH5TXG4g5JuFg8yW7BIjN8WqqOkS-efa9T4GsBk+ hash: v1.k794b7964.5222296169fb0b70de6f2d32900f81d6fcf92ee724f1303fe91011a74533bbf5.hF3hcILSJrP_jikb6c4Q3gkyqOypi_0c-NTmtwamlC0scenes-app-experiments--experiment-with-multiple-metrics--light:- hash: v1.k794b7964.0a5b4b431ae4618642499c3e14676e0c31c94b69e632db9cea5b9dc5bb147260.6-svPKcSrRFPCLX9NfFlPietZp-NQeiSJpjvm4Snf4o+ hash: v1.k794b7964.00b5374d799996c071097e006052ad12763ac23ab80b04477a78ae7a2b78d6d0.Yxi_4kC-CIoT-NJTDa_Mc53yFSpjANgsV5yaM60CK-Ascenes-app-experiments--experiment-with-multiple-metrics-reordered--dark:- hash: v1.k794b7964.5f044eade94d77246db1fa83e1ba89998168e62efc3edb8c39967423a0cb3bb3.LqCa6_tJkRSvDKCYZ7Prm6x5boYDA9NJcf7OEInf-VI+ hash: v1.k794b7964.19228386ea1278c469e7f3adc253b1a006b5e1c012814e169ab838c0655405c3.FurKlGRkZAkB07gAvMLgVfwgt1RndbBZg4_udoCEhZ8scenes-app-experiments--experiment-with-multiple-metrics-reordered--light:- hash: v1.k794b7964.123e942241c25f4108ee8921812a81e3eac5355f8e8c3769ca0cc88f0ba79677.TBW32jx5lsHrG46Z1iU3mUhIX9DQvjwr9zOBovdHwqM+ hash: v1.k794b7964.a6cb90ffddbdb6141b78c4b63e240d5e1875e019f0aafb092942dc698314cc6b.ljsFByh4BS_GWhkYOqgZdiCze8yXulhtDFMbLPPLCTcscenes-app-experiments--experiment-with-ratio-metric--dark:- hash: v1.k794b7964.850a78920b3f7296de52c73764b7e45568f7a8c2b7006b20f84397574e15e7f2.X_-_-qc6tp7fdv6fryM3HaviBT5znCEyWCtQ6qgINi8+ hash: v1.k794b7964.cf58283d0e87b88e7816aa6b90218fb05f2df6a8955e22015bd15a158ebcdb55.MQRVCZvp01YBXFe3Ew3_2hFrdNgTSL98lPGqDMFxcRgscenes-app-experiments--experiment-with-ratio-metric--light:- hash: v1.k794b7964.0e0875da5dd4ae9ccf9f68f86040781f50523acf7672c864a4af07798ef915f7.nYrVntUM6dIMM67y2EWWx19IfMpZGgmsKtO_U3lqzGU+ hash: v1.k794b7964.4ad94104a9124b06911f3e00c18da6a99985b11afbc24b495d9ad83c5d085d3e.VUyV_hvbgOOJU59bGcLZVA2gXYN5aZp9UZCVTNL2xl8scenes-app-experiments--experiments--dark:hash: v1.k794b7964.02690ce57556848e6499d55ebdea346c56b0a7f0c291fc7e6ce0dbea43338c3e.CmF_cYWu6htlQfgz-p47OvL1KNUyS5xNcA_b2p10J8gscenes-app-experiments--experiments--light:diff --git a/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/EmptyMetricsPanel.tsx b/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/EmptyMetricsPanel.tsxindex 21df5cbea5c8..bc522fc80b96 100644--- a/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/EmptyMetricsPanel.tsx+++ b/frontend/src/scenes/experiments/ExperimentForm/MetricsPanel/EmptyMetricsPanel.tsx@@ -1,7 +1,6 @@import { useActions } from 'kea'import { IconPlus } from '@posthog/icons'-import { LemonBanner } from '@posthog/lemon-ui'import { LemonButton } from 'lib/lemon-ui/LemonButton'@@ -30,55 +29,40 @@ export const EmptyMetricsPanel = ({}return (- <div className="flex flex-col gap-4">- {isLaunched && (- <LemonBanner type="warning">- <div>- <strong>No metrics defined</strong>+ // Sized off its own width rather than the screen's, so the two buttons stack in a narrow column+ <div className="@container border border-dashed rounded p-8 flex flex-col items-center gap-4">+ <div className="flex flex-col @xl:flex-row gap-3 items-stretch @xl:items-start w-full @xl:w-auto">+ <LemonButton+ type="secondary"+ icon={<IconPlus />}+ onClick={() => addMetric(METRIC_CONTEXTS.primary)}+ className="!h-[80px] flex-1 @xl:w-[280px] @xl:flex-none"+ >+ <div className="flex flex-col gap-0.5 text-left">+ <span className="font-medium text-sm">Add primary metric</span>+ <span className="text-xs text-muted">Tracks your main hypothesis</span></div>- <div>- Your experiment is running and events are being collected, but no metric is defined. Add at- least one metric to see results. Metrics can be added, removed, or changed at any time.+ </LemonButton>+ <LemonButton+ type="secondary"+ icon={<IconPlus />}+ onClick={() => addMetric(METRIC_CONTEXTS.secondary)}+ className="!h-[80px] flex-1 @xl:w-[280px] @xl:flex-none"+ >+ <div className="flex flex-col gap-0.5 text-left">+ <span className="font-medium text-sm">Add secondary metric</span>+ <span className="text-xs text-muted">Provide additional context and detect side effects</span></div>- </LemonBanner>- )}- {/* Sized off its own width rather than the screen's, so the two buttons stack in a narrow column */}- <div className="@container border border-dashed rounded p-8 flex flex-col items-center gap-4">- <div className="flex flex-col @xl:flex-row gap-3 items-stretch @xl:items-start w-full @xl:w-auto">- <LemonButton- type="secondary"- icon={<IconPlus />}- onClick={() => addMetric(METRIC_CONTEXTS.primary)}- className="!h-[80px] flex-1 @xl:w-[280px] @xl:flex-none"- >- <div className="flex flex-col gap-0.5 text-left">- <span className="font-medium text-sm">Add primary metric</span>- <span className="text-xs text-muted">Tracks your main hypothesis</span>- </div>- </LemonButton>- <LemonButton- type="secondary"- icon={<IconPlus />}- onClick={() => addMetric(METRIC_CONTEXTS.secondary)}- className="!h-[80px] flex-1 @xl:w-[280px] @xl:flex-none"- >- <div className="flex flex-col gap-0.5 text-left">- <span className="font-medium text-sm">Add secondary metric</span>- <span className="text-xs text-muted">- Provide additional context and detect side effects- </span>- </div>- </LemonButton>- </div>- {!isLaunched && showHelpText && (- <div className="max-w-md">- <p className="text-xs text-muted">- {helpText ??- "Add metrics to measure your experiment's impact. You can add them before or after launching."}- </p>- </div>- )}+ </LemonButton></div>+ {!isLaunched && showHelpText && (+ <div className="max-w-md">+ <p className="text-xs text-muted">+ {helpText ??+ "Add metrics to measure your experiment's impact. You can add them before or after launching."}+ </p>+ </div>+ )}</div>)}diff --git a/frontend/src/scenes/experiments/ExperimentView/ExperimentView.tsx b/frontend/src/scenes/experiments/ExperimentView/ExperimentView.tsxindex bd891195513f..3c7ce617970c 100644--- a/frontend/src/scenes/experiments/ExperimentView/ExperimentView.tsx+++ b/frontend/src/scenes/experiments/ExperimentView/ExperimentView.tsx@@ -1,6 +1,6 @@import { useActions, useValues } from 'kea'-import { LemonTab, LemonTabs } from '@posthog/lemon-ui'+import { LemonBanner, LemonTab, LemonTabs } from '@posthog/lemon-ui'import { ActivityLog } from 'lib/components/ActivityLog/ActivityLog'import { FEATURE_FLAGS } from 'lib/constants'@@ -12,6 +12,8 @@ import { SceneContent } from '~/layout/scenes/components/SceneContent'import { ActivityScope } from '~/types'import { ExperimentMetaBar } from 'products/experiments/frontend/components/ExperimentMetaBar'+import { ExperimentHealthDebug } from 'products/experiments/frontend/health/ExperimentHealthDebug'+import { ExperimentHealthPanel } from 'products/experiments/frontend/health/ExperimentHealthPanel'import { useHealthFindingReporting } from 'products/experiments/frontend/health/useHealthFindingReporting'import { LegacyExperimentView } from 'products/experiments/frontend/legacy'import { ExperimentMetricModal } from 'products/experiments/frontend/modals/ExperimentMetricModal/ExperimentMetricModal'@@ -46,16 +48,29 @@ import { ResultsNotificationBanner } from './ResultsNotificationBanner'import { SettingsTab } from './SettingsTab'const MetricsTab = (): JSX.Element => {- const { experiment, orderedPrimaryMetricsWithResults, orderedSecondaryMetricsWithResults, isExperimentLaunched } =- useValues(experimentLogic)+ const {+ experiment,+ orderedPrimaryMetricsWithResults,+ orderedSecondaryMetricsWithResults,+ isExperimentLaunched,+ healthFindings,+ browserNoMetricsWarning,+ } = useValues(experimentLogic)const { featureFlags } = useValues(featureFlagLogic)const hasMetrics = orderedPrimaryMetricsWithResults.length > 0 || orderedSecondaryMetricsWithResults.length > 0const showRecalculationStatus = !!featureFlags[FEATURE_FLAGS.EXPERIMENTS_METRICS_RECALCULATION] && hasMetrics- // The condition under which EmptyMetricsPanel renders its "No metrics defined" warning below.+ // With health findings, the health panel above the tabs shows the "No metrics defined" and bias warnings.+ const showsHealthPanel = healthFindings !== null+ const showNoMetricsWarning = !showsHealthPanel && browserNoMetricsWarning+ const hasNoMetricFinding = showsHealthPanel+ ? healthFindings.some(({ code }) => code === 'no_metric')+ : showNoMetricsWarning+ // The add metric buttons below act on the finding also when the health panel shows it.const { reportActedOn: reportNoMetricActedOn } = useHealthFindingReporting(- !hasMetrics && isExperimentLaunched ? { code: 'no_metric' } : null+ hasNoMetricFinding ? { code: 'no_metric' } : null,+ !showsHealthPanel)return (@@ -66,7 +81,7 @@ const MetricsTab = (): JSX.Element => {<Hypothesis /><div><Exposures />- <MultiVariantBiasWarning />+ {!showsHealthPanel && <MultiVariantBiasWarning />}</div></div>@@ -74,12 +89,28 @@ const MetricsTab = (): JSX.Element => {{/* Modern metrics view */}{!hasMetrics ? (- <EmptyMetricsPanel- isLaunched={isExperimentLaunched}- onAddMetric={(metricType) =>- reportNoMetricActedOn(metricType === 'primary' ? 'add_primary_metric' : 'add_secondary_metric')- }- />+ <div className="flex flex-col gap-4">+ {showNoMetricsWarning && (+ <LemonBanner type="warning">+ <div>+ <strong>No metrics defined</strong>+ </div>+ <div>+ Your experiment is running and events are being collected, but no metric is defined. Add+ at least one metric to see results. Metrics can be added, removed, or changed at any+ time.+ </div>+ </LemonBanner>+ )}+ <EmptyMetricsPanel+ isLaunched={isExperimentLaunched}+ onAddMetric={(metricType) =>+ reportNoMetricActedOn(+ metricType === 'primary' ? 'add_primary_metric' : 'add_secondary_metric'+ )+ }+ />+ </div>) : (<><Metrics isSecondary={false} />@@ -114,7 +145,8 @@ const VariantsTab = (): JSX.Element => {}export function ExperimentView(): JSX.Element {- const { experimentLoading, experimentId, experiment, exposureCriteria, showDebugPanel } = useValues(experimentLogic)+ const { experimentLoading, experimentId, experiment, exposureCriteria, showDebugPanel, healthFindings } =+ useValues(experimentLogic)const {setExperiment,setExposureCriteria,@@ -163,7 +195,7 @@ export function ExperimentView(): JSX.Element {<LoadingState />) : (<>- <ExperimentWarningBanner />+ {healthFindings === null && <ExperimentWarningBanner />}{showDebugPanel && (<div className="mb-4"><ExperimentDebugPanel@@ -179,6 +211,8 @@ export function ExperimentView(): JSX.Element {/>)}<ExperimentMetaBar />+ <ExperimentHealthPanel />+ <ExperimentHealthDebug /><ExperimentHeader /><LemonTabs// Fall back to the default tab if the active one is conditionally hiddendiff --git a/frontend/src/scenes/experiments/ExperimentView/Exposures.tsx b/frontend/src/scenes/experiments/ExperimentView/Exposures.tsxindex 2c13c57cb3bc..412a6f9f6fe5 100644--- a/frontend/src/scenes/experiments/ExperimentView/Exposures.tsx+++ b/frontend/src/scenes/experiments/ExperimentView/Exposures.tsx@@ -18,7 +18,11 @@ import { teamLogic } from 'scenes/teamLogic'import { ExperimentExposureCriteria, ExperimentExposureQueryResponse } from '~/queries/schema/schema-general'import { EXPERIMENT_VARIANT_MULTIPLE } from 'products/experiments/frontend/constants'-import { getTotalExposures, hasSampleRatioMismatch } from 'products/experiments/frontend/health/exposureHealth'+import {+ SAMPLE_RATIO_MISMATCH_DESCRIPTION,+ getTotalExposures,+ hasSampleRatioMismatch,+} from 'products/experiments/frontend/health/exposureHealth'import { useHealthFindingReporting } from 'products/experiments/frontend/health/useHealthFindingReporting'import { experimentLogic } from '../experimentLogic'@@ -28,9 +32,6 @@ import { exposureCriteriaModalLogic } from './exposureCriteriaModalLogic'import { buildExposureSeries } from './exposuresTransforms'import { VariantTag } from './VariantTag'-const srmFailureTooltipText =- "The distribution of users across variants doesn't match your configured rollout percentages (p < 0.001). This may indicate issues with randomization or data collection."-// Below this, a load looks like any other; above it, the user has no way to tell a slow query// from a stuck one, so we start showing elapsed time and a way to retry.const SLOW_LOAD_THRESHOLD_SECONDS = 20@@ -243,7 +244,7 @@ export function Exposures(): JSX.Element {</div>)}{hasSRM && (- <Tooltip title={srmFailureTooltipText}>+ <Tooltip title={SAMPLE_RATIO_MISMATCH_DESCRIPTION}><IconWarning className="text-warning text-lg" /></Tooltip>)}@@ -481,7 +482,7 @@ export function Exposures(): JSX.Element {<div className="flex items-center gap-1 text-xs mt-2">{hasSRM ? (<>- <Tooltip title={srmFailureTooltipText}>+ <Tooltip title={SAMPLE_RATIO_MISMATCH_DESCRIPTION}><span className="flex items-center gap-1 text-warning cursor-pointer"><IconWarning className="text-sm" /><span className="font-semibold">diff --git a/frontend/src/scenes/experiments/ExperimentView/healthFindingReporting.test.tsx b/frontend/src/scenes/experiments/ExperimentView/healthFindingReporting.test.tsxindex e5ac09f5bd7d..cb66e6e25d3b 100644--- a/frontend/src/scenes/experiments/ExperimentView/healthFindingReporting.test.tsx+++ b/frontend/src/scenes/experiments/ExperimentView/healthFindingReporting.test.tsx@@ -12,6 +12,7 @@ import { initKeaTests } from '~/test/init'import { Experiment, ExperimentStatus } from '~/types'import { NEW_EXPERIMENT } from 'products/experiments/frontend/constants'+import { ExperimentHealthPanel } from 'products/experiments/frontend/health/ExperimentHealthPanel'import { experimentLogic } from '../experimentLogic'import { ExperimentWarningBanner } from './ExperimentWarningBanners'@@ -66,6 +67,39 @@ describe('health finding reporting', () => {)}+ // The same experiment for a person with the health findings flag: the server sends the flag-state finding.+ const renderHealthPanel = (exposures: Record<string, unknown>): void => {+ logic.actions.setExperiment({+ ...NEW_EXPERIMENT,+ id: EXPERIMENT_ID,+ status: ExperimentStatus.Running,+ start_date: dayjs().subtract(3, 'day').toISOString(),+ feature_flag: { id: 1, key: 'checkout-flag', active: false, filters: { groups: [] } },+ health: {+ findings: [+ {+ code: 'flag_off_while_running',+ subcode: 'running_but_flag_disabled',+ severity: 'warning',+ title: 'The experiment is paused',+ detail: 'The linked feature flag is disabled while the experiment has not been ended.',+ evidence: {},+ actions: ['open_feature_flag'],+ diagnostic_ref: 'A5',+ },+ ],+ },+ } as unknown as Experiment)+ logic.actions.loadExposuresSuccess(exposures)+ render(+ <Provider>+ <BindLogic logic={experimentLogic} props={{ experimentId: EXPERIMENT_ID }}>+ <ExperimentHealthPanel />+ </BindLogic>+ </Provider>+ )+ }+beforeEach(() => {const emptyList = { count: 0, next: null, previous: null, results: [] }useMocks({@@ -124,6 +158,51 @@ describe('health finding reporting', () => {expect(findingEvents()).toEqual([[`experiment health finding ${step}`, code, kind]])})+ it('reports each finding of the health panel as shown, with the codes of the warnings it replaces', () => {+ renderHealthPanel(UNEVEN_EXPOSURES)++ const shown = captureSpy.mock.calls+ .filter(([event]) => event === 'experiment health finding shown')+ .map(([, properties]) => [properties.finding_code, properties.finding_variant])+ expect(shown).toEqual([+ ['flag_off_while_running', 'running_but_flag_disabled'],+ ['srm', null],+ ['bias_risk_multiple_excluded', null],+ ])+ })++ it.each([+ { control: 'Open feature flag', step: 'acted on', code: 'flag_off_while_running', kind: 'open_feature_flag' },+ {+ control: 'Use first seen variant',+ step: 'acted on',+ code: 'bias_risk_multiple_excluded',+ kind: 'use_first_seen_variant',+ },+ ])(+ 'reports $code as $step with $kind when a person uses "$control" in the health panel',+ async ({ control, step, code, kind }) => {+ renderHealthPanel(UNEVEN_EXPOSURES)+ captureSpy.mockClear()++ await userEvent.click(screen.getByText(control))++ expect(findingEvents()).toEqual([[`experiment health finding ${step}`, code, kind]])+ }+ )++ it('reports a finding of the health panel as opened when a person opens its detail', async () => {+ renderHealthPanel(NO_EXPOSURES)+ captureSpy.mockClear()++ const [flagStateWhy] = screen.getAllByText('Why?')+ await userEvent.click(flagStateWhy)+ expect(screen.getByText(/The linked feature flag is disabled/)).toBeInTheDocument()+ await userEvent.click(flagStateWhy)++ expect(findingEvents()).toEqual([['experiment health finding opened', 'flag_off_while_running', 'why']])+ })+it('reports zero exposures only from the open panel, as shown and then as opened', async () => {renderWarnings(NO_EXPOSURES)expect(findingEvents()).toEqual([['experiment health finding shown', 'flag_off_while_running', undefined]])diff --git a/frontend/src/scenes/experiments/experimentLogic.test.ts b/frontend/src/scenes/experiments/experimentLogic.test.tsindex 6df33a362405..c7be903f551d 100644--- a/frontend/src/scenes/experiments/experimentLogic.test.ts+++ b/frontend/src/scenes/experiments/experimentLogic.test.ts@@ -2963,6 +2963,16 @@ describe('experimentLogic', () => {expect(logic.values.experimentWarning).toEqual({ key: 'running_but_flag_disabled' })})++ it('keeps null health after a local flag write, so a reader without the flag still has no findings', () => {+ logic.actions.setExperiment(+ createExperiment({ ...running, feature_flag: flag(true, multivariantFilters), health: null })+ )++ logic.actions.setExperiment({ feature_flag: flag(false, multivariantFilters) })++ expect(logic.values.experiment.health).toBeNull()+ })})describe('health finding events', () => {diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsxindex 65f5181a871f..93fa6df4a960 100644--- a/frontend/src/scenes/experiments/experimentLogic.tsx+++ b/frontend/src/scenes/experiments/experimentLogic.tsx@@ -96,6 +96,11 @@ import {experimentWarningFromHealth,exposureHealthEventProperties,} from 'products/experiments/frontend/health/experimentHealthFindingEvents'+import {+ type HealthPanelFinding,+ healthPanelFindings,+ hoursSinceStart,+} from 'products/experiments/frontend/health/healthPanelFindings'import {legacyExpectedRunningTime,legacyMinimumSampleSizePerVariant,@@ -549,6 +554,8 @@ export interface experimentLogicValues {currentTeamId: number | null // teamLogictrendResults: TrendResult[] // trendsDataLogicactualRunningTime: number+ browserExperimentWarning: ExperimentWarning | null+ browserNoMetricsWarning: booleancompatibleSharedMetrics: SharedMetric[]currentRefresh: CurrentRefreshSnapshot | nulleditingPrimaryMetricUuid: string | null@@ -583,6 +590,7 @@ export interface experimentLogicValues {result: any}[]hasMinimumExposureForResults: boolean+ healthFindings: HealthPanelFinding[] | nullhogfettiTrigger: (() => void) | nullisCreatingExperimentDashboard: booleanisExperimentDraft: boolean@@ -1324,7 +1332,7 @@ export interface experimentLogicMeta {actualRunningTime: (experiment: Experiment) => numberisSingleVariantShipped: (experiment: Experiment) => booleanshippedVariantKey: (experiment: Experiment) => string | null- experimentWarning: (+ browserExperimentWarning: (experiment: Experiment,isExperimentRunning: boolean,isExperimentDraft: boolean,@@ -1332,6 +1340,15 @@ export interface experimentLogicMeta {isSingleVariantShipped: boolean,shippedVariantKey: string | null) => ExperimentWarning | null+ experimentWarning: (+ experiment: Experiment,+ browserExperimentWarning: ExperimentWarning | null+ ) => ExperimentWarning | null+ healthFindings: (+ experiment: Experiment,+ exposures: any,+ isExperimentDraft: boolean+ ) => HealthPanelFinding[] | nullfirstPrimaryMetric: (experiment: Experiment) => ExperimentFunnelsQuery | ExperimentMetric | ExperimentTrendsQuery | undefined@@ -1383,6 +1400,23 @@ export interface experimentLogicMeta {metricIndex: numberresult: any}[]+ browserNoMetricsWarning: (+ orderedPrimaryMetricsWithResults: {+ displayIndex: number+ error: any+ metric: ExperimentMetricUnion+ metricIndex: number+ result: any+ }[],+ orderedSecondaryMetricsWithResults: {+ displayIndex: number+ error: any+ metric: ExperimentMetricUnion+ metricIndex: number+ result: any+ }[],+ isExperimentLaunched: boolean+ ) => booleanstatsMethod: (experiment: Experiment) => ExperimentStatsMethod}}@@ -1761,8 +1795,11 @@ export const experimentLogic = kea<experimentLogicType>([{setExperiment: (state, { experiment }) => {const updated = { ...state, ...experiment }- // Findings about the previous flag would show a stale banner until the next load.- return replacesFlagWithoutHealth(experiment) ? { ...updated, health: undefined } : updated+ // Findings about the previous flag would show a stale banner until the next load. A null+ // `health` stays null, because null means the reader does not have the health findings flag.+ return replacesFlagWithoutHealth(experiment) && updated.health+ ? { ...updated, health: undefined }+ : updated},setExposureCriteria: (state,@@ -3798,7 +3835,9 @@ export const experimentLogic = kea<experimentLogicType>([(s) => [s.experiment],(experiment: Experiment): string | null => getShippedVariantKey(experiment),],- experimentWarning: [+ // The page's own flag-state rules. products/experiments/backend/health/checks/flag_state.py is a port+ // of them, so change both together.+ browserExperimentWarning: [(s) => [s.experiment,s.isExperimentRunning,@@ -3815,12 +3854,6 @@ export const experimentLogic = kea<experimentLogicType>([singleVariantShipped: boolean,shippedVariantKey: string | null): ExperimentWarning | null => {- // The server computes the same warning (products/experiments/backend/health/checks/flag_state.py)- // for people with the experiment-health-findings flag. The rules below cover everyone else.- if (experiment.health) {- return experimentWarningFromHealth(experiment.health)- }-// A deleted flag distributes no traffic, so flag-state warnings don't apply.if (experiment.feature_flag?.deleted) {return null@@ -3855,6 +3888,22 @@ export const experimentLogic = kea<experimentLogicType>([return null},],+ experimentWarning: [+ (s) => [s.experiment, s.browserExperimentWarning],+ (experiment: Experiment, browserExperimentWarning: ExperimentWarning | null): ExperimentWarning | null =>+ // The server sends health findings to people with the experiment-health-findings flag. The+ // browser's rules cover everyone else.+ experiment.health ? experimentWarningFromHealth(experiment.health) : browserExperimentWarning,+ ],+ healthFindings: [+ (s) => [s.experiment, s.exposures, s.isExperimentDraft],+ (experiment: Experiment, exposures: any, isExperimentDraft: boolean): HealthPanelFinding[] | null =>+ healthPanelFindings(experiment.health, {+ exposures,+ isExperimentDraft,+ hoursSinceStart: hoursSinceStart(experiment.start_date),+ }),+ ],firstPrimaryMetric: [(s) => [s.experiment],(experiment: Experiment): ExperimentMetric | ExperimentTrendsQuery | ExperimentFunnelsQuery | undefined => {@@ -3987,6 +4036,18 @@ export const experimentLogic = kea<experimentLogicType>([}[]) => getOrderedMetricsWithResults(true),],+ // The page's own rule for "No metrics defined", for people without health findings.+ browserNoMetricsWarning: [+ (s) => [s.orderedPrimaryMetricsWithResults, s.orderedSecondaryMetricsWithResults, s.isExperimentLaunched],+ (+ orderedPrimaryMetricsWithResults: unknown[],+ orderedSecondaryMetricsWithResults: unknown[],+ isExperimentLaunched: boolean+ ): boolean =>+ isExperimentLaunched &&+ orderedPrimaryMetricsWithResults.length === 0 &&+ orderedSecondaryMetricsWithResults.length === 0,+ ],statsMethod: [(s) => [s.experiment],(experiment: Experiment): ExperimentStatsMethod => {diff --git a/frontend/src/scenes/experiments/stories/ExperimentWithHealthFindings.stories.tsx b/frontend/src/scenes/experiments/stories/ExperimentWithHealthFindings.stories.tsxnew file mode 100644index 000000000000..6e4331464256--- /dev/null+++ b/frontend/src/scenes/experiments/stories/ExperimentWithHealthFindings.stories.tsx@@ -0,0 +1,86 @@+import { Meta, StoryObj } from '@storybook/react'+import { within } from '@testing-library/dom'+import userEvent from '@testing-library/user-event'++import { makeDelay } from 'lib/utils/async'+import { App } from 'scenes/App'+import { urls } from 'scenes/urls'++import { mswDecorator } from '~/mocks/browser'+import EXPERIMENT_WITH_MEAN_METRIC from '~/mocks/fixtures/api/experiments/experiment_with_mean_metric.json'+import EXPOSURE_QUERY_RESULT from '~/mocks/fixtures/api/experiments/exposure_query_result.json'+import MEAN_METRIC_RESULT from '~/mocks/fixtures/api/experiments/mean_metric_result.json'+import { NodeKind } from '~/queries/schema/schema-general'++const EXPERIMENT_WITH_HEALTH_FINDINGS = {+ ...EXPERIMENT_WITH_MEAN_METRIC,+ health: {+ findings: [+ {+ code: 'flag_off_while_running',+ subcode: 'running_but_no_rollout',+ severity: 'warning',+ title: 'The experiment is running, but no new users are being exposed',+ detail: 'The linked feature flag has a 0% rollout, so no new users are being exposed. Users exposed earlier are still included in the results. End the experiment with a conclusion, or increase the rollout percentage to expose users.',+ evidence: {},+ actions: ['open_feature_flag'],+ diagnostic_ref: 'A5',+ },+ ],+ },+}++const EXPOSURES_WITH_BIAS_RISK = {+ ...EXPOSURE_QUERY_RESULT,+ sample_ratio_mismatch: { expected: { control: 1000, 'test-1': 1000, 'test-2': 1000 }, p_value: 0.0001 },+ bias_risk: { multiple_variant_percentage: 4.2 },+}++const meta: Meta = {+ component: App,+ title: 'Scenes-App/Experiments',+ parameters: {+ layout: 'fullscreen',+ viewMode: 'story',+ mockDate: '2025-01-27',+ pageUrl: urls.experiment(EXPERIMENT_WITH_MEAN_METRIC.id),+ },+ decorators: [+ mswDecorator({+ get: {+ [`/api/projects/:team_id/experiments/${EXPERIMENT_WITH_MEAN_METRIC.id}/`]:+ EXPERIMENT_WITH_HEALTH_FINDINGS,+ [`/api/projects/:team_id/experiment_holdouts`]: [],+ [`/api/projects/:team_id/experiment_saved_metrics/`]: [],+ [`/api/projects/:team_id/feature_flags/${EXPERIMENT_WITH_MEAN_METRIC.feature_flag.id}/`]: {},+ [`/api/projects/:team_id/feature_flags/${EXPERIMENT_WITH_MEAN_METRIC.feature_flag.id}/status/`]: {},+ [`/api/environments/:team_id/default_release_conditions/`]: [],+ },+ post: {+ '/api/environments/:team_id/query/:kind': async ({ request }) => {+ const body = (await request.json()) as Record<string, any>++ if (body.query.kind === NodeKind.ExperimentExposureQuery) {+ return [200, EXPOSURES_WITH_BIAS_RISK]+ }++ return [200, MEAN_METRIC_RESULT]+ },+ },+ }),+ ],+}+export default meta++type Story = StoryObj<{}>++// One finding open and two closed, so both row states are in one picture.+export const ExperimentWithHealthFindings: Story = {+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ await makeDelay(500)()+ const [firstWhy] = await canvas.findAllByText('Why?', {}, { timeout: 5000 })+ await userEvent.click(firstWhy)+ await makeDelay(500)()+ },+}diff --git a/products/experiments/backend/health/checks/flag_state.py b/products/experiments/backend/health/checks/flag_state.pyindex d5b23087e126..1508aedd3cc0 100644--- a/products/experiments/backend/health/checks/flag_state.py+++ b/products/experiments/backend/health/checks/flag_state.py@@ -1,7 +1,7 @@"""Conflicting states of an experiment and its feature flag. Pure functions, no I/O.-A port of the page's `experimentWarning` selector (frontend/src/scenes/experiments/experimentLogic.tsx)+A port of the page's `browserExperimentWarning` selector (frontend/src/scenes/experiments/experimentLogic.tsx)and the flag helpers it calls (`hasZeroRollout`, `hasMultipleVariantsActive`, `isSingleVariantShipped`).Change both sides together until the page reads these findings."""diff --git a/products/experiments/frontend/components/ExperimentMetaBar/ExperimentMetaBar.tsx b/products/experiments/frontend/components/ExperimentMetaBar/ExperimentMetaBar.tsxindex f54d3d98bd3c..721f716d24fe 100644--- a/products/experiments/frontend/components/ExperimentMetaBar/ExperimentMetaBar.tsx+++ b/products/experiments/frontend/components/ExperimentMetaBar/ExperimentMetaBar.tsx@@ -13,6 +13,7 @@ import { urls } from 'scenes/urls'import { StatusTag } from 'products/experiments/frontend/components/StatusTag'import { TruncatedText } from 'products/experiments/frontend/components/TruncatedText'import { getExperimentStatus, isExperimentPaused } from 'products/experiments/frontend/experimentStatus'+import { ExperimentHealthChip } from 'products/experiments/frontend/health/ExperimentHealthChip'import { RunningTimeConfigModal } from 'products/experiments/frontend/modals/RunningTimeConfigModal/RunningTimeConfigModal'import { ExperimentConclusionCard } from './ExperimentConclusionCard'@@ -72,6 +73,7 @@ export function ExperimentMetaBar(): JSX.Element | null {</LemonTag></Tooltip>)}+ <ExperimentHealthChip /></MetaItem>{visibility.showConclusion && (diff --git a/products/experiments/frontend/constants.ts b/products/experiments/frontend/constants.tsindex 5d8b6d9d110b..58015733d09f 100644--- a/products/experiments/frontend/constants.ts+++ b/products/experiments/frontend/constants.ts@@ -30,6 +30,8 @@ export const LEGACY_EXPERIMENT_ALLOWED_MATH_TYPES = [export const EXPERIMENT_VARIANT_MULTIPLE = '$multiple'+export const EXPERIMENT_HEALTH_PANEL_ELEMENT_ID = 'experiment-health-panel'+export const CONFIDENCE_LEVEL_OPTIONS = [{ value: 0.9, label: '90%' },{ value: 0.95, label: '95%' },diff --git a/products/experiments/frontend/health/ExperimentHealthChip.tsx b/products/experiments/frontend/health/ExperimentHealthChip.tsxnew file mode 100644index 000000000000..9cbc59c01017--- /dev/null+++ b/products/experiments/frontend/health/ExperimentHealthChip.tsx@@ -0,0 +1,34 @@+import { useValues } from 'kea'++import { IconWarning } from '@posthog/icons'+import { LemonButton } from '@posthog/lemon-ui'++import { pluralize } from 'lib/utils/strings'+import { experimentLogic } from 'scenes/experiments/experimentLogic'++import { EXPERIMENT_HEALTH_PANEL_ELEMENT_ID } from '../constants'++export function ExperimentHealthChip(): JSX.Element | null {+ const { healthFindings } = useValues(experimentLogic)++ if (!healthFindings?.length) {+ return null+ }++ const hasCritical = healthFindings.some((finding) => finding.severity === 'critical')++ return (+ <LemonButton+ type="secondary"+ size="xsmall"+ icon={<IconWarning className={hasCritical ? 'text-danger' : 'text-warning'} />}+ onClick={() =>+ document.getElementById(EXPERIMENT_HEALTH_PANEL_ELEMENT_ID)?.scrollIntoView({ block: 'nearest' })+ }+ tooltip="Show the health checks"+ data-attr="experiment-health-chip"+ >+ {pluralize(healthFindings.length, 'issue')}+ </LemonButton>+ )+}diff --git a/products/experiments/frontend/health/ExperimentHealthDebug.tsx b/products/experiments/frontend/health/ExperimentHealthDebug.tsxnew file mode 100644index 000000000000..fe12fb4df274--- /dev/null+++ b/products/experiments/frontend/health/ExperimentHealthDebug.tsx@@ -0,0 +1,37 @@+import { useValues } from 'kea'++import { LemonCollapse, LemonTag } from '@posthog/lemon-ui'++import { superpowersLogic } from 'lib/components/Superpowers/superpowersLogic'+import { experimentLogic } from 'scenes/experiments/experimentLogic'++import { HealthDebugTables } from './HealthDebugTables'++export function ExperimentHealthDebug(): JSX.Element | null {+ const { superpowersEnabled } = useValues(superpowersLogic)+ const { experiment } = useValues(experimentLogic)++ // Null health means the experiment-health-findings flag is off for this user, so only staff who+ // work on the health layer see this section.+ if (!superpowersEnabled || experiment.health === null) {+ return null+ }++ return (+ <LemonCollapse+ panels={[+ {+ key: 'health-debug',+ header: (+ <span className="flex items-center gap-2">+ Health checks debug+ <LemonTag type="muted">Staff only</LemonTag>+ </span>+ ),+ dataAttr: 'experiment-health-debug',+ content: <HealthDebugTables />,+ },+ ]}+ />+ )+}diff --git a/products/experiments/frontend/health/ExperimentHealthPanel.tsx b/products/experiments/frontend/health/ExperimentHealthPanel.tsxnew file mode 100644index 000000000000..1562008b7bbf--- /dev/null+++ b/products/experiments/frontend/health/ExperimentHealthPanel.tsx@@ -0,0 +1,38 @@+import { useValues } from 'kea'++import { LemonCard } from '@posthog/lemon-ui'++import { experimentLogic } from 'scenes/experiments/experimentLogic'++import { EXPERIMENT_HEALTH_PANEL_ELEMENT_ID } from '../constants'+import { HealthFindingRow } from './HealthFindingRow'++export function ExperimentHealthPanel(): JSX.Element | null {+ const { healthFindings } = useValues(experimentLogic)++ if (!healthFindings?.length) {+ return null+ }++ return (+ <section+ id={EXPERIMENT_HEALTH_PANEL_ELEMENT_ID}+ aria-labelledby={`${EXPERIMENT_HEALTH_PANEL_ELEMENT_ID}-title`}+ data-attr="experiment-health-panel"+ >+ <LemonCard hoverEffect={false} className="p-0">+ <h3+ id={`${EXPERIMENT_HEALTH_PANEL_ELEMENT_ID}-title`}+ className="m-0 px-3 py-2 border-b text-sm font-semibold"+ >+ Health checks+ </h3>+ <div className="divide-y">+ {healthFindings.map((finding) => (+ <HealthFindingRow key={`${finding.code}:${finding.subcode ?? ''}`} finding={finding} />+ ))}+ </div>+ </LemonCard>+ </section>+ )+}diff --git a/products/experiments/frontend/health/HealthDebugTables.tsx b/products/experiments/frontend/health/HealthDebugTables.tsxnew file mode 100644index 000000000000..eef064c7182d--- /dev/null+++ b/products/experiments/frontend/health/HealthDebugTables.tsx@@ -0,0 +1,58 @@+import { useValues } from 'kea'++import { LemonTable, LemonTag } from '@posthog/lemon-ui'++import { CodeSnippet, Language } from 'lib/components/CodeSnippet'+import { experimentLogic } from 'scenes/experiments/experimentLogic'++import { experimentHealthDebugLogic } from './experimentHealthDebugLogic'+import type { HealthDebugCheck, HealthDebugFact } from './healthDebugReport'++export function HealthDebugTables(): JSX.Element {+ const { experiment, experimentId, healthFindings } = useValues(experimentLogic)+ const { healthDebugChecks: checks, healthDebugFacts: facts } = useValues(+ experimentHealthDebugLogic({ experimentId })+ )++ return (+ <div className="flex flex-col gap-4">+ <LemonTable<HealthDebugFact>+ size="small"+ showHeader={false}+ dataSource={facts}+ rowKey="label"+ columns={[+ { key: 'label', render: (_, fact) => <span className="font-semibold">{fact.label}</span> },+ { key: 'value', render: (_, fact) => <span className="font-mono text-xs">{fact.value}</span> },+ ]}+ />+ <LemonTable<HealthDebugCheck>+ size="small"+ dataSource={checks}+ rowKey={(check) => `${check.check}:${check.source}`}+ columns={[+ { title: 'Check', key: 'check', render: (_, check) => <code>{check.check}</code> },+ { title: 'Source', dataIndex: 'source' },+ {+ title: 'Result',+ key: 'result',+ render: (_, check) => (+ <span className="flex items-center gap-2">+ <code>{check.result}</code>+ {check.differs && <LemonTag type="danger">Differs</LemonTag>}+ </span>+ ),+ },+ { title: 'Inputs', dataIndex: 'note' },+ ]}+ />+ <CodeSnippet language={Language.JSON} thing="health debug data" maxLinesWithoutExpansion={12}>+ {JSON.stringify(+ { health: experiment.health ?? null, panelFindings: healthFindings, checks, facts },+ null,+ 2+ )}+ </CodeSnippet>+ </div>+ )+}diff --git a/products/experiments/frontend/health/HealthFindingActionButton.tsx b/products/experiments/frontend/health/HealthFindingActionButton.tsxnew file mode 100644index 000000000000..712773d0983a--- /dev/null+++ b/products/experiments/frontend/health/HealthFindingActionButton.tsx@@ -0,0 +1,119 @@+import { useActions, useValues } from 'kea'++import { LemonButton } from '@posthog/lemon-ui'++import { userHasAccess } from 'lib/utils/accessControlUtils'+import { experimentLogic } from 'scenes/experiments/experimentLogic'+import { exposureCriteriaModalLogic } from 'scenes/experiments/ExperimentView/exposureCriteriaModalLogic'+import { modalsLogic } from 'scenes/experiments/modalsLogic'+import { urls } from 'scenes/urls'++import { AccessControlLevel, AccessControlResourceType } from '~/types'++import { METRIC_CONTEXTS } from '../modals/ExperimentMetricModal/experimentMetricModalLogic'+import { metricSourceModalLogic } from '../modals/MetricSourceModal/metricSourceModalLogic'+import type { ExperimentHealthFindingActionKind } from './experimentHealthFindingEvents'++export function HealthFindingActionButton({+ actionKind,+ onClick,+}: {+ actionKind: ExperimentHealthFindingActionKind+ onClick: () => void+}): JSX.Element | null {+ const { experiment, exposureCriteria } = useValues(experimentLogic)+ const { openDistributionModal } = useActions(modalsLogic)+ const { openExposureCriteriaModal } = useActions(exposureCriteriaModalLogic)+ const { openMetricSourceModal } = useActions(metricSourceModalLogic)++ const canEdit = userHasAccess(+ AccessControlResourceType.Experiment,+ AccessControlLevel.Editor,+ experiment.user_access_level+ )+ const buttonProps = {+ size: 'small',+ type: 'secondary',+ // pinned: `data-attr` value, so renaming it breaks autocapture insights+ 'data-attr': `experiment-health-action-${actionKind}`,+ } as const+ // Every action except the flag link opens a form that saves the experiment.+ const editProps = {+ ...buttonProps,+ disabledReason: canEdit ? null : "You don't have permission to edit this experiment.",+ }++ switch (actionKind) {+ case 'open_feature_flag':+ return experiment.feature_flag ? (+ <LemonButton+ {...buttonProps}+ to={urls.featureFlag(experiment.feature_flag.id)}+ targetBlank+ onClick={onClick}+ >+ Open feature flag+ </LemonButton>+ ) : null+ case 'adjust_distribution':+ return (+ <LemonButton+ {...editProps}+ onClick={() => {+ onClick()+ openDistributionModal()+ }}+ >+ Adjust distribution+ </LemonButton>+ )+ case 'use_first_seen_variant':+ return (+ <LemonButton+ {...editProps}+ onClick={() => {+ onClick()+ openExposureCriteriaModal({ ...exposureCriteria, multiple_variant_handling: 'first_seen' })+ }}+ >+ Use first seen variant+ </LemonButton>+ )+ case 'edit_exposure_criteria':+ return (+ <LemonButton+ {...editProps}+ onClick={() => {+ onClick()+ openExposureCriteriaModal(exposureCriteria)+ }}+ >+ Edit exposure criteria+ </LemonButton>+ )+ case 'add_primary_metric':+ return (+ <LemonButton+ {...editProps}+ onClick={() => {+ onClick()+ openMetricSourceModal(METRIC_CONTEXTS.primary)+ }}+ >+ Add primary metric+ </LemonButton>+ )+ case 'add_secondary_metric':+ return (+ <LemonButton+ {...editProps}+ onClick={() => {+ onClick()+ openMetricSourceModal(METRIC_CONTEXTS.secondary)+ }}+ >+ Add secondary metric+ </LemonButton>+ )+ }+}diff --git a/products/experiments/frontend/health/HealthFindingRow.tsx b/products/experiments/frontend/health/HealthFindingRow.tsxnew file mode 100644index 000000000000..2ed642a7c16c--- /dev/null+++ b/products/experiments/frontend/health/HealthFindingRow.tsx@@ -0,0 +1,71 @@+import { useId, useState } from 'react'++import { IconChevronDown, IconChevronRight, IconInfo, IconWarning } from '@posthog/icons'+import { LemonButton } from '@posthog/lemon-ui'++import { cn } from 'lib/utils/css-classes'++import { HealthFindingActionButton } from './HealthFindingActionButton'+import type { HealthPanelFinding } from './healthPanelFindings'+import { useHealthFindingReporting } from './useHealthFindingReporting'++export function HealthFindingRow({ finding }: { finding: HealthPanelFinding }): JSX.Element {+ const [isDetailOpen, setIsDetailOpen] = useState(false)+ const detailId = useId()+ const { reportOpened, reportActedOn } = useHealthFindingReporting({+ code: finding.code,+ variant: finding.subcode ?? undefined,+ })++ return (+ <div className="flex flex-col gap-1 px-3 py-2" data-attr="experiment-health-finding">+ <div className="flex flex-wrap items-center justify-between gap-2">+ <div className="flex items-center gap-2 min-w-0">+ {finding.severity === 'info' ? (+ <IconInfo className="text-secondary text-lg shrink-0" />+ ) : (+ <IconWarning+ className={cn(+ 'text-lg shrink-0',+ finding.severity === 'critical' ? 'text-danger' : 'text-warning'+ )}+ />+ )}+ <span className="font-semibold">{finding.title}</span>+ <LemonButton+ size="xsmall"+ type="tertiary"+ sideIcon={isDetailOpen ? <IconChevronDown /> : <IconChevronRight />}+ onClick={() => {+ if (!isDetailOpen) {+ reportOpened('why')+ }+ setIsDetailOpen(!isDetailOpen)+ }}+ aria-expanded={isDetailOpen}+ aria-controls={detailId}+ data-attr="experiment-health-finding-why"+ >+ Why?+ </LemonButton>+ </div>+ {finding.actions.length > 0 && (+ <div className="flex flex-wrap items-center gap-2">+ {finding.actions.map((actionKind) => (+ <HealthFindingActionButton+ key={actionKind}+ actionKind={actionKind}+ onClick={() => reportActedOn(actionKind)}+ />+ ))}+ </div>+ )}+ </div>+ {isDetailOpen && (+ <p id={detailId} className="m-0 pl-7 text-secondary">+ {finding.detail}+ </p>+ )}+ </div>+ )+}diff --git a/products/experiments/frontend/health/experimentHealthDebugLogic.ts b/products/experiments/frontend/health/experimentHealthDebugLogic.tsnew file mode 100644index 000000000000..073d9930c3c5--- /dev/null+++ b/products/experiments/frontend/health/experimentHealthDebugLogic.ts@@ -0,0 +1,190 @@+import { MakeLogicType, connect, kea, key, path, props, selectors } from 'kea'++import { type ExperimentLogicProps, type ExperimentWarning, experimentLogic } from 'scenes/experiments/experimentLogic'+import { resolveMultipleVariantHandling } from 'scenes/experiments/utils'++import type { ExperimentExposureCriteria, ExperimentMetricUnion } from '~/queries/schema/schema-general'+import type { Experiment, ExperimentIdType } from '~/types'++import {+ type HealthDebugCheck,+ type HealthDebugFact,+ type HealthDebugInput,+ buildHealthDebugChecks,+ buildHealthDebugFacts,+ describePanel,+ describeServerHealth,+} from './healthDebugReport'+import { type HealthPanelFinding, hoursSinceStart } from './healthPanelFindings'++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface experimentHealthDebugLogicValues {+ browserExperimentWarning: ExperimentWarning | null // experimentLogic+ browserNoMetricsWarning: boolean // experimentLogic+ experiment: Experiment // experimentLogic+ experimentLoadCount: number // experimentLogic+ exposureCriteria: ExperimentExposureCriteria | undefined // experimentLogic+ exposures: any // experimentLogic+ exposuresLoading: boolean // experimentLogic+ healthFindings: HealthPanelFinding[] | null // experimentLogic+ isExperimentDraft: boolean // experimentLogic+ orderedPrimaryMetricsWithResults: {+ displayIndex: number+ error: any+ metric: ExperimentMetricUnion+ metricIndex: number+ result: any+ }[] // experimentLogic+ orderedSecondaryMetricsWithResults: {+ displayIndex: number+ error: any+ metric: ExperimentMetricUnion+ metricIndex: number+ result: any+ }[] // experimentLogic+ healthDebugChecks: HealthDebugCheck[]+ healthDebugFacts: HealthDebugFact[]+ pageMetricCounts: HealthDebugInput['pageMetricCounts']+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface experimentHealthDebugLogicMeta {+ key: ExperimentIdType+ __keaTypeGenInternalSelectorTypes: {+ pageMetricCounts: (+ orderedPrimaryMetricsWithResults: {+ displayIndex: number+ error: any+ metric: ExperimentMetricUnion+ metricIndex: number+ result: any+ }[],+ orderedSecondaryMetricsWithResults: {+ displayIndex: number+ error: any+ metric: ExperimentMetricUnion+ metricIndex: number+ result: any+ }[]+ ) => HealthDebugInput['pageMetricCounts']+ healthDebugChecks: (+ experiment: Experiment,+ healthFindings: HealthPanelFinding[] | null,+ browserExperimentWarning: ExperimentWarning | null,+ browserNoMetricsWarning: boolean,+ pageMetricCounts: {+ primary: number+ secondary: number+ },+ isExperimentDraft: boolean,+ exposures: any,+ exposuresLoading: boolean,+ exposureCriteria: ExperimentExposureCriteria | undefined+ ) => HealthDebugCheck[]+ healthDebugFacts: (+ experiment: Experiment,+ healthFindings: HealthPanelFinding[] | null,+ pageMetricCounts: {+ primary: number+ secondary: number+ },+ experimentLoadCount: number+ ) => HealthDebugFact[]+ }+}++export type experimentHealthDebugLogicType = MakeLogicType<+ experimentHealthDebugLogicValues,+ {},+ ExperimentLogicProps,+ experimentHealthDebugLogicMeta+>++/** The staff-only view of the health checks: what each check read and why the panel shows what it shows. */+export const experimentHealthDebugLogic = kea<experimentHealthDebugLogicType>([+ props({} as ExperimentLogicProps),+ key((props) => props.experimentId ?? 'new'),+ path((key) => ['products', 'experiments', 'health', 'experimentHealthDebugLogic', key]),+ connect((props: ExperimentLogicProps) => ({+ values: [+ experimentLogic(props),+ [+ 'experiment',+ 'healthFindings',+ 'browserExperimentWarning',+ 'browserNoMetricsWarning',+ 'exposures',+ 'exposuresLoading',+ 'exposureCriteria',+ 'isExperimentDraft',+ 'orderedPrimaryMetricsWithResults',+ 'orderedSecondaryMetricsWithResults',+ 'experimentLoadCount',+ ],+ ],+ })),+ selectors({+ pageMetricCounts: [+ (s) => [s.orderedPrimaryMetricsWithResults, s.orderedSecondaryMetricsWithResults],+ (primary: unknown[], secondary: unknown[]): HealthDebugInput['pageMetricCounts'] => ({+ primary: primary.length,+ secondary: secondary.length,+ }),+ ],+ healthDebugChecks: [+ (s) => [+ s.experiment,+ s.healthFindings,+ s.browserExperimentWarning,+ s.browserNoMetricsWarning,+ s.pageMetricCounts,+ s.isExperimentDraft,+ s.exposures,+ s.exposuresLoading,+ s.exposureCriteria,+ ],+ (+ experiment: Experiment,+ healthFindings: HealthPanelFinding[] | null,+ browserWarning: HealthDebugInput['browserWarning'],+ browserNoMetricsWarning: boolean,+ pageMetricCounts: HealthDebugInput['pageMetricCounts'],+ isExperimentDraft: boolean,+ exposures: HealthDebugInput['exposures'],+ exposuresLoading: boolean,+ exposureCriteria: ExperimentExposureCriteria | undefined+ ): HealthDebugCheck[] =>+ buildHealthDebugChecks({+ health: experiment.health,+ panelFindings: healthFindings,+ browserWarning,+ browserNoMetricsWarning,+ pageMetricCounts,+ isExperimentDraft,+ hoursSinceStart: hoursSinceStart(experiment.start_date),+ exposures,+ exposuresLoading,+ multipleVariantHandling: resolveMultipleVariantHandling(+ exposureCriteria?.multiple_variant_handling+ ),+ }),+ ],+ healthDebugFacts: [+ (s) => [s.experiment, s.healthFindings, s.pageMetricCounts, s.experimentLoadCount],+ (+ experiment: Experiment,+ healthFindings: HealthPanelFinding[] | null,+ pageMetricCounts: HealthDebugInput['pageMetricCounts'],+ experimentLoadCount: number+ ): HealthDebugFact[] => [+ { label: 'Server health', value: describeServerHealth(experiment.health) },+ { label: 'Health panel', value: describePanel(healthFindings) },+ {+ label: 'Page load',+ value: `${experimentLoadCount}. Each finding is reported as shown once per load.`,+ },+ ...buildHealthDebugFacts(experiment, pageMetricCounts),+ ],+ ],+ }),+])diff --git a/products/experiments/frontend/health/experimentHealthFindingEvents.ts b/products/experiments/frontend/health/experimentHealthFindingEvents.tsindex b03fc9bbcbc1..63622714ef96 100644--- a/products/experiments/frontend/health/experimentHealthFindingEvents.ts+++ b/products/experiments/frontend/health/experimentHealthFindingEvents.ts@@ -28,7 +28,7 @@ export interface ExperimentHealthFinding {}// pinned: `open_kind` property values, for the same reason as the codes above.-export type ExperimentHealthFindingOpenKind = 'evidence' | 'docs'+export type ExperimentHealthFindingOpenKind = 'evidence' | 'docs' | 'why'// pinned: `action_kind` property values, for the same reason as the codes above.export type ExperimentHealthFindingActionKind =@@ -47,6 +47,10 @@ const EXPERIMENT_WARNING_FINDING_CODES: Record<ExperimentWarningKey, ExperimentHnot_started_but_multiple_variants_rolled_out: 'flag_live_before_launch',}+export const FLAG_STATE_FINDING_CODES: ReadonlySet<ExperimentHealthFindingCode> = new Set(+ Object.values(EXPERIMENT_WARNING_FINDING_CODES)+)+export function healthFindingForExperimentWarning(warningKey: ExperimentWarningKey): ExperimentHealthFinding {return { code: EXPERIMENT_WARNING_FINDING_CODES[warningKey], variant: warningKey }}diff --git a/products/experiments/frontend/health/exposureHealth.ts b/products/experiments/frontend/health/exposureHealth.tsindex 8c110aa23dd2..e113f72c91c9 100644--- a/products/experiments/frontend/health/exposureHealth.ts+++ b/products/experiments/frontend/health/exposureHealth.ts@@ -2,6 +2,9 @@ import type { ExperimentExposureQueryResponse } from '~/queries/schema/schema-geconst SAMPLE_RATIO_MISMATCH_P_VALUE = 0.001+export const SAMPLE_RATIO_MISMATCH_DESCRIPTION =+ "The distribution of users across variants doesn't match your configured rollout percentages (p < 0.001). This may indicate issues with randomization or data collection."+export function hasSampleRatioMismatch(exposures: ExperimentExposureQueryResponse | null | undefined): boolean {return (exposures?.sample_ratio_mismatch != null &&diff --git a/products/experiments/frontend/health/healthDebugReport.test.ts b/products/experiments/frontend/health/healthDebugReport.test.tsnew file mode 100644index 000000000000..7830fa090c57--- /dev/null+++ b/products/experiments/frontend/health/healthDebugReport.test.ts@@ -0,0 +1,79 @@+import type { ExperimentWarning } from 'scenes/experiments/experimentLogic'++import type { ExperimentHealthApi, ExperimentHealthFindingApi } from '../generated/api.schemas'+import { type HealthDebugInput, buildHealthDebugChecks } from './healthDebugReport'++const PAUSED: ExperimentHealthFindingApi = {+ code: 'flag_off_while_running',+ subcode: 'running_but_flag_disabled',+ severity: 'warning',+ title: 'The experiment is paused',+ detail: '',+ evidence: {},+ actions: ['open_feature_flag'],+ diagnostic_ref: 'A5',+}++const input = (overrides: Partial<HealthDebugInput>): HealthDebugInput => ({+ health: { findings: [] },+ panelFindings: [],+ browserWarning: null,+ browserNoMetricsWarning: false,+ pageMetricCounts: { primary: 1, secondary: 0 },+ isExperimentDraft: false,+ hoursSinceStart: 72,+ exposures: null,+ exposuresLoading: false,+ multipleVariantHandling: 'exclude',+ ...overrides,+})++describe('buildHealthDebugChecks', () => {+ test.each<{+ name: string+ health: ExperimentHealthApi | null+ browserWarning: ExperimentWarning | null+ browserNoMetricsWarning: boolean+ expected: string[]+ }>([+ {+ name: 'browser rules agree with the server',+ health: { findings: [PAUSED] },+ browserWarning: { key: 'running_but_flag_disabled' },+ browserNoMetricsWarning: false,+ expected: [],+ },+ {+ name: 'a flag-state warning only the server finds',+ health: { findings: [PAUSED] },+ browserWarning: null,+ browserNoMetricsWarning: false,+ expected: ['flag_state'],+ },+ {+ name: 'a flag-state subcode the page does not know, while the browser finds nothing',+ health: { findings: [{ ...PAUSED, subcode: 'running_but_unknown_case' }] },+ browserWarning: null,+ browserNoMetricsWarning: false,+ expected: ['flag_state'],+ },+ {+ name: 'no metrics on the page while the server counts one',+ health: { findings: [] },+ browserWarning: null,+ browserNoMetricsWarning: true,+ expected: ['no_metric'],+ },+ {+ name: 'nothing to compare without server health',+ health: null,+ browserWarning: { key: 'running_but_flag_disabled' },+ browserNoMetricsWarning: true,+ expected: [],+ },+ ])('$name', ({ health, browserWarning, browserNoMetricsWarning, expected }) => {+ const checks = buildHealthDebugChecks(input({ health, browserWarning, browserNoMetricsWarning }))++ expect(checks.filter(({ differs }) => differs).map(({ check }) => check)).toEqual(expected)+ })+})diff --git a/products/experiments/frontend/health/healthDebugReport.ts b/products/experiments/frontend/health/healthDebugReport.tsnew file mode 100644index 000000000000..ef26626bb686--- /dev/null+++ b/products/experiments/frontend/health/healthDebugReport.ts@@ -0,0 +1,275 @@+import type { ExperimentWarning } from 'scenes/experiments/experimentLogic'++import type { ExperimentExposureQueryResponse } from '~/queries/schema/schema-general'+import type { Experiment } from '~/types'++import { EXPERIMENT_VARIANT_MULTIPLE } from '../constants'+import { getExperimentStatus } from '../experimentStatus'+import type { ExperimentHealthApi, ExperimentHealthFindingApi } from '../generated/api.schemas'+import { FLAG_STATE_FINDING_CODES, experimentWarningFromHealth } from './experimentHealthFindingEvents'+import { getTotalExposures } from './exposureHealth'+import { type HealthPanelFinding, ZERO_EXPOSURES_GRACE_HOURS } from './healthPanelFindings'++export type HealthDebugSource = 'server' | 'browser rules' | 'exposure answer'++export interface HealthDebugCheck {+ check: string+ source: HealthDebugSource+ result: string+ /** The inputs behind the result, or why the check gave none. */+ note: string | null+ /** True when the browser's rules and the server's check disagree. */+ differs: boolean+}++export interface HealthDebugInput {+ health: ExperimentHealthApi | null | undefined+ panelFindings: HealthPanelFinding[] | null+ browserWarning: ExperimentWarning | null+ browserNoMetricsWarning: boolean+ pageMetricCounts: { primary: number; secondary: number }+ isExperimentDraft: boolean+ hoursSinceStart: number | null+ exposures: ExperimentExposureQueryResponse | null | undefined+ exposuresLoading: boolean+ multipleVariantHandling: 'exclude' | 'first_seen'+}++const NO_FINDING = 'no finding'+const NOT_SENT = 'not sent'++export function describeServerHealth(health: ExperimentHealthApi | null | undefined): string {+ if (health === null) {+ return 'null: the experiment-health-findings flag is off for this user'+ }+ if (health === undefined) {+ return 'missing: a flag save outside the experiment API dropped the findings, so reload the page'+ }+ return `${health.findings.length} findings`+}++export function describePanel(panelFindings: HealthPanelFinding[] | null): string {+ if (panelFindings === null) {+ return 'hidden: no server health, so the page shows its separate warnings'+ }+ if (panelFindings.length === 0) {+ return 'hidden: no findings'+ }+ return `shows ${panelFindings.length} findings`+}++function warningLabel(warning: ExperimentWarning | null): string {+ if (!warning) {+ return NO_FINDING+ }+ return warning.variantKey ? `${warning.key} (${warning.variantKey})` : warning.key+}++function serverResult(+ health: ExperimentHealthApi | null | undefined,+ matches: (code: ExperimentHealthFindingApi['code']) => boolean+): string {+ if (!health) {+ return NOT_SENT+ }+ const finding = health.findings.find((candidate) => matches(candidate.code))+ if (!finding) {+ return NO_FINDING+ }+ const variantKey = finding.evidence.variant_key+ return [finding.code, finding.subcode, typeof variantKey === 'string' ? `(${variantKey})` : null]+ .filter(Boolean)+ .join(' · ')+}++function flagStateChecks(input: HealthDebugInput): HealthDebugCheck[] {+ const serverWarning = input.health ? experimentWarningFromHealth(input.health) : null+ // A subcode the page does not know maps to no warning, so it can match a browser that finds none.+ // The raw finding still counts as a difference then.+ const hasUnmappedServerFinding =+ !serverWarning && !!input.health?.findings.some((finding) => FLAG_STATE_FINDING_CODES.has(finding.code))+ const differs =+ !!input.health &&+ (hasUnmappedServerFinding || warningLabel(serverWarning) !== warningLabel(input.browserWarning))+ return [+ {+ check: 'flag_state',+ source: 'server',+ result: serverResult(input.health, (code) => FLAG_STATE_FINDING_CODES.has(code)),+ note: null,+ differs: false,+ },+ {+ check: 'flag_state',+ source: 'browser rules',+ result: warningLabel(input.browserWarning),+ note: differs ? "Differs from the server's finding. The page shows the server's." : null,+ differs,+ },+ ]+}++function noMetricChecks(input: HealthDebugInput): HealthDebugCheck[] {+ const { primary, secondary } = input.pageMetricCounts+ const serverFires = !!input.health?.findings.some((finding) => finding.code === 'no_metric')+ const differs = !!input.health && input.browserNoMetricsWarning !== serverFires+ return [+ {+ check: 'no_metric',+ source: 'server',+ result: serverResult(input.health, (code) => code === 'no_metric'),+ note: null,+ differs: false,+ },+ {+ check: 'no_metric',+ source: 'browser rules',+ result: input.browserNoMetricsWarning ? 'no_metric' : NO_FINDING,+ note: `The page lists ${primary} primary and ${secondary} secondary metrics.${+ differs ? " Differs from the server's finding. The page shows the server's." : ''+ }`,+ differs,+ },+ ]+}++function exposureChecks(input: HealthDebugInput): HealthDebugCheck[] {+ const { exposures } = input+ const panelCodes = new Set(input.panelFindings?.map((finding) => finding.code))+ const serverCodes = new Set<string>(input.health?.findings.map((finding) => finding.code))+ const skipped = input.isExperimentDraft+ ? 'skipped: the experiment is a draft'+ : !exposures+ ? input.exposuresLoading+ ? 'skipped: the exposures are loading'+ : 'skipped: no exposure answer'+ : null++ const result = (code: HealthPanelFinding['code']): string => {+ if (skipped) {+ return skipped+ }+ if (serverCodes.has(code)) {+ return 'not added: the server sent this code'+ }+ return panelCodes.has(code) ? code : NO_FINDING+ }++ const total = getTotalExposures(exposures)+ const multiple = Number(exposures?.total_exposures?.[EXPERIMENT_VARIANT_MULTIPLE] || 0)+ const pValue = exposures?.sample_ratio_mismatch?.p_value+ return [+ {+ check: 'zero_exposures',+ source: 'exposure answer',+ result: result('zero_exposures'),+ note: exposures+ ? `${total} users exposed. ${+ input.hoursSinceStart === null+ ? 'Not launched.'+ : `Started ${Math.floor(input.hoursSinceStart)} hours ago. The finding waits ${ZERO_EXPOSURES_GRACE_HOURS} hours.`+ }`+ : null,+ differs: false,+ },+ {+ check: 'srm',+ source: 'exposure answer',+ result: result('srm'),+ note: exposures+ ? pValue != null+ ? `p = ${pValue.toPrecision(3)}. The finding needs p < 0.001.`+ : 'The exposure answer has no sample ratio test.'+ : null,+ differs: false,+ },+ {+ check: 'bias_risk_multiple_excluded',+ source: 'exposure answer',+ result: result('bias_risk_multiple_excluded'),+ note: exposures+ ? `${exposures.bias_risk ? `bias_risk ${exposures.bias_risk.multiple_variant_percentage.toFixed(2)}%` : 'No bias_risk in the answer'}. $multiple: ${multiple} of ${total} users. Handling: ${input.multipleVariantHandling}.`+ : null,+ differs: false,+ },+ ]+}++/** One row per check and source, so a reader can see why the health panel shows what it shows. */+export function buildHealthDebugChecks(input: HealthDebugInput): HealthDebugCheck[] {+ return [+ ...flagStateChecks(input),+ ...noMetricChecks(input),+ {+ check: 'bias_risk_multiple_excluded',+ source: 'server',+ result: serverResult(input.health, (code) => code === 'bias_risk_multiple_excluded'),+ note: null,+ differs: false,+ },+ ...exposureChecks(input),+ ]+}++export interface HealthDebugFact {+ label: string+ value: string+}++function percentage(value: unknown): string {+ return typeof value === 'number' ? `${value}%` : 'unset'+}++/** The experiment and flag state that the server's checks read, as the browser holds it. */+export function buildHealthDebugFacts(+ experiment: Experiment,+ pageMetricCounts: HealthDebugInput['pageMetricCounts']+): HealthDebugFact[] {+ const flag = experiment.feature_flag+ const groups = flag?.filters?.groups ?? []+ const variants = flag?.filters?.multivariate?.variants ?? []+ const sharedMetricTypes = (experiment.saved_metrics ?? []).map(+ (link: { metadata?: { type?: string } }) => link.metadata?.type ?? 'none'+ )+ const countType = (type: string): number => sharedMetricTypes.filter((linkType) => linkType === type).length++ return [+ { label: 'Status', value: getExperimentStatus(experiment) },+ { label: 'Start date', value: experiment.start_date ?? 'none' },+ { label: 'End date', value: experiment.end_date ?? 'none' },+ { label: 'Archived', value: String(!!experiment.archived) },+ {+ label: 'Feature flag',+ value: flag ? `${flag.key}, active: ${flag.active}, deleted: ${!!flag.deleted}` : 'none',+ },+ {+ label: 'Release groups',+ value: groups.length+ ? groups+ .map((group) => {+ const properties = Array.isArray(group.properties) ? group.properties.length : 0+ return `${percentage(group.rollout_percentage)} with ${properties} properties`+ })+ .join('; ')+ : 'none',+ },+ {+ label: 'Variants',+ value: variants.length+ ? variants.map((variant) => `${variant.key} ${percentage(variant.rollout_percentage)}`).join(', ')+ : 'none',+ },+ {+ label: 'Single-use metrics',+ value: `${experiment.metrics?.length ?? 0} primary, ${experiment.metrics_secondary?.length ?? 0} secondary`,+ },+ {+ label: 'Shared metric links',+ value: `${countType('primary')} primary, ${countType('secondary')} secondary, ${countType('none')} without a type`,+ },+ {+ label: 'Metrics the page lists',+ value: `${pageMetricCounts.primary} primary, ${pageMetricCounts.secondary} secondary`,+ },+ ]+}diff --git a/products/experiments/frontend/health/healthPanelFindings.test.ts b/products/experiments/frontend/health/healthPanelFindings.test.tsnew file mode 100644index 000000000000..932c2f4fd696--- /dev/null+++ b/products/experiments/frontend/health/healthPanelFindings.test.ts@@ -0,0 +1,90 @@+import type { ExperimentHealthApi, ExperimentHealthFindingApi } from '../generated/api.schemas'+import { type ExposureHealthInput, healthPanelFindings } from './healthPanelFindings'++const serverFinding = (code: ExperimentHealthFindingApi['code']): ExperimentHealthFindingApi => ({+ code,+ subcode: null,+ severity: 'warning',+ title: code,+ detail: code,+ evidence: {},+ actions: [],+ diagnostic_ref: null,+})++// The exposure query returns a series for every configured variant, with zero counts when nobody was exposed.+const NO_EXPOSURES = {+ timeseries: [{ variant: 'control' }, { variant: 'test' }],+ total_exposures: { control: 0, test: 0 },+}++const UNEVEN_EXPOSURES = {+ timeseries: [{ variant: 'control' }, { variant: 'test' }],+ total_exposures: { control: 600, test: 400 },+ sample_ratio_mismatch: { expected: { control: 500, test: 500 }, p_value: 0.0001 },+ bias_risk: { multiple_variant_percentage: 5 },+}++describe('healthPanelFindings', () => {+ test.each<{+ name: string+ health: ExperimentHealthApi | null+ exposures: Record<string, unknown> | null+ isExperimentDraft: boolean+ hoursSinceStart: number | null+ expected: string[] | null+ }>([+ {+ name: 'no panel without server findings, so the page keeps its own warnings',+ health: null,+ exposures: UNEVEN_EXPOSURES,+ isExperimentDraft: false,+ hoursSinceStart: 72,+ expected: null,+ },+ {+ name: 'no exposure finding before the exposures load',+ health: { findings: [serverFinding('no_metric')] },+ exposures: null,+ isExperimentDraft: false,+ hoursSinceStart: 72,+ expected: ['no_metric'],+ },+ {+ name: 'no zero-exposure finding on a draft',+ health: { findings: [serverFinding('flag_live_before_launch')] },+ exposures: NO_EXPOSURES,+ isExperimentDraft: true,+ hoursSinceStart: null,+ expected: ['flag_live_before_launch'],+ },+ {+ name: 'no users exposed a day after launch',+ health: { findings: [] },+ exposures: NO_EXPOSURES,+ isExperimentDraft: false,+ hoursSinceStart: 24,+ expected: ['zero_exposures'],+ },+ {+ name: 'no zero-exposure finding in the first day',+ health: { findings: [] },+ exposures: NO_EXPOSURES,+ isExperimentDraft: false,+ hoursSinceStart: 23,+ expected: [],+ },+ {+ name: 'a finding the server already sent is not added again from the exposures',+ health: { findings: [serverFinding('bias_risk_multiple_excluded')] },+ exposures: UNEVEN_EXPOSURES,+ isExperimentDraft: false,+ hoursSinceStart: 72,+ expected: ['bias_risk_multiple_excluded', 'srm'],+ },+ ])('$name', ({ health, exposures, isExperimentDraft, hoursSinceStart, expected }) => {+ const input = { exposures, isExperimentDraft, hoursSinceStart } as ExposureHealthInput++ expect(healthPanelFindings(health, input)?.map(({ code }) => code) ?? null).toEqual(expected)+ })+})diff --git a/products/experiments/frontend/health/healthPanelFindings.ts b/products/experiments/frontend/health/healthPanelFindings.tsnew file mode 100644index 000000000000..e7339adeaf54--- /dev/null+++ b/products/experiments/frontend/health/healthPanelFindings.ts@@ -0,0 +1,94 @@+import { dayjs } from 'lib/dayjs'++import type { ExperimentExposureQueryResponse } from '~/queries/schema/schema-general'++import type { ExperimentHealthApi, ExperimentHealthFindingApi } from '../generated/api.schemas'+import type { ExperimentHealthFindingActionKind, ExperimentHealthFindingCode } from './experimentHealthFindingEvents'+import { SAMPLE_RATIO_MISMATCH_DESCRIPTION, getTotalExposures, hasSampleRatioMismatch } from './exposureHealth'++/** A finding of the health panel: one from the server, or one the page reads from the exposure answer. */+export type HealthPanelFinding = Pick<ExperimentHealthFindingApi, 'subcode' | 'severity' | 'title' | 'detail'> & {+ code: ExperimentHealthFindingCode+ actions: ExperimentHealthFindingActionKind[]+}++export interface ExposureHealthInput {+ exposures: ExperimentExposureQueryResponse | null | undefined+ isExperimentDraft: boolean+ /** Null before launch. */+ hoursSinceStart: number | null+}++// A new experiment often has no exposure in its first hours, so the finding waits as long as the+// experiments scout does.+export const ZERO_EXPOSURES_GRACE_HOURS = 24++export function hoursSinceStart(startDate: string | null | undefined): number | null {+ return startDate ? dayjs().diff(startDate, 'hour', true) : null+}++// The server's health checks read no exposures, so the page derives these three from the exposure+// answer. The bias text matches products/experiments/backend/health/checks/bias_risk.py.+function exposureFindings({+ exposures,+ isExperimentDraft,+ hoursSinceStart,+}: ExposureHealthInput): HealthPanelFinding[] {+ if (isExperimentDraft || !exposures) {+ return []+ }+ const findings: HealthPanelFinding[] = []+ // The exposure query returns a series for every configured variant, with zero counts when+ // nobody was exposed, so only the total tells an experiment without exposures apart.+ if (+ getTotalExposures(exposures) === 0 &&+ hoursSinceStart !== null &&+ hoursSinceStart >= ZERO_EXPOSURES_GRACE_HOURS+ ) {+ findings.push({+ code: 'zero_exposures',+ subcode: null,+ severity: 'warning',+ title: 'No users exposed',+ detail: 'No users have been exposed to this experiment, so it shows no results. Users are counted when the exposure event is sent for them. Check that your code evaluates the linked feature flag and that the exposure criteria match the events you send.',+ actions: ['edit_exposure_criteria'],+ })+ }+ if (hasSampleRatioMismatch(exposures)) {+ findings.push({+ code: 'srm',+ subcode: null,+ severity: 'warning',+ title: 'Users are not split across variants as configured',+ detail: SAMPLE_RATIO_MISMATCH_DESCRIPTION,+ actions: [],+ })+ }+ if (exposures.bias_risk) {+ findings.push({+ code: 'bias_risk_multiple_excluded',+ subcode: null,+ severity: 'warning',+ title: 'Setup likely introduced bias',+ detail: `${exposures.bias_risk.multiple_variant_percentage.toFixed(1)}% of users were exposed to multiple variants. With an uneven variant split and the Exclude handling, these users were dropped more often from the smaller variant, so its metrics can be biased. Use an even split and control exposure with the overall rollout, or switch the handling to First seen.`,+ actions: ['adjust_distribution', 'use_first_seen_variant'],+ })+ }+ return findings+}++/**+ * The findings of the health panel, or null when the server sent no health findings. Null means that+ * the reader does not have the health findings flag, or that a local flag write dropped stale findings.+ * The page then shows its separate warnings instead of the panel.+ */+export function healthPanelFindings(+ health: ExperimentHealthApi | null | undefined,+ exposureInput: ExposureHealthInput+): HealthPanelFinding[] | null {+ if (!health) {+ return null+ }+ const serverCodes = new Set<string>(health.findings.map((finding) => finding.code))+ return [...health.findings, ...exposureFindings(exposureInput).filter(({ code }) => !serverCodes.has(code))]+}