: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(replay-vision): explain why scanners have nothing to scan (#127077)
Tue Haulund2d553c06a248
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex fda87b85f4d6..4e303089740a 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -14907,9 +14907,9 @@ snapshots:scenes-app-replay-vision--classifier-observations--light:hash: v1.k794b7964.6fcacc536adc9752bdbb5f599db6e3f06594fa4debc7a4540b6b525bb11e793c.NI3Vj1WWags8OLGTQopF6STboc11xrZ0b16N9jIYOIMscenes-app-replay-vision--classifier-overview--dark:- hash: v1.k794b7964.5b5e1b2351b8751b237e9395498394c8c38066bde74c8bc2fcc24be157b533f8.bfui9VR408mO2dqavb84bmjznqttxLLzm7CoAUbJVFI+ hash: v1.k794b7964.44777332640ca19293eff7a5b8c25f069d4c214db39f83dc688e96bdaca93a6f.QPOL1cBtLQlZTFoJ4x7RHHTiY_LNsTEwvNu056U4HJoscenes-app-replay-vision--classifier-overview--light:- hash: v1.k794b7964.194ca4c49d68460e06f361407a05e0629cbaae418dcb9ff5acfbb469ebbcd3b0.DaGPf-7jP1nkfUL2TJAXzpk3CEoIDyHTNOfPMiOA_jI+ hash: v1.k794b7964.c4a5d91f35e020779f82fdc981996f393921eaa73b48820e7c3cb1681d5ee243._jncBVPLDF-n8eR124Q8R_u8hMU78jbWLWxlITXTRzsscenes-app-replay-vision--experiment-variants--dark:hash: v1.k794b7964.fdd4adf30d177da572195bd1b9e9d0c14e352c6673851f25f8a020270c50e08f.6WesLWYfxfVHjS8EmBHUzdkoSYACQdRj1VauuiONc6oscenes-app-replay-vision--experiment-variants--light:@@ -14951,25 +14951,25 @@ snapshots:scenes-app-replay-vision--monitor-observations--light:hash: v1.k794b7964.432b542fcb0acbebc5abd9deb9428d4aa1337b128305383161d5a161f4d01df1.UZF1mz1jxDx4rm1QMuy79xQDwcoWze3_ZFs0RLAVQCMscenes-app-replay-vision--monitor-overview--dark:- hash: v1.k794b7964.79627bbcaf1345596a4230711f90d9eba24f1573be64c223b3c05fb85642b05f.0imokLmvnCGRhNwGiL6uxRaz3DayL3voUkn-lGl3TMg+ hash: v1.k794b7964.f0072ad63fabb143ddd91aa7c8f1ccfacda0fd578ce8d828ca4d903be398a0fa.qSYnfqJMLLUPiRXvK6O5T9rSw4iYvLFpgcvTANCGjNMscenes-app-replay-vision--monitor-overview--light:- hash: v1.k794b7964.78c674851e796673dbc50f43f862493f25b646aa72f0e45170dd66b737e4d8d7.3KYDsrwG2gMYKec4kttVDHpZr5J7WnNCbtj-sXFDrLc+ hash: v1.k794b7964.d8d5c879323bde6f4372bf480434ed5d14cc9c00658eff9eeabe04068fbe60e6.4MnFX8GscreLZjhHtVMo9DfkX8jRDJ8zyXGKIKEkwPgscenes-app-replay-vision--monitor-overview-dashboard-offer--dark:- hash: v1.k794b7964.938b0069da1eb943fdd15aadb01c142603111292859bc34fea0f93bce95f7ac8.qVQYF7Gy-ISCeG-RjVYnDXF_HcEzaHxpM8A1atMZBdE+ hash: v1.k794b7964.b58776311d4b55928c761d5b21e59818a56f79fe060e56eeff8bf2de773ecd4a.Fnf3PaVmNCpbv7116EE6m7d3jiHUnUZ-Qfj7Zq7jkK8scenes-app-replay-vision--monitor-overview-dashboard-offer--light:- hash: v1.k794b7964.cc0d32580736768a2944ed90c09ef78ffac5e8c3ffc15d51307d7529f8a9a606.vEM-tv6APY-YhgbYYYe4LREOHBxr1SvVvsXVouNLnxE+ hash: v1.k794b7964.69c7aa5fbfe70aebeed14b950cf422f42f1c5055d58a046c57b51484acdf6bf3.McejE_tn0QaYxYQ-mBvAlH9le5JF7emXlX0jGW6Jn_kscenes-app-replay-vision--monitor-overview-with-root-cause--dark:- hash: v1.k794b7964.95eb50d69e46376f28de8821b0d1dfa356c08db91249e14f900cb54e7d58c278.oCAAFUd8iCTVgaeYB6ogtIxzaALytcTJ7tuCFgqEED8+ hash: v1.k794b7964.5951ebfe65e4ce71a3278814c656eb4da73aae6f76731be6598c7b5a255474b0.2SscOHGiyKqu3s7KKHnOPec11x5AWgx_TFbOJok-WPoscenes-app-replay-vision--monitor-overview-with-root-cause--light:- hash: v1.k794b7964.073eab68ce364fe54825e75de13b55b6ba8311f3847ac3d9587b13a92535b1a5.nUn1DOo5NrJydsJ5f6DcBI9-1ekBAIBckrHF_hZGb2Q+ hash: v1.k794b7964.2a4bdccd5b8f85671aadcc50fdd7ee288dd01a60f50cbb03696df7b1a07cf0ea.47o5rxa3z2_eXGmtWmNGDeTc6qj2AEXUnSQxwpZznesscenes-app-replay-vision--monitor-overview-with-scout-report--dark:- hash: v1.k794b7964.014ed4f3a48e4a8278a97cb0649d3374b2f38104e7690550d88ff148cf475674.bA-EbiStJZ_opUpEa66H9_N3Y9gE3P-EN_P35ol1cf0+ hash: v1.k794b7964.9c67790644f390300d1e5b35b54fbbd6cc0b144acec36f18a182c6350ee4d645.lDOP2jMHcJUOybCC2LwglUWBqIPZ03ZE0DRGhhRfytEscenes-app-replay-vision--monitor-overview-with-scout-report--light:- hash: v1.k794b7964.2b333b7d2f03a600120fdcc91a82ce1f68a39a8e8da3457ded692f576958e4a9.5PJRfXJPruTNmlASj1DjGgGiPPE1FtDZ_ZE127jZO2c+ hash: v1.k794b7964.5491e5d8e18052dcb2b4a99d1780c097e4fdedd961c450e25670a0cc4ab95879.ynmi2r5Mro825n0mKOBN7t_y0igZje-tcw-AhCdX_00scenes-app-replay-vision--monitor-root-cause-scout-form--dark:- hash: v1.k794b7964.d5ed2f853f5e78bf2a5a4700e100a0a0fec171c7dd35b170d6d82c4c4d789c10.IU35Y8TiBpc0HN88ZA64xAT7Suw8-pWtefUjE5lj8Dw+ hash: v1.k794b7964.ee26300d2a85ae1aa6b47d45dcc433b021cfd58bcfb6244aca1e66c89d041090.PptW5BC4eO-q5dzKMXsSDU5R1wyuaper1fjc9Rfy8o4scenes-app-replay-vision--monitor-root-cause-scout-form--light:- hash: v1.k794b7964.40352ea0924358fddeab056db33afff226ef328c6155a73d30b442173f289c07.0OFFE_9jXWLUTiKXO4G1sohLvOp5XYWCg86FYWtXXPw+ hash: v1.k794b7964.4327bfa2b2e98e22c41c809a9c703b70ab495ff7617fff7654b6772d282e1b18.ugymueK7YbLk2jB94rnHP9C5f5NCB1INLmr4LOnuvoEscenes-app-replay-vision--monitor-scouts--dark:hash: v1.k794b7964.d2cfd91cda1d77b803161e50ed932845f689fc34e94a1d9c4c8f4d29826466bb.6ALOzbZ2VP5UrQoCEAPnP9UZPjpujws_b8WPZLA1qL8scenes-app-replay-vision--monitor-scouts--light:@@ -15030,6 +15030,10 @@ snapshots:hash: v1.k794b7964.a2b996ea1160b99e63c8f6fa0f1e5cf41899397dd21710cb60d7f132b9be5ebf.3V0_-n-T-Qr0CfT2Tj4o7_WJAGzzRlXGm8kLK14QhNcscenes-app-replay-vision--scanner-alerts-empty--light:hash: v1.k794b7964.d9ace49fb0b86c802c61268205a8d0a4fec36ee11893addb69f3f382d6413c23.lQIQpu4oUttcUZcu6v656AAUXPTC4X6hzOW1-lLWbdU+ scenes-app-replay-vision--scanner-creator-lost-access--dark:+ hash: v1.k794b7964.bb068a2d6433eb0d36face43969f152a32bb26004cc66fbbf6b59e4013049ed2.JXniHacH-39rzk9kWjFeOPzpOb4eRfH3TQYd9ZpRBZE+ scenes-app-replay-vision--scanner-creator-lost-access--light:+ hash: v1.k794b7964.ad785eb2d49a6d6c51feb2e64caaeb7879ddc88bcde51c3474bbb8593b89aa09.mYBhVdWzUfXX6jf4LaZCa6tmKl6uCZ0bRzVfuTRkC1Uscenes-app-replay-vision--scanner-editor-budget--dark:hash: v1.k794b7964.6b9e42ec4fed57255459d42d7265fb979f6197998cc298391e8f867c06442ebc._bBzckl9s_Mo9oGmWAIMGnKGOM94E7WIVbm4kJqMEdYscenes-app-replay-vision--scanner-editor-budget--light:@@ -15106,6 +15110,10 @@ snapshots:hash: v1.k794b7964.cd7dc17b3cc9810b046e482be7ca3e9a7c69704ae1d20f83703d9f2182313e0d.1XoO-LQZMLzrlQZu_bJRaHNWPoQ3ismnZlAKoOQt60Iscenes-app-replay-vision--scanner-editor-triggers-recordings-first--light:hash: v1.k794b7964.e6af0d6ae39ce04a5fe9455cfba1b4305c25c650b44c451783d4f70b77a60a09.NWNHU3zZKTcxW-3zh02O6tvXSc1vZ5DKQwcR0PB_TSU+ scenes-app-replay-vision--scanner-no-recordings--dark:+ hash: v1.k794b7964.359ca5b6fa1e38b3e9cef4b9bb9d13758c0532b91ae97efaf492b2ef51cc15b3.zfaw-EukpeHhsBNQx8e3RukykwJzuRA2HcBUlgbQ6BQ+ scenes-app-replay-vision--scanner-no-recordings--light:+ hash: v1.k794b7964.f954b633a20a7a8efa06cd9a08e55b936947383ec7176c98aed013a1eb0fdca4.7SeObeKkSbu9MSSoPJrt6vr8nOCccHWnWTONPvrL8Hwscenes-app-replay-vision--scanner-observations--dark:hash: v1.k794b7964.a730efb9cf4a682d5618dd924bcc733bdb602478dc338e1511ab0eb1e5fc580a.HMSJ-jDOOMyzClRBvAXqP4EdZDWu_oNBrvObUQPQT3Ascenes-app-replay-vision--scanner-observations--light:@@ -15115,13 +15123,13 @@ snapshots:scenes-app-replay-vision--scanner-on-demand--light:hash: v1.k794b7964.4f80fe334520d4ac3d53d57efd5b38f8fb3780a21bb14d1cf49e5c64c6fc9774.zDHnsM7FpSJ2Vr92ByUKjtSZHmttioSDdkJQOXzZjgoscenes-app-replay-vision--scanner-overview-free-credits-used--dark:- hash: v1.k794b7964.7311c7f7325d8c64a1c0d0841194fd356086abe58801fde1f8586e7641faf10d.pUUvS0GXMC0QwBrdZCp9fAw1xhA_dVMX9ODs_EJ_6S4+ hash: v1.k794b7964.a1ba5966352d7fa132cf3ff769bcca6a09ce7f04ac9eac0c2cf22c0e4bf58cb4.1pUq04V0rMz14EQiqmLYQv_vqP5RJMZEcBiCiLUldqQscenes-app-replay-vision--scanner-overview-free-credits-used--light:- hash: v1.k794b7964.c49f1ea3d9cf609856d2651e90d1ebf5361ebd0e4e889aef1f6ee9f1e682e19a.Xd7sTZMtkxfSqTWPNgbhozMq3p0NUg34HSMu134B_94+ hash: v1.k794b7964.091815b84ce7bd62a8b7c3a0a4892703a0322c989bc11064f309520d206270a3.ZFw15Al7QO4_vF1pACfNFaF-yzHjEVXEy0fRF_qLLt0scenes-app-replay-vision--scanner-scan-drought--dark:- hash: v1.k794b7964.5c09744ba06f15580bfd640c2a809591bb56086af17814fe74274f0acaf11d33.OZTilyTCRycOtXM67McARvKkGn8D3KKAdw5-XaD1zO4+ hash: v1.k794b7964.ccbf8b383b15a11a133a551443d12a809cbfe73c48657a009c64aad82e6cedf6.aTVrCGJRzieUK0Kj9v1KTV2c4N42czJT-pPjRGnQiR4scenes-app-replay-vision--scanner-scan-drought--light:- hash: v1.k794b7964.6a5ab1a3452c76cb23e89db3eb1c109361b1a2d1c3301512efff010eb476a0f2.i6TqWeh0WalzF2nrzlw6fFwKQJceWOJeA5Z-M1o1-RY+ hash: v1.k794b7964.7c8347690d784cbdec9026ce5f096eda6c4d36488edde493bb1545059feec8bd.3c9N4_3QtvL2WMoPbR5KSODPNlhy9Nt2q92EUfC-L6Iscenes-app-replay-vision--scanner-scouts--dark:hash: v1.k794b7964.f2ec81ed8ea5bb2bac407771a1048892005f99fa1c8f5f2a28a142cb634a6463.xxFctKJq59z32tHbG0qxE4ej9rs08md6SuEDCc9oIGUscenes-app-replay-vision--scanner-scouts--light:@@ -15131,9 +15139,13 @@ snapshots:scenes-app-replay-vision--scanner-scouts-empty--light:hash: v1.k794b7964.96bc080fa28fe04f239d200ce847119cde120c2ca985ff09b88d12b9447a03e8.rqHm0-oLrDHCJOuxqUbyDoKyiJtxvtyCkTGMlTmsiI4scenes-app-replay-vision--scanner-status-throttled--dark:- hash: v1.k794b7964.4f38e9093649330d8d9a87e2e6730e153a4592e832e20a0be6880105ae463a1f.b7I0bi116aXSjdoVZS2oGx603tzGNNsUHLSUHYbzYyA+ hash: v1.k794b7964.132cbf244d14e72442fa0bec269e3121d57d203e7b8a4a1f8b027af97a9ae299.NQQ8uohcDJo6yqpFgWioVhr8TrjbSvYKjHUQRwoyjmsscenes-app-replay-vision--scanner-status-throttled--light:- hash: v1.k794b7964.f85cd5e4fb152395afb02613ee399049ff0c0e215cac58b30fa7197308264289.xSdSpjxPeyiKZnj9dHtJ-sxlT3uDk6EMfO-cZMvl55U+ hash: v1.k794b7964.3548e87b72eea2797a1f33b394cfa161fabbe2ed868b6fb4f03c3412b12e7518.P4SidtRo6yg8E4gHOqbV9AQ8DAPA7AUaZe2ug5yavKg+ scenes-app-replay-vision--scanner-turned-off--dark:+ hash: v1.k794b7964.97f36c1a5774f29f1a43f9d88d2ed25459f155a219b8d3d58fead1efdb4f028b.3P4aMgHthQnj_T4_bP21vHRGNQBeUNKwSsVDMiavWx0+ scenes-app-replay-vision--scanner-turned-off--light:+ hash: v1.k794b7964.60352be69bff3aa3b9c207d7783de07e7f8e2744970a0837c126e4d9f839922a.aiXlzBzbG0QE1J5vo_q0EyaC6N-O_7B6s2MmXdiijC0scenes-app-replay-vision--scanners-list--dark:hash: v1.k794b7964.6cdcd54205f600ea018842fc097e4d44f98e7e71dfd95fd51ea6bfc1e55c9ffe.Q7PDacx7oeJghgYN58AX6EB4qTE-jJgvXMKFZ9k5GTYscenes-app-replay-vision--scanners-list--light:@@ -15146,22 +15158,26 @@ snapshots:hash: v1.k794b7964.6dff1a7f15fce279a5ef4969aabb94ea93c5e63b7657e1a9f5fe22d36d7e7c31.li58ZmGkCtquYsoDZ_QYEh5IUwZ7DAM1aTQoT_9a07kscenes-app-replay-vision--scanners-list-free-credits-used--light:hash: v1.k794b7964.6f57d1b4388f86db57732ac1d76d34b4f09fc7b0df395e74c76a09c214846b46.tmt1aDcAzeS_keBtSbR9dPTePD92d0pDJviBLHT3yio+ scenes-app-replay-vision--scanners-list-replay-off--dark:+ hash: v1.k794b7964.2383ee749e17756ea8a978c93365d68ed261999624eeabf0b47c7cfe0cadf294.3c3fSqjE4oCH65LOt8GvJNfYEjnLTMolyKIZJkdWe9s+ scenes-app-replay-vision--scanners-list-replay-off--light:+ hash: v1.k794b7964.af41fd0dcf63f27f1b597df75e2e3099322f1583f035ab552b2dc5fe7b2b254c.nim3lx7GtEFn90TwmsNywu1AZgMJSRtxVJCiiEIP-Jcscenes-app-replay-vision--scorer-observations--dark:hash: v1.k794b7964.2d5145a8fcaad02ebc6d16a530bf2d97ff34eed6cfc18f1a1fe8c348760b5990.p9kMGT3wLWAKTEHGTGakFkOC7pWiACFi_gbPg9tI4Voscenes-app-replay-vision--scorer-observations--light:hash: v1.k794b7964.0f0ee197fb099295dd4734cf2f1396f0de390eaf3627676b993525ba2884d456.Zw-8DseaFkOtfoHqwB69vJB-LyvMwlrdTmjbDJ2K0soscenes-app-replay-vision--scorer-overview--dark:- hash: v1.k794b7964.5b76571965c566c3a1715c94b8df46a00b1b7dfc9d75024b633d7f89354db942.nxKE0jXZ1a-16mvl0I6OrPqTCKCDUjKgvXyrDiT_1_g+ hash: v1.k794b7964.1238790490a7a1114b2963103fe986371f3bac085623fdcc8e96a009d3fcf6f1.ppmuWzjmks0o1EAUw-_WcRzc4DCjBuNDVIP5bAF9Lqkscenes-app-replay-vision--scorer-overview--light:- hash: v1.k794b7964.439377fc2e212efe65ad9df17d010fbc12257eecbec2eb6e6700956be54bc347.tVScetMsNBKtE0q51LDTeQURQCyjVOLyWvhHaWL7Hbo+ hash: v1.k794b7964.8b93175a2d3b71399278234af0bcb7d9e10b34f80e6ca19810bcd6c6c3d8c303.C0wcWbxpjS9ka8ULUqJJhnuOp7dNEHq4I4qNT1OxGn4scenes-app-replay-vision--startup-program-cap--dark:hash: v1.k794b7964.719c3df2447476eb3ebed57d0ec27d65a9dcbad36a0cd0b0201c6d0dcfb72f76.2er6C-Txxr0fU7gNBwVm9dHWDbfhYwgRXzY1RQibIN4scenes-app-replay-vision--startup-program-cap--light:hash: v1.k794b7964.eb2c4f3fe006427d30a40443c73b9afeb2f0ec30409504e2bbeec9bd06741d74.UL1cRXCP_2RvMXEpuVYynLcL56w9rj0PFjScC0eCboIscenes-app-replay-vision--summarizer-overview--dark:- hash: v1.k794b7964.31974c29767b97bd6d2af3eca6b30078665246f6ec4c9cfd5019d6cbf9bcbb99.ROiKfq5AAOCnx_vqHYoiuJoOy1gHtQQKiP52EbOxjTM+ hash: v1.k794b7964.a9fffef330af297fb21712158c71217c9c95d57c17b126d42acd2422eeb05541.JRd6JDIK9vR0GEJbRKIwgijhWF8M_cJYwi83fJ_rwv0scenes-app-replay-vision--summarizer-overview--light:- hash: v1.k794b7964.66ebb931c54f2005ac06f26c6df690a3e29a8cc4b82668df81ff156a6f81bb9b.UboJ-lkNqFejDIcT8eKrVbtkTErYhoJQslcRAhFEZXs+ hash: v1.k794b7964.f0de77a07279021d92b24c8800a84d8e398b2a820ba18943d6e5da4a1d67c18e.D0tzz7m8RlYyOWozTVVdjGiXV5_MxL1z83y8vEqhKUIscenes-app-replay-vision--summarizer-scouts--dark:hash: v1.k794b7964.ce428f09777c68f7877231238a3e19ae7cc6b8768d6079b1382fe7ec65235d2f.CELK6TsmQMLYmUKGZbKyz2etvrnnKcumP7w7L7C77Asscenes-app-replay-vision--summarizer-scouts--light:@@ -15186,10 +15202,14 @@ snapshots:hash: v1.k794b7964.0474769b535df6aa12a7b084d282670d43cdee3e4d25bea774343b31a3507222.A6a1bLa4bPY6rWD63uU1Ofmk7qe4pTWenkVnAfFzk6Iscenes-app-replay-vision-highlightfeedemptystate--filtered--light:hash: v1.k794b7964.a46eecfe214809eb57f9cee104966134dc9ee7e7c87c76ece00804cc4b7e01ed.3DugcLZ-jS3L-Dg8ID0zXVx-wumILKJQN5vD5sCANKA+ scenes-app-replay-vision-highlightfeedemptystate--no-recordings--dark:+ hash: v1.k794b7964.44c487c3d022a3ab5397726ddd9faff3034c1a7ca3033d978bf93424738eecee.-K6RiHKHgQ1QW5T774VmSy9y_cpHzFCHOlH6W3gCSIE+ scenes-app-replay-vision-highlightfeedemptystate--no-recordings--light:+ hash: v1.k794b7964.03124faf363f11b0557ea1a5e5ad30c4b0dae2e1fe97bbd59566b1090fc1e01d.q-UZOfzEvvViHv5FzIUKmgQPk63BxMdvFaB1e_VTOx4scenes-app-replay-vision-highlightfeedemptystate--no-scanners--dark:- hash: v1.k794b7964.1a2bc2d84fde117a62c1e247a770c177eec921730810ba1ddc5fd561bd5b56a6.dO1Zy_3KvtfJSqlL7_4xMJ0YZ8EKNOc2vxiPo7-qk_A+ hash: v1.k794b7964.6322736e3714eb66b6d8b9a84379ef7974c176733328adeea7c1792795fb90d7.nqdUAkq2d0kVhGRnPTh0KwnXngLtomwabXtOf0EpV8kscenes-app-replay-vision-highlightfeedemptystate--no-scanners--light:- hash: v1.k794b7964.f0fbceb29ededf3b34b97b3c6b86bd0797b25a9135aec3fd583a6aed09f45c9c.rJHV7Y1YCrhSMtSbCsM3cZHT2-wymEldFgLc2wAk-8k+ hash: v1.k794b7964.73f889eb2cb8e00c4a1a0e42df9d606e99dac00b4a525bd315797b79081c6c15.3cUpfivy2qzYC6ClNultrf9wDOSuNE-ixhuA4xjhGGkscenes-app-replay-vision-highlightfeedemptystate--quiet-window--dark:hash: v1.k794b7964.c4ed5fbd745303fc8ebcd4ac215fc9022b99c4188f963d99b15d721bb15935d8.abSotPtp69Hz28hRMRDyyrt-B_aHsEoVG3VNO5AaoyQscenes-app-replay-vision-highlightfeedemptystate--quiet-window--light:@@ -15198,6 +15218,10 @@ snapshots:hash: v1.k794b7964.b1f47cd49f93204542abf607f565859a592273ca11d2c068f04b04bd32049409.bCvHC2nU8xUpEIg0RQV8CC56PFR60KqgxciVVZcJsIAscenes-app-replay-vision-highlightfeedemptystate--quota-exhausted--light:hash: v1.k794b7964.206cb4c6e3d6ae106a0e07edb31a30c597af6fa2917a5e19330d1b3dfdb3622a.l-tGYkbCyiZDHs4b-Mtid2RApqCeYCG9suhSo_sOp_c+ scenes-app-replay-vision-highlightfeedemptystate--replay-off--dark:+ hash: v1.k794b7964.ee9bab234caabee218a3a14e80095de0078e236baed477a0268ae7ba6a9c34ba.QsXZhhPpGMF52GB7xpapNQUYNC8nblT86wExEZj1jDM+ scenes-app-replay-vision-highlightfeedemptystate--replay-off--light:+ hash: v1.k794b7964.efdafaa9746c142c7fa9a0bd0bbada2e935fa2e3a7304d9d27323b452885d0a4.u-la7nBxCH2WXQqMM9b7V8lu95C2TDlKlyfa8MDgungscenes-app-replay-vision-observations-tab-in-the-player--scans-without-a-summary--dark:hash: v1.k794b7964.541ee5233b1f6805324b95d5d01de4cfec0b0012e0cceb100339735c9dcbd338.a66QPGNk0yvyiiaTOmkd2k1leqmyN9g85cLMJ8EWdXEscenes-app-replay-vision-observations-tab-in-the-player--scans-without-a-summary--light:diff --git a/products/replay_vision/backend/api/scanners.py b/products/replay_vision/backend/api/scanners.pyindex 5c50b68da0f5..35953d62ec65 100644--- a/products/replay_vision/backend/api/scanners.py+++ b/products/replay_vision/backend/api/scanners.py@@ -138,6 +138,7 @@ from products.replay_vision.backend.quota import ()from products.replay_vision.backend.scanner_access import (SCANNER_CREATOR_LOST_ACCESS_CODE,+ UnrunnableReason,accessible_experiment_ids,accessible_observations,can_read_targeted_experiment,@@ -147,6 +148,7 @@ from products.replay_vision.backend.scanner_access import (recording_viewer_access,scanner_experiment_scope_q,scanners_for_reading_observations,+ unrunnable_reasons,)from products.replay_vision.backend.scanner_config import (MAX_PROMPT_LENGTH,@@ -673,6 +675,14 @@ class ReplayScannerSerializer(TaggedItemSerializerMixin, UserAccessControlSerial"repeat the offer if the user declines."),)+ unrunnable_reason = serializers.SerializerMethodField(+ help_text=(+ "Why the scanner can never run, or null when it can. `no_ai_consent`: the organization has not "+ "approved AI data processing. `creator_lost_access`: the creator can no longer view recordings, "+ "which the sweep reads as them, so turning the scanner on requires `take_over_as_creator`. "+ "The sweep turns an enabled scanner off when either applies."+ ),+ )last_swept_at = serializers.DateTimeField(read_only=True,help_text="Watermark for the scanner's last scheduled fire. Mirrors Temporal schedule state for recovery.",@@ -721,6 +731,7 @@ class ReplayScannerSerializer(TaggedItemSerializerMixin, UserAccessControlSerial"dashboard_suggested","last_swept_at","filter_error",+ "unrunnable_reason","created_at","created_by","updated_at",@@ -849,6 +860,16 @@ class ReplayScannerSerializer(TaggedItemSerializerMixin, UserAccessControlSerial# Readiness is only computed for scanners without a live dashboard.return scanner.id in self._page_dashboard_state(scanner)[1]+ @extend_schema_field(serializers.ChoiceField(choices=UnrunnableReason.choices, allow_null=True))+ def get_unrunnable_reason(self, scanner: ReplayScanner) -> UnrunnableReason | None:+ # Shared across the list's children, so a page costs one access lookup rather than one per creator.+ reasons = self.context.get("_scanner_unrunnable_reasons")+ if reasons is None or scanner.id not in reasons:+ page = self.root.instance if isinstance(self.root, serializers.ListSerializer) else None+ reasons = unrunnable_reasons(list(page) if page is not None else [scanner])+ self.context["_scanner_unrunnable_reasons"] = reasons+ return reasons[scanner.id]+@extend_schema_field(serializers.BooleanField())def get_limit_reached(self, scanner: ReplayScanner) -> bool:# `blocked`, not `exhausted`: the enforcement gates admit an observation only when its full cost@@ -2396,7 +2417,7 @@ class ReplayScannerViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, vi# viewset is concerned; its results are read through the observations endpoint instead.return (queryset.filter(team_id=self.team_id)- .select_related("created_by", "team")+ .select_related("created_by", "team__organization")# prefetched_tags feeds the tags in to_representation; without it list serialization is N+1..prefetch_related(Prefetch(diff --git a/products/replay_vision/backend/scanner_access.py b/products/replay_vision/backend/scanner_access.pyindex 4865d9f6f9ea..94fbd11fa277 100644--- a/products/replay_vision/backend/scanner_access.py+++ b/products/replay_vision/backend/scanner_access.py@@ -9,6 +9,7 @@ import uuidfrom collections.abc import Iterablefrom typing import TYPE_CHECKING, Any, Literal+from django.db import modelsfrom django.db.models import Qfrom rest_framework.exceptions import NotFound, PermissionDenied@@ -57,12 +58,40 @@ def creator_can_scan(scanner: ReplayScanner) -> bool:return scanner.created_by is None or recording_viewer_access(scanner.created_by, scanner.team) is not None-def unrunnable_reason(scanner: ReplayScanner) -> Literal["no_ai_consent", "creator_lost_access"] | None:+class UnrunnableReason(models.TextChoices):+ NO_AI_CONSENT = "no_ai_consent", "No AI consent"+ CREATOR_LOST_ACCESS = "creator_lost_access", "Creator lost access"+++def unrunnable_reasons(scanners: list[ReplayScanner]) -> dict[uuid.UUID, UnrunnableReason | None]:+ """`unrunnable_reason` for one team's scanners, with one batched access lookup for all their creators."""+ if not scanners:+ return {}+ team = scanners[0].team+ if not team.organization.is_ai_data_processing_approved:+ return {scanner.id: UnrunnableReason.NO_AI_CONSENT for scanner in scanners}+ creator_ids = {scanner.created_by_id for scanner in scanners if scanner.created_by_id is not None}+ can_scan = {+ user_id+ for user_id, access in UserAccessControl.for_user_ids(user_ids=creator_ids, team=team).items()+ if access.user.is_active+ and access.has_project_access+ and access.check_access_level_for_resource("session_recording", required_level="viewer")+ }+ return {+ scanner.id: None+ if scanner.created_by_id is None or scanner.created_by_id in can_scan+ else UnrunnableReason.CREATOR_LOST_ACCESS+ for scanner in scanners+ }+++def unrunnable_reason(scanner: ReplayScanner) -> UnrunnableReason | None:"""Why the sweep can never spend for this scanner, or None when it can."""if not scanner.team.organization.is_ai_data_processing_approved:- return "no_ai_consent"+ return UnrunnableReason.NO_AI_CONSENTif not creator_can_scan(scanner):- return "creator_lost_access"+ return UnrunnableReason.CREATOR_LOST_ACCESSreturn Nonediff --git a/products/replay_vision/backend/temporal/activities/find_scanner_candidates.py b/products/replay_vision/backend/temporal/activities/find_scanner_candidates.pyindex 8213cb54c92a..e71b28b96ffd 100644--- a/products/replay_vision/backend/temporal/activities/find_scanner_candidates.py+++ b/products/replay_vision/backend/temporal/activities/find_scanner_candidates.py@@ -42,7 +42,7 @@ from products.replay_vision.backend.queries.scanner_candidate_query import (build_candidate_batch,)from products.replay_vision.backend.queries.variant_sampling import variant_sampling_plan_for_scope-from products.replay_vision.backend.scanner_access import unrunnable_reason+from products.replay_vision.backend.scanner_access import UnrunnableReason, unrunnable_reasonfrom products.replay_vision.backend.temporal.constants import (DEEP_SWEEP_INTERVAL,DEEP_SWEEP_MAX_EXECUTION_SECONDS,@@ -160,7 +160,7 @@ def _fail_on_filter_error(scanner: ReplayScanner, error: Exception) -> None:def _disable_unrunnable_scanner(- scanner: ReplayScanner, reason: Literal["no_ai_consent", "creator_lost_access", "experiment_deleted"]+ scanner: ReplayScanner, reason: UnrunnableReason | Literal["experiment_deleted"]) -> FindScannerCandidatesOutput:"""Turn the scanner off so the reconciler drops its schedule and the owner sees it off, not silently idle.diff --git a/products/replay_vision/backend/tests/test_api.py b/products/replay_vision/backend/tests/test_api.pyindex dd8f10930667..5b5edddb11bc 100644--- a/products/replay_vision/backend/tests/test_api.py+++ b/products/replay_vision/backend/tests/test_api.py@@ -250,6 +250,8 @@ class TestReplayScannerViewSet(_VisionAPITestCase):resp = self.client.patch(f"{self.scanners_url}{scanner.id}/", {"enabled": True}, format="json")self.assertEqual(resp.status_code, 400, resp.json())self.assertEqual(resp.json()["code"], "ai_data_processing_not_approved")+ listed = self.client.get(self.scanners_url).json()["results"]+ self.assertEqual([row["unrunnable_reason"] for row in listed], ["no_ai_consent"])@parameterized.expand([@@ -277,6 +279,10 @@ class TestReplayScannerViewSet(_VisionAPITestCase):if not creator_left:self.organization.members.add(creator)scanner = self._create_scanner(enabled=False, created_by=creator)+ listed = self.client.get(self.scanners_url).json()["results"]+ self.assertEqual(+ [row["unrunnable_reason"] for row in listed], ["creator_lost_access" if creator_left else None]+ )with patch("products.replay_vision.backend.api.scanners.recording_viewer_access",diff --git a/products/replay_vision/frontend/components/RecordingsBlockBanner.tsx b/products/replay_vision/frontend/components/RecordingsBlockBanner.tsxnew file mode 100644index 000000000000..103c211a74ab--- /dev/null+++ b/products/replay_vision/frontend/components/RecordingsBlockBanner.tsx@@ -0,0 +1,58 @@+import { useActions, useValues } from 'kea'++import { LemonBanner } from '@posthog/lemon-ui'++import { RestrictionScope, useRestrictedArea } from 'lib/components/RestrictedArea'+import { TeamMembershipLevel } from 'lib/constants'+import { teamLogic } from 'scenes/teamLogic'+import { urls } from 'scenes/urls'++import { ProductKey } from '~/queries/schema/schema-general'+import { OnboardingStepKey } from '~/types'++import { RECORDINGS_BLOCK_CAUSE, replayRecordingsLogic } from '../logics/replayRecordingsLogic'++export function RecordingsBlockBanner(): JSX.Element | null {+ const { recordingsBlock } = useValues(replayRecordingsLogic)+ const { currentTeamLoading } = useValues(teamLogic)+ const { updateCurrentTeam } = useActions(teamLogic)+ // Same gate as the settings toggle that writes this field (`ReplayGeneral`).+ const restrictedReason = useRestrictedArea({+ scope: RestrictionScope.Project,+ minimumAccessLevel: TeamMembershipLevel.Admin,+ })++ if (recordingsBlock === 'replay-off') {+ return (+ <LemonBanner+ type="warning"+ action={{+ children: 'Turn on session replay',+ onClick: () => updateCurrentTeam({ session_recording_opt_in: true }),+ loading: currentTeamLoading,+ disabledReason: restrictedReason ? 'Ask a project admin to turn on session replay' : null,+ 'data-attr': 'vision-recordings-banner-enable-replay',+ }}+ >+ {RECORDINGS_BLOCK_CAUSE['replay-off']}, so scanners have no recordings to watch. Scanners start again+ when recording is on.+ </LemonBanner>+ )+ }+ if (recordingsBlock === 'no-recordings') {+ return (+ <LemonBanner+ type="warning"+ action={{+ children: 'Set up session replay',+ to: urls.onboarding({ productKey: ProductKey.SESSION_REPLAY, stepKey: OnboardingStepKey.INSTALL }),+ 'data-attr': 'vision-recordings-banner-setup-replay',+ }}+ >+ {RECORDINGS_BLOCK_CAUSE['no-recordings']}, so scanners have nothing to watch. Check that session replay+ is installed and capturing sessions.+ </LemonBanner>+ )+ }+ return null+}diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.tsindex 8ee408f0a85f..e1ea9c56de28 100644--- a/products/replay_vision/frontend/generated/api.schemas.ts+++ b/products/replay_vision/frontend/generated/api.schemas.ts@@ -1312,6 +1312,13 @@ export interface ScannerExperimentTargetingApi {variant?: string | null}+export type UnrunnableReasonEnumApi = (typeof UnrunnableReasonEnumApi)[keyof typeof UnrunnableReasonEnumApi]++export const UnrunnableReasonEnumApi = {+ NoAiConsent: 'no_ai_consent',+ CreatorLostAccess: 'creator_lost_access',+} as const+/*** A Replay Vision scanner: its type, targeting query, and AI configuration.*/@@ -1443,6 +1450,8 @@ export interface ReplayScannerApi {* @nullable*/readonly filter_error: string | null+ /** Why the scanner can never run, or null when it can. `no_ai_consent`: the organization has not approved AI data processing. `creator_lost_access`: the creator can no longer view recordings, which the sweep reads as them, so turning the scanner on requires `take_over_as_creator`. The sweep turns an enabled scanner off when either applies. */+ readonly unrunnable_reason: UnrunnableReasonEnumApi | nullreadonly created_at: string/** User who created the scanner. */readonly created_by: UserBasicApi | null@@ -1594,6 +1603,8 @@ export interface PatchedReplayScannerApi {* @nullable*/readonly filter_error?: string | null+ /** Why the scanner can never run, or null when it can. `no_ai_consent`: the organization has not approved AI data processing. `creator_lost_access`: the creator can no longer view recordings, which the sweep reads as them, so turning the scanner on requires `take_over_as_creator`. The sweep turns an enabled scanner off when either applies. */+ readonly unrunnable_reason?: UnrunnableReasonEnumApi | nullreadonly created_at?: string/** User who created the scanner. */readonly created_by?: UserBasicApi | nulldiff --git a/products/replay_vision/frontend/logics/replayRecordingsLogic.test.ts b/products/replay_vision/frontend/logics/replayRecordingsLogic.test.tsnew file mode 100644index 000000000000..b38341f9cb98--- /dev/null+++ b/products/replay_vision/frontend/logics/replayRecordingsLogic.test.ts@@ -0,0 +1,28 @@+import { MOCK_DEFAULT_TEAM } from 'lib/api.mock'++import { expectLogic } from 'kea-test-utils'++import { teamLogic } from 'scenes/teamLogic'++import { useMocks } from '~/mocks/jest'+import { initKeaTests } from '~/test/init'++import { replayRecordingsLogic } from './replayRecordingsLogic'++describe('replayRecordingsLogic', () => {+ it('probes for recordings once replay is turned on from a page that mounted with it off', async () => {+ useMocks({ get: { '/api/environments/:team/session_recordings/': () => [200, { results: [] }] } })+ initKeaTests()+ teamLogic.actions.loadCurrentTeamSuccess({ ...MOCK_DEFAULT_TEAM, session_recording_opt_in: false })+ const logic = replayRecordingsLogic()+ logic.mount()++ await expectLogic(logic).toNotHaveDispatchedActions(['loadHasRecentRecordings'])+ expect(logic.values.recordingsBlock).toBe('replay-off')++ teamLogic.actions.updateCurrentTeamSuccess({ ...MOCK_DEFAULT_TEAM, session_recording_opt_in: true })++ await expectLogic(logic).toDispatchActions(['loadHasRecentRecordingsSuccess'])+ expect(logic.values.recordingsBlock).toBe('no-recordings')+ })+})diff --git a/products/replay_vision/frontend/logics/replayRecordingsLogic.ts b/products/replay_vision/frontend/logics/replayRecordingsLogic.tsnew file mode 100644index 000000000000..4b395f1a9b14--- /dev/null+++ b/products/replay_vision/frontend/logics/replayRecordingsLogic.ts@@ -0,0 +1,142 @@+import { MakeLogicType, afterMount, connect, kea, listeners, path, selectors } from 'kea'+import { loaders } from 'kea-loaders'++import api from 'lib/api'+import { teamLogic } from 'scenes/teamLogic'++import { NodeKind } from '~/queries/schema/schema-general'+import type { TeamPublicType, TeamType } from '~/types'++export const RECENT_RECORDINGS_DAYS = 30+// Matches Session Replay's own setup check, so a page left open flips once the first recording lands.+const POLL_INTERVAL_MS = 20000++export type RecordingsBlock = 'replay-off' | 'no-recordings'++export const RECORDINGS_BLOCK_CAUSE: Record<RecordingsBlock, string> = {+ 'replay-off': 'Session replay is off for this project',+ 'no-recordings': `This project has no recordings from the last ${RECENT_RECORDINGS_DAYS} days`,+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface replayRecordingsLogicValues {+ currentTeam: TeamPublicType | TeamType | null // teamLogic+ hasRecentRecordings: boolean | null+ hasRecentRecordingsLoading: boolean+ recordingsBlock: RecordingsBlock | null+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface replayRecordingsLogicActions {+ updateCurrentTeamSuccess: (+ currentTeam: TeamPublicType | TeamType,+ payload?: Partial<TeamType> | undefined+ ) => {+ currentTeam: TeamPublicType | TeamType+ payload?: Partial<TeamType>+ } // teamLogic+ loadHasRecentRecordings: () => any+ loadHasRecentRecordingsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadHasRecentRecordingsSuccess: (+ hasRecentRecordings: boolean | null,+ payload?: any+ ) => {+ hasRecentRecordings: boolean | null+ payload?: any+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface replayRecordingsLogicMeta {+ __keaTypeGenInternalSelectorTypes: {+ recordingsBlock: (+ currentTeam: TeamPublicType | TeamType | null,+ hasRecentRecordings: boolean | null+ ) => RecordingsBlock | null+ }+}++export type replayRecordingsLogicType = MakeLogicType<+ replayRecordingsLogicValues,+ replayRecordingsLogicActions,+ Record<string, any>,+ replayRecordingsLogicMeta+>++/** Propless, so every Replay Vision surface shares one probe. */+export const replayRecordingsLogic = kea<replayRecordingsLogicType>([+ path(['products', 'replay_vision', 'frontend', 'logics', 'replayRecordingsLogic']),++ connect(() => ({+ values: [teamLogic, ['currentTeam']],+ actions: [teamLogic, ['updateCurrentTeamSuccess']],+ })),++ loaders({+ hasRecentRecordings: [+ // Null until the probe answers. A failed probe stays null, so no surface warns on a guess.+ null as boolean | null,+ {+ loadHasRecentRecordings: async (): Promise<boolean | null> => {+ try {+ const response = await api.recordings.list({+ kind: NodeKind.RecordingsQuery,+ limit: 1,+ date_from: `-${RECENT_RECORDINGS_DAYS}d`,+ })+ return response.results.length > 0+ } catch {+ return null+ }+ },+ },+ ],+ }),++ selectors({+ recordingsBlock: [+ (s) => [s.currentTeam, s.hasRecentRecordings],+ (+ currentTeam: TeamPublicType | TeamType | null,+ hasRecentRecordings: boolean | null+ ): RecordingsBlock | null => {+ if (currentTeam?.session_recording_opt_in === false) {+ return 'replay-off'+ }+ return hasRecentRecordings === false ? 'no-recordings' : null+ },+ ],+ }),++ listeners(({ actions, values, cache }) => ({+ loadHasRecentRecordingsSuccess: ({ hasRecentRecordings }) => {+ if (hasRecentRecordings === false) {+ cache.disposables.add(() => {+ const id = window.setInterval(() => actions.loadHasRecentRecordings(), POLL_INTERVAL_MS)+ return () => clearInterval(id)+ }, 'poll')+ } else {+ cache.disposables.dispose('poll')+ }+ },+ // Turning recording on from the banner does not remount this logic, so the skipped probe runs now.+ updateCurrentTeamSuccess: ({ currentTeam }) => {+ if (currentTeam?.session_recording_opt_in && values.hasRecentRecordings === null) {+ actions.loadHasRecentRecordings()+ }+ },+ })),++ afterMount(({ actions, values }) => {+ // With recording off the block is already known, so the probe would only spend a query.+ if (values.currentTeam?.session_recording_opt_in !== false) {+ actions.loadHasRecentRecordings()+ }+ }),+])diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsxindex daf989aad3fb..6f59f12b7290 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScanner.tsx@@ -16,6 +16,7 @@ import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'import { ProductKey } from '~/queries/schema/schema-general'import { IngestionLimitBanner } from '../components/IngestionLimitBanner'+import { RecordingsBlockBanner } from '../components/RecordingsBlockBanner'import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'import { visionQuotaLogic } from '../logics/visionQuotaLogic'import { getReplayVisionEditDisabledReason } from '../utils/accessControl'@@ -116,6 +117,7 @@ export function ReplayScannerSceneComponent(): JSX.Element {/><IngestionLimitBanner />+ <RecordingsBlockBanner /><QuotaBanner /><LemonTabsdiff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsxindex a5c20eafaa1d..801d03f69ae3 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx@@ -1,15 +1,18 @@-import { MOCK_DEFAULT_BASIC_USER, MOCK_DEFAULT_USER } from 'lib/api.mock'+import { MOCK_DEFAULT_BASIC_USER, MOCK_DEFAULT_TEAM, MOCK_DEFAULT_USER } from 'lib/api.mock'import type { Decorator, Meta, StoryObj } from '@storybook/react'import { waitFor, within } from '@testing-library/dom'import userEvent from '@testing-library/user-event'+import { useActions } from 'kea'import { FEATURE_FLAGS } from 'lib/constants'import { dayjs } from 'lib/dayjs'+import { useDelayedOnMountEffect } from 'lib/hooks/useOnMountEffect'import { App } from 'scenes/App'import recordingEventsJson from 'scenes/session-recordings/__mocks__/recording_events_query'import { recordingMetaJson } from 'scenes/session-recordings/__mocks__/recording_meta'import { snapshotsAsJSONLines } from 'scenes/session-recordings/__mocks__/recording_snapshots'+import { teamLogic } from 'scenes/teamLogic'import { urls } from 'scenes/urls'import { mswDecorator } from '~/mocks/browser'@@ -1112,6 +1115,19 @@ export const ScannersList: StoryObj = {parameters: { pageUrl: `${urls.replayVision()}?tab=scanners` },}+export const ScannersListReplayOff: StoryObj = {+ parameters: { pageUrl: `${urls.replayVision()}?tab=scanners` },+ decorators: [+ (Story) => {+ const { loadCurrentTeamSuccess } = useActions(teamLogic)+ useDelayedOnMountEffect(() => {+ loadCurrentTeamSuccess({ ...MOCK_DEFAULT_TEAM, session_recording_opt_in: false })+ })+ return <Story />+ },+ ],+}+// A project that has never created a scanner: the surface of the empty-state experiment.const emptyProjectDecorators = [mswDecorator({@@ -1338,6 +1354,31 @@ export const ScannerStatusThrottled: StoryObj = {decorators: [overviewDecorator({ ...summarizerScanner, sweep_throttle_factor: 12 }, summarizerStats)],}+export const ScannerCreatorLostAccess: StoryObj = {+ parameters: { pageUrl: urls.replayVision(summarizerScanner.id) },+ decorators: [+ overviewDecorator(+ { ...summarizerScanner, enabled: false, unrunnable_reason: 'creator_lost_access' },+ summarizerStats+ ),+ ],+}++export const ScannerNoRecordings: StoryObj = {+ parameters: { pageUrl: urls.replayVision(summarizerScanner.id) },+ decorators: [+ overviewDecorator(summarizerScanner, summarizerStats),+ mswDecorator({+ get: { '/api/environments/:team_id/session_recordings/': { results: [], has_next: false } },+ }),+ ],+}++export const ScannerTurnedOff: StoryObj = {+ parameters: { pageUrl: urls.replayVision(summarizerScanner.id) },+ decorators: [overviewDecorator({ ...summarizerScanner, enabled: false }, summarizerStats)],+}+// Once a scanner has enough observations, the overview offers a dashboard for it.export const MonitorOverviewDashboardOffer: StoryObj = {parameters: {diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsxindex 1699f9d41c01..e7a112620b38 100644--- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx+++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.tsx@@ -37,9 +37,11 @@ import { ProductKey } from '~/queries/schema/schema-general'import { VisionDocsLink } from '../components/DocsLink'import { FilterPill } from '../components/FilterPill'import { IngestionLimitBanner } from '../components/IngestionLimitBanner'+import { RecordingsBlockBanner } from '../components/RecordingsBlockBanner'import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'import { ScannerTypeBadge } from '../components/ScannerTypeBadge'import { replayVisionEmptyState } from '../emptyState/replayVisionEmptyState'+import { RECORDINGS_BLOCK_CAUSE, replayRecordingsLogic } from '../logics/replayRecordingsLogic'import { visionQuotaLogic } from '../logics/visionQuotaLogic'import { ObservationSearch } from '../search/ObservationSearch'import { getReplayVisionDeleteDisabledReason, getReplayVisionEditDisabledReason } from '../utils/accessControl'@@ -54,7 +56,7 @@ import { VisionMetrics } from './components/VisionMetrics'import { VisionUsageTab } from './components/VisionUsageTab'import { ReplayScannerTab } from './replayScannerSceneLogic'import { type ScannersSorting, SCANNERS_PAGE_SIZE, replayScannersLogic } from './replayScannersLogic'-import { limitReachedTooltip } from './scannerCopy'+import { UNRUNNABLE_DETAIL, limitReachedTooltip } from './scannerCopy'import { scannerStatus } from './scannerStatus'import { ENABLED_OPTIONS, EnabledFilter, scannerTypeOptions, ScannerType, ReplayScanner } from './types'@@ -194,6 +196,7 @@ export function ReplayScannersScene(): JSX.Element {const { searchParams } = useValues(router)const { showUsd, quota } = useValues(visionQuotaLogic)const quotaExhausted = quotaBannerState(quota).kind === 'exhausted'+ const { recordingsBlock } = useValues(replayRecordingsLogic)const { featureFlags } = useValues(featureFlagLogic)const todayRailNav = useFeatureFlag('TODAY_RAIL_NAV')const activeTab = KNOWN_TABS.includes(searchParams.tab) ? searchParams.tab : DEFAULT_TAB@@ -219,13 +222,19 @@ export function ReplayScannersScene(): JSX.Element {title: 'Status',key: 'enabled',render: (_, scanner) => {- const status = scannerStatus(scanner, { quotaExhausted, drought: null })+ const status = scannerStatus(scanner, { quotaExhausted, drought: null, recordingsBlock })const tooltip =status.kind === 'limit_reached'? limitReachedTooltip(scanner): status.kind === 'quota_exhausted'? "Your organization's Replay Vision credits are used up for this billing period."- : null+ : status.kind === 'no_ai_consent' || status.kind === 'creator_lost_access'+ ? UNRUNNABLE_DETAIL[status.kind]+ : status.kind === 'replay_off'+ ? `${RECORDINGS_BLOCK_CAUSE['replay-off']}.`+ : status.kind === 'no_recordings'+ ? `${RECORDINGS_BLOCK_CAUSE['no-recordings']}.`+ : nullreturn (<Tooltip title={tooltip}>{/* The tooltip attaches its trigger to a DOM element, which the label component is not. */}@@ -316,6 +325,7 @@ export function ReplayScannersScene(): JSX.Element {/><IngestionLimitBanner />+ <RecordingsBlockBanner /><FieldGuideBanner />diff --git a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsxindex 7f7b47381cbe..06edad049ad9 100644--- a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx+++ b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx@@ -40,6 +40,7 @@ import { tagsModel } from '~/models/tagsModel'import { ProductKey } from '~/queries/schema/schema-general'import { CreditPriceNote } from '../components/PricingLink'+import { RecordingsBlockBanner } from '../components/RecordingsBlockBanner'import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'import { getReplayVisionEditDisabledReason } from '../utils/accessControl'import { ExampleObservations } from './components/ExampleObservations'@@ -179,6 +180,7 @@ export function ScannerEditorSceneComponent(): JSX.Element {resourceType={{ type: 'replay_vision' }}actions={<ReplayVisionFeedbackButton />}/>+ <RecordingsBlockBanner />{step === 'goal' || step === 'overview' || fromOverview ? null : (<GuidedWizardSteppersteps={stepperSteps}@@ -221,7 +223,7 @@ export function ScannerEditorSceneComponent(): JSX.Element {For each recording it watches, the scanner writes an observation like these andcites the moment it found.</p>- <ExampleObservations compact />+ <ExampleObservations /></aside></div></div>diff --git a/products/replay_vision/frontend/replay_scanners/components/ExampleObservations.tsx b/products/replay_vision/frontend/replay_scanners/components/ExampleObservations.tsxindex bc7a1378df59..11e7cf0d3b20 100644--- a/products/replay_vision/frontend/replay_scanners/components/ExampleObservations.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ExampleObservations.tsx@@ -1,13 +1,15 @@import { IconPlayFilled } from '@posthog/icons'import { LemonTag } from '@posthog/lemon-ui'-import { cn } from 'lib/utils/css-classes'+import { ScannerType, scannerTypeLabel } from '../types'export interface ExampleClip {scannerName: string- scannerType: string+ scannerType: ScannerTypeheadline: stringreason: string+ why: string+ watchFrom: string}/**@@ -17,55 +19,56 @@ export interface ExampleClip {export const EXAMPLE_CLIPS: ExampleClip[] = [{scannerName: 'Checkout friction',- scannerType: 'Monitor',+ scannerType: 'monitor',headline: 'Repeated clicks on a payment button that stayed disabled',reason: 'The scanner answered yes for this session.',+ why: 'Something failed here and in 6 similar sessions.',+ watchFrom: '01:12',},{scannerName: 'Onboarding drop-off',- scannerType: 'Summarizer',+ scannerType: 'summarizer',headline: 'Went back and forth between plans, then closed the tab',reason: 'The scanner raised a UX friction signal from this session.',+ why: 'The user struggled in this session.',+ watchFrom: '03:40',},{scannerName: 'Search quality',- scannerType: 'Scorer',+ scannerType: 'scorer',headline: 'Three searches in a row, none of them opened',reason: "Scored far from this scanner's recent average.",+ why: 'The user struggled here and in 2 similar sessions.',+ watchFrom: '00:48',+ },+ {+ scannerName: 'Billing errors',+ scannerType: 'monitor',+ headline: 'The invoice page showed an error after a plan change',+ reason: 'The scanner answered yes for this session.',+ why: 'A payment problem came up in this session.',+ watchFrom: '02:05',},]-export interface ExampleObservationsProps {- /** Stacks the thumbnail above the text, for a side column too narrow for the two side by side. */- compact?: boolean-}+// The feed's two-column grid uses all four examples. A single column stops at three to keep the page short.+export const COLUMN_EXAMPLE_COUNT = 3/** Example observation cards, so a reader without observations of their own sees what a scanner produces. */-export function ExampleObservations({ compact = false }: ExampleObservationsProps): JSX.Element {+export function ExampleObservations(): JSX.Element {return (<div className="relative flex flex-col gap-2"><p className="text-xs text-secondary m-0">Examples, not your data</p>- {EXAMPLE_CLIPS.map((clip) => (- <div- key={clip.scannerName}- className={cn(- 'flex border rounded bg-bg-light',- compact ? 'flex-col gap-2 p-3' : 'gap-4 items-start p-4'- )}- >- <div- className={cn(- 'flex-none rounded bg-surface-secondary flex items-center justify-center text-secondary',- compact ? 'w-full h-16' : 'w-40 h-24'- )}- >+ {EXAMPLE_CLIPS.slice(0, COLUMN_EXAMPLE_COUNT).map((clip) => (+ <div key={clip.scannerName} className="flex flex-col gap-2 border rounded bg-bg-light p-3">+ <div className="flex-none w-full h-16 rounded bg-surface-secondary flex items-center justify-center text-secondary"><IconPlayFilled className="text-xl" /></div><div className="min-w-0 flex flex-col gap-1"><div className="flex flex-wrap gap-1"><LemonTag type="highlight">Example</LemonTag><LemonTag type="muted">{clip.scannerName}</LemonTag>- <LemonTag type="muted">{clip.scannerType}</LemonTag>+ <LemonTag type="muted">{scannerTypeLabel(clip.scannerType)}</LemonTag></div><h4 className="text-sm font-semibold m-0">{clip.headline}</h4><p className="text-xs text-secondary m-0">{clip.reason}</p>diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedCard.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedCard.tsxindex 929f18df14ee..9e5fb31e0539 100644--- a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedCard.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedCard.tsx@@ -4,8 +4,8 @@ import { combineUrl } from 'kea-router'import { useCallback, useEffect, useMemo, useState } from 'react'import { useInView } from 'react-intersection-observer'-import { IconChevronLeft, IconChevronRight, IconFlag, IconPlayFilled } from '@posthog/icons'-import { LemonButton, LemonTag, Link, Tooltip } from '@posthog/lemon-ui'+import { IconChevronLeft, IconChevronRight, IconPlayFilled } from '@posthog/icons'+import { LemonButton, Link, Tooltip } from '@posthog/lemon-ui'import { useAutoMarkRead } from 'lib/components/NotificationsMenu/useAutoMarkRead'import { TZLabel } from 'lib/components/TZLabel'@@ -22,7 +22,6 @@ import {observationThumbnailSrc,preloadObservationThumbnail,} from '../../components/ObservationThumbnail'-import { scannerTypeIcon } from '../../components/ScannerTypeBadge'import { UnviewedObservationTag } from '../../components/UnviewedObservationTag'import type {ReplayObservationApi,@@ -36,9 +35,11 @@ import { hasScannerPage, scannerLabel } from '../../utils/observation'import { TimelineChapter, readChapters } from '../../utils/recordingTimeline'import { feedCategoriesParam, highlightFeedLogic } from '../highlightFeedLogic'import { CARD_SEEN_DWELL_MS, cardProperties } from '../highlightFeedTelemetry'-import { SCANNER_TYPE_TAG_TYPE, ScannerType } from '../types'+import { ScannerType } from '../types'+import { HighlightFeedCardLayout } from './HighlightFeedCardLayout'import { HighlightFeedDismissButton } from './HighlightFeedDismissButton'import { HighlightFeedGroupToggle, similarSessionsLabel } from './HighlightFeedGroup'+import { HighlightFeedScannerChip } from './HighlightFeedScannerChip'/** Reason kinds that say nothing about the session. The backend returns these only to pad a near-empty* feed, so a feed made up entirely of them means the window turned up no findings at all. */@@ -331,19 +332,7 @@ function HighlightFeedScannerLink({}): JSX.Element {const verdict = readResult(observation)?.verdictconst linked = hasScannerPage(observation)- const chip = (- <>- {scannerType && (- <LemonTag- type={SCANNER_TYPE_TAG_TYPE[scannerType]}- className="size-6 shrink-0 justify-center !rounded-full !p-0"- >- {scannerTypeIcon(scannerType)}- </LemonTag>- )}- <span className="truncate font-medium">{scannerName}</span>- </>- )+ const chip = <HighlightFeedScannerChip scannerName={scannerName} scannerType={scannerType} />return (<Tooltiptitle={@@ -466,111 +455,81 @@ export function HighlightFeedRow({})}return (- <article+ <HighlightFeedCardLayoutref={setRowRef}className={clsx(- 'group relative flex min-w-0 flex-col gap-3 rounded-lg border bg-surface-primary p-4 hover:border-accent focus-within:border-accent','ease-out motion-safe:transition-[opacity,translate] motion-safe:duration-500',ROW_STAGGER[Math.min(columnIndex, ROW_STAGGER.length - 1)],!inView && 'motion-safe:translate-y-4 motion-safe:opacity-0')}data-attr="vision-highlight-feed-row"- >- <header className="flex min-w-0 items-center gap-2">- <div className="flex min-w-0">- <HighlightFeedScannerLink- observation={observation}- scannerName={scannerName}- scannerType={scannerType}- />- </div>- <span className="text-xs text-muted" aria-hidden>- ·- </span>- {/* The person and age keep up to 45% of the line, so a long email is cut before the scanner name. */}- <div className="min-w-0 max-w-[45%] shrink-0">- <HighlightCardPerson observation={observation} person={person} />- </div>+ scanner={+ <HighlightFeedScannerLink+ observation={observation}+ scannerName={scannerName}+ scannerType={scannerType}+ />+ }+ meta={<HighlightCardPerson observation={observation} person={person} />}+ action={<HighlightFeedDismissButton- className="relative z-10 ml-auto shrink-0"onDismiss={(dismissalReason) => dismissItem(item, position, dismissalReason)}/>- </header>- <div className="flex min-w-0 flex-col gap-1">- <Link- to={openUrl}- onClick={captureOpened}- className="text-default after:absolute after:inset-0 after:content-['']"- data-attr="vision-highlight-feed-row-open"- >- <h3- // Two lines are always reserved, so cards in one grid row keep their posters level.- className={`m-0 min-h-[2lh] text-base line-clamp-2 wrap-anywhere group-hover:text-accent ${filler ? 'font-medium text-secondary' : 'font-semibold'}`}- title={title}+ }+ title={title}+ titlePrefix={!observation.viewed && <span className="sr-only">New: </span>}+ titleMuted={filler}+ titleLink={{ to: openUrl, onClick: captureOpened }}+ why={why}+ poster={+ <>+ {!observation.viewed && (+ <span className="absolute inset-x-0 top-0 z-20 h-1 bg-accent" aria-hidden />+ )}+ {chapters.length > 0 ? (+ <ChapterCarousel+ observation={observation}+ chapters={chapters}+ slide={slide}+ onSlide={(next) => {+ posthog.capture('replay_vision_highlight_chapter_slid', {+ ...cardProperties(feedLoad, item, position, 'feed_tab'),+ chapter_count: chapters.length,+ from_slide: slide,+ to_slide: next,+ })+ setSlide(next)+ }}+ retryKey={feedLoad?.feedLoadId}+ />+ ) : (+ <ObservationThumbnail+ observation={observation}+ className="rounded-none border-0"+ retryKey={feedLoad?.feedLoadId}+ />+ )}+ {!observation.viewed && <UnviewedObservationTag className="absolute top-2 left-2 z-10" />}+ </>+ }+ footer={+ <>+ <LemonButton+ type="secondary"+ size="small"+ icon={<IconPlayFilled />}+ to={openUrl}+ onClick={captureOpened}+ className="relative z-10"+ data-attr="vision-highlight-feed-row-watch">- {!observation.viewed && <span className="sr-only">New: </span>}- {title}- </h3>- </Link>- <p- className="m-0 flex items-start gap-1.5 text-sm text-secondary"- data-attr="vision-highlight-feed-why"- >- <Tooltip title="Why this recording">- <span className="mt-0.5 flex shrink-0">- <IconFlag className="text-accent" aria-hidden />- </span>- </Tooltip>- <span className="min-w-0 truncate" title={why}>- <span className="sr-only">Why this recording: </span>- {why}- </span>- </p>- </div>- {/* Clicks pass through the poster to the card's link, which sits beneath it. */}- <div className="pointer-events-none relative overflow-hidden rounded-md border bg-surface-primary">- {!observation.viewed && <span className="absolute inset-x-0 top-0 z-20 h-1 bg-accent" aria-hidden />}- {chapters.length > 0 ? (- <ChapterCarousel- observation={observation}- chapters={chapters}- slide={slide}- onSlide={(next) => {- posthog.capture('replay_vision_highlight_chapter_slid', {- ...cardProperties(feedLoad, item, position, 'feed_tab'),- chapter_count: chapters.length,- from_slide: slide,- to_slide: next,- })- setSlide(next)- }}- retryKey={feedLoad?.feedLoadId}- />- ) : (- <ObservationThumbnail- observation={observation}- className="rounded-none border-0"- retryKey={feedLoad?.feedLoadId}- />- )}- {!observation.viewed && <UnviewedObservationTag className="absolute top-2 left-2 z-10" />}- </div>- <footer className="flex items-center gap-2">- <LemonButton- type="secondary"- size="small"- icon={<IconPlayFilled />}- to={openUrl}- onClick={captureOpened}- className="relative z-10"- data-attr="vision-highlight-feed-row-watch"- >- {watchFromMs !== null- ? `Watch from ${colonDelimitedDuration(Math.floor(watchFromMs / 1000), null)}`- : 'Watch session'}- </LemonButton>- {similarCount > 0 && <HighlightFeedGroupToggle {...groupProps} />}- </footer>- </article>+ {watchFromMs !== null+ ? `Watch from ${colonDelimitedDuration(Math.floor(watchFromMs / 1000), null)}`+ : 'Watch session'}+ </LemonButton>+ {similarCount > 0 && <HighlightFeedGroupToggle {...groupProps} />}+ </>+ }+ />)}diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedCardLayout.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedCardLayout.tsxnew file mode 100644index 000000000000..3be7b485d717--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedCardLayout.tsx@@ -0,0 +1,112 @@+import { forwardRef } from 'react'++import { IconFlag } from '@posthog/icons'+import { Link, Tooltip } from '@posthog/lemon-ui'++import { cn } from 'lib/utils/css-classes'++export interface HighlightFeedCardLayoutProps {+ scanner: React.ReactNode+ meta: React.ReactNode+ action?: React.ReactNode+ title: string+ titlePrefix?: React.ReactNode+ /** Filler picks say nothing about the session, so their title reads quieter. */+ titleMuted?: boolean+ /** Stretched over the whole card, so a click anywhere opens it. */+ titleLink?: { to: string; onClick?: () => void }+ why: string+ poster: React.ReactNode+ footer: React.ReactNode+ className?: string+ 'data-attr'?: string+}++export const HighlightFeedCardLayout = forwardRef<HTMLElement, HighlightFeedCardLayoutProps>(+ function HighlightFeedCardLayout(+ {+ scanner,+ meta,+ action,+ title,+ titlePrefix,+ titleMuted = false,+ titleLink,+ why,+ poster,+ footer,+ className,+ 'data-attr': dataAttr,+ },+ ref+ ): JSX.Element {+ const heading = (+ <h3+ // Two lines are always reserved, so cards in one grid row keep their posters level.+ className={cn(+ 'm-0 min-h-[2lh] text-base line-clamp-2 wrap-anywhere',+ titleLink && 'group-hover:text-accent',+ titleMuted ? 'font-medium text-secondary' : 'font-semibold'+ )}+ title={title}+ >+ {titlePrefix}+ {title}+ </h3>+ )+ return (+ <article+ ref={ref}+ className={cn(+ 'group relative flex min-w-0 flex-col gap-3 rounded-lg border bg-surface-primary p-4',+ titleLink && 'hover:border-accent focus-within:border-accent',+ className+ )}+ data-attr={dataAttr}+ >+ <header className="flex min-w-0 items-center gap-2">+ <div className="flex min-w-0">{scanner}</div>+ <span className="text-xs text-muted" aria-hidden>+ ·+ </span>+ {/* The person and age keep up to 45% of the line, so a long email is cut before the scanner name. */}+ <div className="min-w-0 max-w-[45%] shrink-0">{meta}</div>+ {action && <div className="relative z-10 ml-auto shrink-0">{action}</div>}+ </header>+ <div className="flex min-w-0 flex-col gap-1">+ {titleLink ? (+ <Link+ to={titleLink.to}+ onClick={titleLink.onClick}+ className="text-default after:absolute after:inset-0 after:content-['']"+ data-attr="vision-highlight-feed-row-open"+ >+ {heading}+ </Link>+ ) : (+ heading+ )}+ <p+ className="m-0 flex items-start gap-1.5 text-sm text-secondary"+ data-attr="vision-highlight-feed-why"+ >+ <Tooltip title="Why this recording">+ <span className="mt-0.5 flex shrink-0">+ <IconFlag className="text-accent" aria-hidden />+ </span>+ </Tooltip>+ <span className="min-w-0 truncate" title={why}>+ <span className="sr-only">Why this recording: </span>+ {why}+ </span>+ </p>+ </div>+ {/* Clicks pass through the poster to the card's link, which sits beneath it. */}+ <div className="pointer-events-none relative overflow-hidden rounded-md border bg-surface-primary">+ {poster}+ </div>+ <footer className="flex items-center gap-2">{footer}</footer>+ </article>+ )+ }+)diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedEmptyState.stories.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedEmptyState.stories.tsxindex a4943cda3d05..c6608c1f0901 100644--- a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedEmptyState.stories.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedEmptyState.stories.tsx@@ -28,3 +28,5 @@ export const QuotaExhausted: Story = { args: { reason: 'quota-exhausted' } }export const AllCapped: Story = { args: { reason: 'all-capped' } }export const Filtered: Story = { args: { reason: 'filtered' } }export const QuietWindow: Story = { args: { reason: 'quiet-window' } }+export const ReplayOff: Story = { args: { reason: 'replay-off' } }+export const NoRecordings: Story = { args: { reason: 'no-recordings' } }diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedEmptyState.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedEmptyState.tsxindex cd46093f1182..6ced319b98b6 100644--- a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedEmptyState.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedEmptyState.tsx@@ -5,6 +5,7 @@ import { LemonButton } from '@posthog/lemon-ui'import { urls } from 'scenes/urls'+import { RECORDINGS_BLOCK_CAUSE } from '../../logics/replayRecordingsLogic'import { HIGHLIGHT_FEED_BLOCKS, type HighlightFeedEmptyReason, isHighlightFeedBlock } from '../highlightFeedEmptyState'import { feedWindowPhrase, longerFeedWindow, highlightFeedLogic } from '../highlightFeedLogic'import { HighlightFeedIntro } from './HighlightFeedIntro'@@ -30,6 +31,15 @@ export function HighlightFeedEmptyState({ reason }: { reason: HighlightFeedEmptyreturn <HighlightFeedIntro />}+ // The recordings banner above the tabs carries the fix, so the note only names the cause.+ if (reason === 'replay-off' || reason === 'no-recordings') {+ return (+ <DashedNote>+ <span>No sessions to show. {RECORDINGS_BLOCK_CAUSE[reason]}.</span>+ </DashedNote>+ )+ }+if (isHighlightFeedBlock(reason)) {const block = HIGHLIGHT_FEED_BLOCKS[reason]return (diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedExampleCards.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedExampleCards.tsxnew file mode 100644index 000000000000..c08dbcfd542c--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedExampleCards.tsx@@ -0,0 +1,57 @@+import { IconPlayFilled } from '@posthog/icons'+import { LemonButton, LemonTag } from '@posthog/lemon-ui'++import { EXAMPLE_CLIPS } from './ExampleObservations'+import { HighlightFeedCardLayout } from './HighlightFeedCardLayout'+import { HighlightFeedScannerChip } from './HighlightFeedScannerChip'++export function HighlightFeedExampleCards(): JSX.Element {+ return (+ <div className="@container relative flex flex-col gap-2">+ <p className="m-0 text-xs text-secondary">Examples, not your data</p>+ <div className="grid grid-cols-1 gap-3 @xl:grid-cols-2">+ {EXAMPLE_CLIPS.map((card) => (+ <HighlightFeedCardLayout+ key={card.scannerName}+ className="gap-2 p-3"+ scanner={+ <span className="flex max-w-full min-w-0 items-center gap-2 self-start text-sm text-secondary">+ <HighlightFeedScannerChip+ scannerName={card.scannerName}+ scannerType={card.scannerType}+ />+ </span>+ }+ meta={<LemonTag type="highlight">Example</LemonTag>}+ title={card.headline}+ why={card.why}+ poster={+ <div+ className="aspect-video flex items-center justify-center bg-surface-secondary text-secondary"+ aria-hidden+ >+ <IconPlayFilled className="text-xl" />+ </div>+ }+ footer={+ <LemonButton+ type="secondary"+ size="xsmall"+ icon={<IconPlayFilled />}+ disabledReason="This is an example"+ >+ Watch from {card.watchFrom}+ </LemonButton>+ }+ />+ ))}+ </div>+ {/* The examples stand in for a feed the reader does not have, so the grid fades into the+ page instead of ending on a hard edge, which would read as a real feed cut short. */}+ <div+ aria-hidden+ className="pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-b from-transparent to-[var(--color-bg-primary)]"+ />+ </div>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedIntro.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedIntro.tsxindex 20b045f00d83..0228911b53ad 100644--- a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedIntro.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedIntro.tsx@@ -1,6 +1,6 @@import { VisionDocsLink } from '../../components/DocsLink'import { CreateScannerButton } from './CreateScannerButton'-import { ExampleObservations } from './ExampleObservations'+import { HighlightFeedExampleCards } from './HighlightFeedExampleCards'/*** What the Highlights tab shows a reader who has no scanners: what the feed is for, an example of@@ -27,7 +27,7 @@ export function HighlightFeedIntro(): JSX.Element {</div></div>- <ExampleObservations />+ <HighlightFeedExampleCards /></div>)}diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightFeedScannerChip.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedScannerChip.tsxnew file mode 100644index 000000000000..f5055c400a15--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightFeedScannerChip.tsx@@ -0,0 +1,26 @@+import { LemonTag } from '@posthog/lemon-ui'++import { scannerTypeIcon } from '../../components/ScannerTypeBadge'+import { SCANNER_TYPE_TAG_TYPE, ScannerType } from '../types'++export function HighlightFeedScannerChip({+ scannerName,+ scannerType,+}: {+ scannerName: string+ scannerType: ScannerType | undefined+}): JSX.Element {+ return (+ <>+ {scannerType && (+ <LemonTag+ type={SCANNER_TYPE_TAG_TYPE[scannerType]}+ className="size-6 shrink-0 justify-center !rounded-full !p-0"+ >+ {scannerTypeIcon(scannerType)}+ </LemonTag>+ )}+ <span className="truncate font-medium">{scannerName}</span>+ </>+ )+}diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightPicksEmptyState.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightPicksEmptyState.tsxindex 77a2299a68f5..167155123f80 100644--- a/products/replay_vision/frontend/replay_scanners/components/HighlightPicksEmptyState.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightPicksEmptyState.tsx@@ -3,12 +3,9 @@ import { useEffect } from 'react'import { LemonSkeleton } from '@posthog/lemon-ui'-import { productSetupStatusLogic } from 'lib/components/ProductEmptyState/productSetupStatusLogic'import { cn } from 'lib/utils/css-classes'-import { teamLogic } from 'scenes/teamLogic'--import { ProductKey } from '~/queries/schema/schema-general'+import { replayRecordingsLogic } from '../../logics/replayRecordingsLogic'import { visionQuotaLogic } from '../../logics/visionQuotaLogic'import { visionScannersListLogic } from '../../logics/visionScannersListLogic'import { resolveHighlightFeedEmptyReason } from '../highlightFeedEmptyState'@@ -23,26 +20,20 @@ import { HighlightPicksStarter } from './HighlightPicksStarter'export function HighlightPicksEmptyState({ size }: { size: 'small' | 'large' }): JSX.Element {const { scanners, scannersLoading } = useValues(visionScannersListLogic)const { quota, quotaLoading } = useValues(visionQuotaLogic)- const { currentTeam } = useValues(teamLogic)+ const { recordingsBlock, hasRecentRecordingsLoading } = useValues(replayRecordingsLogic)const picksLogic = useMountedLogic(highlightPicksLogic)const { emptyStateShown } = useActions(picksLogic)- const { status: replayStatus } = useValues(productSetupStatusLogic({ productKey: ProductKey.SESSION_REPLAY }))const large = size === 'large'- const loading = scannersLoading || quotaLoading+ // Waits for the probe, so the empty state is not reported once as quiet and again as no recordings.+ const loading = scannersLoading || quotaLoading || hasRecentRecordingsLoadingconst reason = loading? null: resolveHighlightFeedEmptyReason({scanners,quota,- sessionRecordingOptIn: currentTeam?.session_recording_opt_in ?? null,+ recordingsBlock,hasFeedFilters: false,- hasRecordings:- replayStatus === 'has-data'- ? true- : replayStatus === 'needs-setup' || replayStatus === 'waiting-for-data'- ? false- : null,})useEffect(() => {diff --git a/products/replay_vision/frontend/replay_scanners/components/HighlightPicksShadowPreview.tsx b/products/replay_vision/frontend/replay_scanners/components/HighlightPicksShadowPreview.tsxindex 637f39109065..a6fde301c1ae 100644--- a/products/replay_vision/frontend/replay_scanners/components/HighlightPicksShadowPreview.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/HighlightPicksShadowPreview.tsx@@ -1,13 +1,14 @@import { IconPlayFilled } from '@posthog/icons'-import { EXAMPLE_CLIPS } from './ExampleObservations'+import { scannerTypeLabel } from '../types'+import { COLUMN_EXAMPLE_COUNT, EXAMPLE_CLIPS } from './ExampleObservations'import { HighlightPickRankBadge } from './HighlightPickRankBadge'export function HighlightPicksShadowPreview(): JSX.Element {return (<div className="relative flex flex-col gap-0.5 p-1" data-attr="vision-highlight-picks-shadow-preview"><span className="px-2 py-1 text-xs text-secondary">Examples, not your data</span>- {EXAMPLE_CLIPS.map((clip, index) => (+ {EXAMPLE_CLIPS.slice(0, COLUMN_EXAMPLE_COUNT).map((clip, index) => (<div key={clip.scannerName} className="flex w-full min-w-0 items-center gap-3 px-2 py-1 opacity-60"><span className="relative flex h-16 w-28 shrink-0 items-center justify-center rounded bg-surface-secondary text-secondary"><IconPlayFilled className="text-xl" />@@ -16,7 +17,7 @@ export function HighlightPicksShadowPreview(): JSX.Element {<span className="flex min-w-0 flex-1 flex-col gap-0.5"><span className="truncate text-sm font-semibold">{clip.headline}</span><span className="truncate text-xs text-secondary">- {clip.scannerName} · {clip.scannerType}+ {clip.scannerName} · {scannerTypeLabel(clip.scannerType)}</span><span className="truncate text-xs text-secondary">{clip.reason}</span></span>diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerScoutCard.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerScoutCard.tsxindex 9cc9c6a7a5ba..9d4281fab822 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerScoutCard.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerScoutCard.tsx@@ -9,6 +9,7 @@ import { LemonBanner, LemonButton } from '@posthog/lemon-ui'import { TZLabel } from 'lib/components/TZLabel'import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'+import { cn } from 'lib/utils/css-classes'import { urls } from 'scenes/urls'import { getReplayVisionEditDisabledReason, getScoutCreateDisabledReason } from '../../utils/accessControl'@@ -16,12 +17,13 @@ import { replayScannerLogic } from '../replayScannerLogic'import { ReplayScannerTab } from '../replayScannerSceneLogic'import { scannerScoutLogic } from '../scannerScoutLogic'import { ClippedPreview } from './ClippedPreview'+import { HERO_CARD_HEADER, HERO_CARD_HEIGHT } from './scannerHeroCard'import { ScannerScoutReportModal } from './ScannerScoutReportModal'function CardShell({ children }: { children: React.ReactNode }): JSX.Element {return (<div- className="border rounded bg-surface-primary p-4 flex flex-col gap-2 min-h-38"+ className={cn('border rounded bg-surface-primary p-4 flex flex-col gap-2', HERO_CARD_HEIGHT)}data-attr="vision-scanner-scout-card">{children}@@ -31,7 +33,7 @@ function CardShell({ children }: { children: React.ReactNode }): JSX.Element {function CardHeader({ meta, actions }: { meta?: React.ReactNode; actions?: React.ReactNode }): JSX.Element {return (- <div className="flex items-center justify-between gap-2 border-b border-primary pb-2">+ <div className={HERO_CARD_HEADER}>{/* The title stays on one line, so in a narrow column the meta drops below it rather thansplitting the title across lines out of line with the meta. */}<div className="flex min-w-0 flex-wrap items-baseline gap-x-2">diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerStatusLabel.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerStatusLabel.tsxindex 02de305af67f..84343ad3a2c2 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerStatusLabel.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerStatusLabel.tsx@@ -14,7 +14,11 @@ const TONE_DOT: Record<StatusTone, string> = {}const STATUS_LABEL: Record<ScannerStatus['kind'], { label: string; tone: StatusTone }> = {+ no_ai_consent: { label: 'Needs AI consent', tone: 'danger' },+ creator_lost_access: { label: 'Creator lost access', tone: 'danger' },off: { label: 'Off', tone: 'muted' },+ replay_off: { label: 'Replay off', tone: 'danger' },+ no_recordings: { label: 'No recordings', tone: 'warning' },limit_reached: { label: 'Stopped', tone: 'danger' },quota_exhausted: { label: 'Stopped', tone: 'danger' },filter_error: { label: 'Filter error', tone: 'danger' },diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerStatusStrip.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerStatusStrip.tsxindex ce1d795e8543..082c44b1f1b5 100644--- a/products/replay_vision/frontend/replay_scanners/components/ScannerStatusStrip.tsx+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerStatusStrip.tsx@@ -6,10 +6,12 @@ import { TZLabel } from 'lib/components/TZLabel'import { dayjs } from 'lib/dayjs'import { LemonDialog } from 'lib/lemon-ui/LemonDialog'import { LemonProgress } from 'lib/lemon-ui/LemonProgress'+import { cn } from 'lib/utils/css-classes'import { percentage } from 'lib/utils/numbers'import { pluralize } from 'lib/utils/strings'import { urls } from 'scenes/urls'+import { RECORDINGS_BLOCK_CAUSE, replayRecordingsLogic } from '../../logics/replayRecordingsLogic'import { visionQuotaLogic } from '../../logics/visionQuotaLogic'import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'import { formatCreditsRange } from '../../utils/credits'@@ -17,9 +19,10 @@ import { quotaBannerState } from '../../utils/quotaProjection'import { replayScannerLogic } from '../replayScannerLogic'import { ReplayScannerTab } from '../replayScannerSceneLogic'import { scanDrought } from '../scanDrought'-import { limitReachedTooltip, stoppedByFreeCredits } from '../scannerCopy'+import { UNRUNNABLE_DETAIL, limitReachedTooltip, stoppedByFreeCredits } from '../scannerCopy'import { scannerEditUrl } from '../scannerEditorSceneLogic'import { ScannerStatus, SWEEP_INTERVAL_MINUTES, scannerStatus, spendAgainstLimit } from '../scannerStatus'+import { HERO_CARD_HEADER, HERO_CARD_HEIGHT } from './scannerHeroCard'import { ScannerStatusLabel } from './ScannerStatusLabel'function formatInterval(minutes: number): string {@@ -32,10 +35,18 @@ function formatInterval(minutes: number): string {function statusDetail(status: ScannerStatus, resetsOn: string | null, periodEndsOn: string | null): React.ReactNode {switch (status.kind) {+ case 'no_ai_consent':+ return UNRUNNABLE_DETAIL.no_ai_consent+ case 'creator_lost_access':+ return `${UNRUNNABLE_DETAIL.creator_lost_access} Turn it on to take it over.`case 'off':return status.reason === 'no_sampling'? 'Sampling is set to 0%, so no recordings are scanned.': "This scanner doesn't scan new recordings."+ case 'replay_off':+ return `${RECORDINGS_BLOCK_CAUSE['replay-off']}, so there are no recordings to scan.`+ case 'no_recordings':+ return `${RECORDINGS_BLOCK_CAUSE['no-recordings']}, so there is nothing to scan.`case 'limit_reached':return stoppedByFreeCredits(status)? `Paused until your free credits reset${periodEndsOn ? ` on ${periodEndsOn}` : ''}. Recordings until then are skipped.`@@ -87,6 +98,7 @@ export function ScannerStatusStrip({ scannerId }: { scannerId: string }): JSX.El)const { toggleEnabled, turnOffFreeOnly } = useActions(replayScannerLogic({ id: scannerId }))const { quota } = useValues(visionQuotaLogic)+ const { recordingsBlock } = useValues(replayRecordingsLogic)if (!scanner) {return null}@@ -94,6 +106,7 @@ export function ScannerStatusStrip({ scannerId }: { scannerId: string }): JSX.Elconst status = scannerStatus(scanner, {quotaExhausted: quotaState.kind === 'exhausted',drought: scanDrought(scanner, observationStatsApi?.labels.version_markers ?? null, new Date()),+ recordingsBlock,})const periodEndsOn = quota ? dayjs.utc(quota.period_end).format('MMMM D') : nullconst detail = statusDetail(status, quotaState.kind ? quotaState.resetsOn : null, periodEndsOn)@@ -102,13 +115,12 @@ export function ScannerStatusStrip({ scannerId }: { scannerId: string }): JSX.Elconst spend = spendAgainstLimit(scanner, quota)return (- // min-h-38 matches the empty scout card beside it, so the two line up when there is no report yet.<div- className="@container border rounded bg-surface-primary p-4 flex flex-col gap-3 min-h-38"+ className={cn('@container border rounded bg-surface-primary p-4 flex flex-col gap-3', HERO_CARD_HEIGHT)}data-attr="vision-scanner-status-strip"data-status={status.kind}>- <div className="flex items-center justify-between gap-2 border-b border-primary pb-2">+ <div className={HERO_CARD_HEADER}><span className="text-sm font-medium">Scanner status</span><LemonSwitchchecked={scanner.enabled}@@ -116,13 +128,15 @@ export function ScannerStatusStrip({ scannerId }: { scannerId: string }): JSX.Elloading={togglingEnabled}disabledReason={editDisabledReason}label="Enabled"- size="small"+ bordered+ // An off scanner is the state people miss, so the toggle picks up the accent color then.+ className={cn(!scanner.enabled && '!border-accent !bg-accent-highlight')}data-attr="vision-scanner-toggle-enabled"data-ph-capture-attribute-scanner-type={scanner.scanner_type}data-ph-capture-attribute-will-be-enabled={!scanner.enabled}/></div>- <div className="grid grid-cols-1 @2xl:grid-cols-2 gap-x-8 gap-y-4 items-start">+ <div className="grid grid-cols-1 @lg:grid-cols-2 gap-x-8 gap-y-4 items-start"><div className="min-w-0 flex flex-col gap-1"><div className="flex items-center gap-2"><ScannerStatusLabel status={status} className="text-sm font-semibold" />@@ -147,34 +161,6 @@ export function ScannerStatusStrip({ scannerId }: { scannerId: string }): JSX.El</>)}</div>- {pausedByFreeCredits && (- <div className="pl-4 pt-1 flex flex-wrap items-center justify-between gap-x-3 gap-y-1">- <span className="text-xs text-muted">- Turn it off to keep scanning now. Scans past your free credits are billed.- </span>- <LemonSwitch- checked- onChange={() =>- LemonDialog.open({- title: 'Turn off free credits only?',- description:- scanner.credit_limit != null- ? `This scanner will keep scanning after your free credits run out. Scans past them are billed, up to its limit of ${scanner.credit_limit.toLocaleString('en-US')} credits a month.`- : "This scanner will keep scanning after your free credits run out. Scans past them are billed, up to your organization's spend limit.",- primaryButton: { children: 'Turn off', onClick: () => turnOffFreeOnly() },- secondaryButton: { children: 'Cancel' },- })- }- loading={turningOffFreeOnly}- disabledReason={editDisabledReason}- label="Free credits only"- size="small"- bordered- data-attr="vision-scanner-status-turn-off-free-only"- data-ph-capture-attribute-scanner-type={scanner.scanner_type}- />- </div>- )}</div><div className="min-w-0 flex flex-col gap-1"><div className="flex items-center justify-between gap-2 text-sm">@@ -208,6 +194,35 @@ export function ScannerStatusStrip({ scannerId }: { scannerId: string }): JSX.El)}</span>)}+ {pausedByFreeCredits && (+ <div className="pt-1">+ <LemonSwitch+ checked+ onChange={() =>+ LemonDialog.open({+ title: 'Turn off free credits only?',+ description:+ scanner.credit_limit != null+ ? `This scanner will keep scanning after your free credits run out. Scans past them are billed, up to its limit of ${scanner.credit_limit.toLocaleString('en-US')} credits a month.`+ : "This scanner will keep scanning after your free credits run out. Scans past them are billed, up to your organization's spend limit.",+ primaryButton: {+ children: 'Turn off',+ onClick: () => turnOffFreeOnly(),+ },+ secondaryButton: { children: 'Cancel' },+ })+ }+ loading={turningOffFreeOnly}+ disabledReason={editDisabledReason}+ label="Free credits only"+ tooltip="Turn it off to keep scanning now. Scans past your free credits are billed."+ size="small"+ bordered+ data-attr="vision-scanner-status-turn-off-free-only"+ data-ph-capture-attribute-scanner-type={scanner.scanner_type}+ />+ </div>+ )}</div></div></div>diff --git a/products/replay_vision/frontend/replay_scanners/components/scannerHeroCard.ts b/products/replay_vision/frontend/replay_scanners/components/scannerHeroCard.tsnew file mode 100644index 000000000000..8ab90ba13cf9--- /dev/null+++ b/products/replay_vision/frontend/replay_scanners/components/scannerHeroCard.ts@@ -0,0 +1,4 @@+// Side by side, the status card and the scout card share a height that fits the tallest status and the scout empty state, so their edges stay level.+export const HERO_CARD_HEIGHT = '@5xl:min-h-48'+// Fits the bordered "Enabled" switch, so a header without one is as tall as the status header.+export const HERO_CARD_HEADER = 'flex items-center justify-between gap-2 border-b border-primary pb-2 min-h-[2.875rem]'diff --git a/products/replay_vision/frontend/replay_scanners/highlightFeedEmptyState.test.ts b/products/replay_vision/frontend/replay_scanners/highlightFeedEmptyState.test.tsindex 24595a8de3cd..3265b2bff9e6 100644--- a/products/replay_vision/frontend/replay_scanners/highlightFeedEmptyState.test.ts+++ b/products/replay_vision/frontend/replay_scanners/highlightFeedEmptyState.test.ts@@ -1,4 +1,5 @@import type { ReplayScannerApi, VisionQuotaApi } from '../generated/api.schemas'+import type { RecordingsBlock } from '../logics/replayRecordingsLogic'import { type HighlightFeedEmptyReason, resolveHighlightFeedEmptyReason } from './highlightFeedEmptyState'const scanner = (overrides: Partial<ReplayScannerApi> = {}): ReplayScannerApi =>@@ -16,13 +17,19 @@ describe('resolveHighlightFeedEmptyReason', () => {VisionQuotaApi | null,boolean,HighlightFeedEmptyReason,- (boolean | null)?,- (boolean | null)?,+ (RecordingsBlock | null)?,]>([['no scanners at all', [], quota(false), false, 'no-scanners'],- ['recording turned off, even with no scanners', [], quota(false), false, 'replay-off', false],- ['recording turned off, even with an exhausted budget', [scanner()], quota(true), false, 'replay-off', false],+ ['recording turned off, even with no scanners', [], quota(false), false, 'replay-off', 'replay-off'],+ [+ 'recording turned off, even with an exhausted budget',+ [scanner()],+ quota(true),+ false,+ 'replay-off',+ 'replay-off',+ ],['an exhausted budget, even with every scanner off',[scanner({ enabled: false })],@@ -65,16 +72,15 @@ describe('resolveHighlightFeedEmptyReason', () => {],// Falls through rather than claiming a block it cannot see.['a quiet window when the quota snapshot never answered', [scanner()], null, false, 'quiet-window'],- ['no recordings before any scanner exists', [], quota(false), false, 'no-recordings', null, false],- ['no recordings over a quiet window', [scanner()], quota(false), false, 'no-recordings', null, false],+ ['no recordings before any scanner exists', [], quota(false), false, 'no-recordings', 'no-recordings'],+ ['no recordings over a quiet window', [scanner()], quota(false), false, 'no-recordings', 'no-recordings'],['a block before missing recordings',[scanner({ enabled: false })],quota(false),false,'all-disabled',- null,- false,+ 'no-recordings',],['a quiet window while the recordings probe is unanswered',@@ -83,20 +89,15 @@ describe('resolveHighlightFeedEmptyReason', () => {false,'quiet-window',null,- null,],- ])(- 'blames %s',- (_name, scanners, quotaValue, hasFeedFilters, expected, sessionRecordingOptIn = null, hasRecordings = null) => {- expect(- resolveHighlightFeedEmptyReason({- scanners,- quota: quotaValue,- sessionRecordingOptIn,- hasFeedFilters,- hasRecordings,- })- ).toBe(expected)- }- )+ ])('blames %s', (_name, scanners, quotaValue, hasFeedFilters, expected, recordingsBlock = null) => {+ expect(+ resolveHighlightFeedEmptyReason({+ scanners,+ quota: quotaValue,+ recordingsBlock,+ hasFeedFilters,+ })+ ).toBe(expected)+ })})diff --git a/products/replay_vision/frontend/replay_scanners/highlightFeedEmptyState.ts b/products/replay_vision/frontend/replay_scanners/highlightFeedEmptyState.tsindex c97e88a3b29f..5002c6bcb8f4 100644--- a/products/replay_vision/frontend/replay_scanners/highlightFeedEmptyState.ts+++ b/products/replay_vision/frontend/replay_scanners/highlightFeedEmptyState.ts@@ -1,4 +1,5 @@import type { ReplayScannerApi, VisionQuotaApi } from '../generated/api.schemas'+import type { RecordingsBlock } from '../logics/replayRecordingsLogic'/*** Why the highlight feed came back with nothing. Each value is a different answer for the@@ -63,10 +64,9 @@ export interface HighlightFeedEmptyInput {scanners: ReplayScannerApi[]/** Null when the snapshot has not answered, which reads here as "no block seen". */quota: VisionQuotaApi | null- /** Null while the team has not loaded, which also reads as "no block seen". */- sessionRecordingOptIn: boolean | null+ /** Null when recordings reach the scanners, or when nothing has answered yet. */+ recordingsBlock: RecordingsBlock | nullhasFeedFilters: boolean- hasRecordings?: boolean | null}/**@@ -76,15 +76,14 @@ export interface HighlightFeedEmptyInput {export function resolveHighlightFeedEmptyReason({scanners,quota,- sessionRecordingOptIn,+ recordingsBlock,hasFeedFilters,- hasRecordings = null,}: HighlightFeedEmptyInput): HighlightFeedEmptyReason {- if (sessionRecordingOptIn === false) {+ if (recordingsBlock === 'replay-off') {return 'replay-off'}if (scanners.length === 0) {- if (hasRecordings === false) {+ if (recordingsBlock === 'no-recordings') {return 'no-recordings'}// The scene gate answers this one first, so the feed sees it only when the setup probe@@ -105,5 +104,5 @@ export function resolveHighlightFeedEmptyReason({if (hasFeedFilters) {return 'filtered'}- return hasRecordings === false ? 'no-recordings' : 'quiet-window'+ return recordingsBlock === 'no-recordings' ? 'no-recordings' : 'quiet-window'}diff --git a/products/replay_vision/frontend/replay_scanners/highlightFeedLogic.ts b/products/replay_vision/frontend/replay_scanners/highlightFeedLogic.tsindex 9996d710dd1b..0493d2b9069d 100644--- a/products/replay_vision/frontend/replay_scanners/highlightFeedLogic.ts+++ b/products/replay_vision/frontend/replay_scanners/highlightFeedLogic.ts@@ -16,6 +16,7 @@ import {type HighlightFeedItemApi,} from '../generated/api.schemas'import type { FeedDismissalReasonEnumApi } from '../generated/api.schemas'+import { type RecordingsBlock, replayRecordingsLogic } from '../logics/replayRecordingsLogic'import { visionQuotaLogic } from '../logics/visionQuotaLogic'import { visionScannersListLogic } from '../logics/visionScannersListLogic'import { dismissFeedItem, withFeedItemRestored, withoutFeedItem } from './highlightFeedDismissal'@@ -32,6 +33,8 @@ import {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface highlightFeedLogicValues {+ hasRecentRecordingsLoading: boolean // replayRecordingsLogic+ recordingsBlock: RecordingsBlock | null // replayRecordingsLogicuser: UserType | null // userLogicquota: VisionQuotaApi | null // visionQuotaLogicquotaLoading: boolean // visionQuotaLogic@@ -157,7 +160,9 @@ export interface highlightFeedLogicMeta {scannersLoading: boolean,quota: VisionQuotaApi | null,quotaLoading: boolean,- scopedToMine: boolean+ scopedToMine: boolean,+ recordingsBlock: RecordingsBlock | null,+ hasRecentRecordingsLoading: boolean) => HighlightFeedEmptyReason | null}}@@ -236,6 +241,8 @@ export const highlightFeedLogic = kea<highlightFeedLogicType>([['scanners', 'scannersLoading'],visionQuotaLogic,['quota', 'quotaLoading'],+ replayRecordingsLogic,+ ['recordingsBlock', 'hasRecentRecordingsLoading'],],})),@@ -493,21 +500,31 @@ export const highlightFeedLogic = kea<highlightFeedLogicType>([],/** Null until both probes answer, so an empty screen is never drawn from unresolved data. */emptyReason: [- (s) => [s.scanners, s.scannersLoading, s.quota, s.quotaLoading, s.scopedToMine],+ (s) => [+ s.scanners,+ s.scannersLoading,+ s.quota,+ s.quotaLoading,+ s.scopedToMine,+ s.recordingsBlock,+ s.hasRecentRecordingsLoading,+ ],(scanners: ReplayScannerApi[],scannersLoading: boolean,quota: VisionQuotaApi | null,quotaLoading: boolean,- scopedToMine: boolean+ scopedToMine: boolean,+ recordingsBlock: RecordingsBlock | null,+ hasRecentRecordingsLoading: boolean): HighlightFeedEmptyReason | null =>- scannersLoading || quotaLoading+ // Waits for the recordings probe, so the reason is not reported as quiet and then corrected.+ scannersLoading || quotaLoading || hasRecentRecordingsLoading? null- : // The feed does not say anything about recording being off; that card lives in the picks column.- resolveHighlightFeedEmptyReason({+ : resolveHighlightFeedEmptyReason({scanners,quota,- sessionRecordingOptIn: null,+ recordingsBlock,hasFeedFilters: scopedToMine,}),],diff --git a/products/replay_vision/frontend/replay_scanners/highlightPicksStaleLogic.test.ts b/products/replay_vision/frontend/replay_scanners/highlightPicksStaleLogic.test.tsindex df268155d47d..6bf346f9c14b 100644--- a/products/replay_vision/frontend/replay_scanners/highlightPicksStaleLogic.test.ts+++ b/products/replay_vision/frontend/replay_scanners/highlightPicksStaleLogic.test.ts@@ -28,6 +28,7 @@ describe('highlightPicksStaleLogic', () => {200,{ free_monthly_credits: 2500, credits_used: 0, credit_limit: null },],+ '/api/environments/:team/session_recordings/': () => [200, { results: [{ id: 'r1' }] }],},post: {'/api/projects/:team/vision/scanners/:id/backfills/estimate/': () => [diff --git a/products/replay_vision/frontend/replay_scanners/highlightPicksStaleLogic.ts b/products/replay_vision/frontend/replay_scanners/highlightPicksStaleLogic.tsindex 7446e4b56ba4..ce140a44d8b9 100644--- a/products/replay_vision/frontend/replay_scanners/highlightPicksStaleLogic.ts+++ b/products/replay_vision/frontend/replay_scanners/highlightPicksStaleLogic.ts@@ -34,6 +34,7 @@ import type {VisionQuotaApi,HighlightFeedItemApi,} from '../generated/api.schemas'+import { type RecordingsBlock, replayRecordingsLogic } from '../logics/replayRecordingsLogic'import { visionQuotaLogic } from '../logics/visionQuotaLogic'import { visionScannersListLogic } from '../logics/visionScannersListLogic'import { HighlightFeedEmptyReason, resolveHighlightFeedEmptyReason } from './highlightFeedEmptyState'@@ -75,6 +76,7 @@ export interface HighlightPicksStaleLogicProps {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface highlightPicksStaleLogicValues {picks: HighlightFeedItemApi[] | null // highlightPicksLogic+ recordingsBlock: RecordingsBlock | null // replayRecordingsLogiccurrentTeam: TeamPublicType | TeamType | null // teamLogiccurrentTeamId: number | null // teamLogicquota: VisionQuotaApi | null // visionQuotaLogic@@ -261,7 +263,7 @@ export interface highlightPicksStaleLogicMeta {blockReason: (scanners: ReplayScannerApi[],quota: VisionQuotaApi | null,- currentTeam: TeamPublicType | TeamType | null+ recordingsBlock: RecordingsBlock | null) => HighlightFeedEmptyReasonstaleReason: (picks: HighlightFeedItemApi[] | null,@@ -299,6 +301,8 @@ export const highlightPicksStaleLogic: LogicWrapper<highlightPicksStaleLogicType['scanners'],visionQuotaLogic,['quota'],+ replayRecordingsLogic,+ ['recordingsBlock'],highlightPicksLogic(props),['picks'],],@@ -463,18 +467,13 @@ export const highlightPicksStaleLogic: LogicWrapper<highlightPicksStaleLogicTypeselectors({blockReason: [- (s) => [s.scanners, s.quota, s.currentTeam],+ (s) => [s.scanners, s.quota, s.recordingsBlock],(scanners: ReplayScannerApi[],quota: VisionQuotaApi | null,- currentTeam: TeamPublicType | TeamType | null+ recordingsBlock: RecordingsBlock | null): HighlightFeedEmptyReason =>- resolveHighlightFeedEmptyReason({- scanners,- quota,- sessionRecordingOptIn: currentTeam?.session_recording_opt_in ?? null,- hasFeedFilters: false,- }),+ resolveHighlightFeedEmptyReason({ scanners, quota, recordingsBlock, hasFeedFilters: false }),],staleReason: [(s) => [s.picks, s.blockReason, s.droughtScannerIds, s.now],diff --git a/products/replay_vision/frontend/replay_scanners/newScanner.ts b/products/replay_vision/frontend/replay_scanners/newScanner.tsindex 423b3fbf38a4..5c4e00ce1b72 100644--- a/products/replay_vision/frontend/replay_scanners/newScanner.ts+++ b/products/replay_vision/frontend/replay_scanners/newScanner.ts@@ -46,6 +46,7 @@ export function newScanner(teamName?: string | null): ScannerFormValues {dashboard_id: null,dashboard_suggested: false,filter_error: null,+ unrunnable_reason: null,} as constreturn {diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.tsindex 0746f82cb889..782d09f3d411 100644--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.test.ts@@ -1434,6 +1434,32 @@ describe('replayScannerLogic', () => {expect(editLogic.values.originalScanner).toMatchObject(running)expect(editLogic.values.turningOffFreeOnly).toBe(false)})++ it('turning a blocked scanner on takes the saved blocker and creator, not just the flag', async () => {+ const newCreator = {+ id: 99,+ uuid: 'taker',+ distinct_id: 'taker',+ first_name: 'Taker',+ email: '[email protected]',+ }+ useMocks({+ patch: {+ '/api/projects/:team/vision/scanners/:id/': () => [+ 200,+ { ...loadedScanner, enabled: true, unrunnable_reason: null, created_by: newCreator },+ ],+ },+ })+ await expectLogic(editLogic, () => editLogic.actions.loadScanner()).toFinishAllListeners()+ editLogic.actions.setScannerValues({ enabled: false, unrunnable_reason: 'creator_lost_access' })+ await expectLogic(editLogic, () => editLogic.actions.toggleEnabled()).toDispatchActions([+ 'toggleEnabledSuccess',+ ])+ const runnable = { enabled: true, unrunnable_reason: null, created_by: newCreator }+ expect(editLogic.values.scanner).toMatchObject(runnable)+ expect(editLogic.values.originalScanner).toMatchObject(runnable)+ })})describe('buildObservationListParams', () => {diff --git a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.tsindex 17fc73087e9f..8be891e0c1bf 100644--- a/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts+++ b/products/replay_vision/frontend/replay_scanners/replayScannerLogic.ts@@ -511,6 +511,12 @@ export interface CreditLimitState {}/** The fields a free-only change moves, copied from the saved scanner so the status updates without a reload. */+function enabledFields(+ saved: ReplayScannerApi+): Pick<ReplayScannerApi, 'enabled' | 'unrunnable_reason' | 'created_by'> {+ return { enabled: saved.enabled, unrunnable_reason: saved.unrunnable_reason, created_by: saved.created_by }+}+function freeOnlyFields(saved: ReplayScannerApi): Pick<ReplayScannerApi, 'free_only' | 'limit_reached' | 'limit_from_free_credits' | 'credits_used_against_limit'> {@@ -912,8 +918,8 @@ export interface replayScannerLogicActions {toggleEnabledFailure: () => {value: true}- toggleEnabledSuccess: (enabled: boolean) => {- enabled: boolean+ toggleEnabledSuccess: (saved: ReplayScannerApi) => {+ saved: ReplayScannerApi}touchScannerField: (key: string) => {key: string@@ -1076,7 +1082,7 @@ export const replayScannerLogic = kea<replayScannerLogicType>([loadObservationStatsSuccess: (stats: ObservationStatsApi) => ({ stats }),loadObservationStatsFailure: true,toggleEnabled: true,- toggleEnabledSuccess: (enabled: boolean) => ({ enabled }),+ toggleEnabledSuccess: (saved: ReplayScannerApi) => ({ saved }),toggleEnabledFailure: true,turnOffFreeOnly: true,turnOffFreeOnlySuccess: (saved: ReplayScannerApi) => ({ saved }),@@ -1452,7 +1458,7 @@ export const replayScannerLogic = kea<replayScannerLogicType>([loadScannerSuccess: (_, { scanner }) => scanner,// Keyed on the real save, not submitScannerSuccess — kea-forms fires that on the no-API advance path too.scannerSaved: (_, { scanner }) => scanner,- toggleEnabledSuccess: (state, { enabled }) => (state ? { ...state, enabled } : state),+ toggleEnabledSuccess: (state, { saved }) => (state ? { ...state, ...enabledFields(saved) } : state),turnOffFreeOnlySuccess: (state, { saved }) => (state ? { ...state, ...freeOnlyFields(saved) } : state),// Self-driving changes the prompt the model gets, so the backend bumps the version with it.turnOnSelfDrivingSuccess: (state, { scannerVersion, updatedAt }) =>@@ -2621,7 +2627,9 @@ export const replayScannerLogic = kea<replayScannerLogicType>([actions.toggleEnabledFailure()return}- actions.toggleEnabledSuccess(next)+ // Turning on can take the scanner over, which clears its blocker and changes its creator.+ actions.setScannerValues(enabledFields(saved))+ actions.toggleEnabledSuccess(saved)refreshVisionQuota()lemonToast.success(`Scanner ${next ? 'enabled' : 'disabled'}`)} catch (error: any) {diff --git a/products/replay_vision/frontend/replay_scanners/scannerCopy.ts b/products/replay_vision/frontend/replay_scanners/scannerCopy.tsindex 6ff8c9f2afd4..64968833b4ba 100644--- a/products/replay_vision/frontend/replay_scanners/scannerCopy.ts+++ b/products/replay_vision/frontend/replay_scanners/scannerCopy.ts@@ -1,3 +1,5 @@+import type { UnrunnableReasonEnumApi } from '../generated/api.schemas'+/** Shared by every "Limit reached" badge so the surfaces tell one story. */const LIMIT_REACHED_TOOLTIP ='This scanner stopped scanning until its credit limit resets at the start of the next billing period. ' +@@ -20,3 +22,8 @@ export function stoppedByFreeCredits(scanner: LimitFields): boolean {export function limitReachedTooltip(scanner: LimitFields): string {return stoppedByFreeCredits(scanner) ? FREE_CREDITS_USED_TOOLTIP : LIMIT_REACHED_TOOLTIP}++export const UNRUNNABLE_DETAIL: Record<UnrunnableReasonEnumApi, string> = {+ no_ai_consent: "Your organization hasn't allowed AI analysis of recordings, so this scanner can't run.",+ creator_lost_access: "The person who created this scanner can no longer view recordings, so it can't run.",+}diff --git a/products/replay_vision/frontend/replay_scanners/scannerStatus.test.ts b/products/replay_vision/frontend/replay_scanners/scannerStatus.test.tsindex 6f1e46d7b7ad..27f608bcfc75 100644--- a/products/replay_vision/frontend/replay_scanners/scannerStatus.test.ts+++ b/products/replay_vision/frontend/replay_scanners/scannerStatus.test.ts@@ -17,6 +17,7 @@ const HEALTHY: ScannerStatusFields = {created_at: '2026-05-01T00:00:00Z',last_swept_at: NOW.subtract(40, 'minute').toISOString(),filter_error: null,+ unrunnable_reason: null,}const DROUGHT = { everScanned: true, samplingRate: 1 }@@ -39,6 +40,31 @@ describe('scannerStatus', () => {'limit_reached',],['stopped when the org quota is used up', {}, { quotaExhausted: true }, 'quota_exhausted'],+ [+ 'replay off ahead of the limits it makes moot',+ { limit_reached: true },+ { quotaExhausted: true, recordingsBlock: 'replay-off' as const },+ 'replay_off',+ ],+ ['off wins over replay being off', { enabled: false }, { recordingsBlock: 'replay-off' as const }, 'off'],+ [+ 'missing AI consent explains an off scanner',+ { enabled: false, unrunnable_reason: 'no_ai_consent' as const },+ { recordingsBlock: 'replay-off' as const },+ 'no_ai_consent',+ ],+ [+ 'a creator who lost access explains an off scanner',+ { enabled: false, unrunnable_reason: 'creator_lost_access' as const },+ {},+ 'creator_lost_access',+ ],+ [+ 'no recordings instead of blaming the filters',+ {},+ { drought: DROUGHT, recordingsBlock: 'no-recordings' as const },+ 'no_recordings',+ ],['filter error ahead of the delay it causes',{ filter_error: 'Unable to resolve field: event', last_swept_at: NOW.subtract(3, 'hour').toISOString() },diff --git a/products/replay_vision/frontend/replay_scanners/scannerStatus.ts b/products/replay_vision/frontend/replay_scanners/scannerStatus.tsindex 6eb3cbea7d28..f1113835afde 100644--- a/products/replay_vision/frontend/replay_scanners/scannerStatus.ts+++ b/products/replay_vision/frontend/replay_scanners/scannerStatus.ts@@ -1,6 +1,7 @@import { Dayjs, dayjs } from 'lib/dayjs'import type { VisionQuotaApi } from '../generated/api.schemas'+import type { RecordingsBlock } from '../logics/replayRecordingsLogic'import type { ScanDrought } from './scanDrought'import type { ReplayScanner } from './types'@@ -13,7 +14,11 @@ const DELAYED_GRACE_MINUTES = 60const STARTING_MAX_AGE_MINUTES = 60export type ScannerStatus =+ | { kind: 'no_ai_consent' }+ | { kind: 'creator_lost_access' }| { kind: 'off'; reason: 'disabled' | 'no_sampling' }+ | { kind: 'replay_off' }+ | { kind: 'no_recordings' }| { kind: 'limit_reached'; free_only: boolean; credit_limit: number | null; limit_from_free_credits: boolean }| { kind: 'quota_exhausted' }| { kind: 'filter_error'; message: string }@@ -35,20 +40,37 @@ export type ScannerStatusFields = Pick<| 'created_at'| 'last_swept_at'| 'filter_error'+ | 'unrunnable_reason'>/** The one status the scanner page leads with. Earlier checks win, so a scanner that is off never also reads as stopped. */export function scannerStatus(scanner: ScannerStatusFields,- options: { quotaExhausted: boolean; drought: ScanDrought | null; now?: Dayjs }+ options: {+ quotaExhausted: boolean+ drought: ScanDrought | null+ recordingsBlock?: RecordingsBlock | null+ now?: Dayjs+ }): ScannerStatus {const now = options.now ?? dayjs()+ // The sweep turns these scanners off itself, so the blocker explains the state better than "Off" does.+ if (scanner.unrunnable_reason) {+ return { kind: scanner.unrunnable_reason }+ }if (!scanner.enabled) {return { kind: 'off', reason: 'disabled' }}if (scanner.sampling_rate === 0) {return { kind: 'off', reason: 'no_sampling' }}+ // With no recordings coming in, every check below would blame the scanner for a project-wide gap.+ if (options.recordingsBlock === 'replay-off') {+ return { kind: 'replay_off' }+ }+ if (options.recordingsBlock === 'no-recordings') {+ return { kind: 'no_recordings' }+ }if (scanner.limit_reached) {return {kind: 'limit_reached',diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex f4024697ec1d..5b0fa13c6a1b 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -79754,6 +79754,14 @@ export namespace Schemas {Google: 'google',} as const;+ export type UnrunnableReasonEnum = typeof UnrunnableReasonEnum[keyof typeof UnrunnableReasonEnum];+++ export const UnrunnableReasonEnum = {+ NoAiConsent: 'no_ai_consent',+ CreatorLostAccess: 'creator_lost_access',+ } as const;+/*** A Replay Vision scanner: its type, targeting query, and AI configuration.*/@@ -79885,6 +79893,8 @@ export namespace Schemas {* @nullable*/readonly filter_error: string | null;+ /** Why the scanner can never run, or null when it can. `no_ai_consent`: the organization has not approved AI data processing. `creator_lost_access`: the creator can no longer view recordings, which the sweep reads as them, so turning the scanner on requires `take_over_as_creator`. The sweep turns an enabled scanner off when either applies. */+ readonly unrunnable_reason: UnrunnableReasonEnum | null;readonly created_at: string;/** User who created the scanner. */readonly created_by: UserBasic | null;@@ -92726,6 +92736,8 @@ export namespace Schemas {* @nullable*/readonly filter_error?: string | null;+ /** Why the scanner can never run, or null when it can. `no_ai_consent`: the organization has not approved AI data processing. `creator_lost_access`: the creator can no longer view recordings, which the sweep reads as them, so turning the scanner on requires `take_over_as_creator`. The sweep turns an enabled scanner off when either applies. */+ readonly unrunnable_reason?: UnrunnableReasonEnum | null;readonly created_at?: string;/** User who created the scanner. */readonly created_by?: UserBasic | null;