: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(signals): collapse the Slack and MCP sections in scout settings (#95632)
posthog[bot]9359caab1827
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex d0a773147c74..127c2765d451 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -3923,11 +3923,11 @@ snapshots:lemon-ui-lemon-collapse--multiple--dark:hash: v1.k794b7964.4462c0cbad15c93575eef989f09a07123a30accef28115a6db76d85f7a685fca.iFtkuJTUHhBmm_w6RttTh2xeiVFOdC7PfrrvudBOPGslemon-ui-lemon-collapse--multiple--light:- hash: v1.k794b7964.54f71dfee1fbb2a9afa20af708a9023eabe86cb4bc91ae4a0223ea118e7b9dc0.soIQ4Scg_IrWwGvzGi9o4iU95PVZdgIpU66ZlA__i7A+ hash: v1.k794b7964.dfbed51189605f1fc9ee4c32ea56b8f13f8733a41e31b3403e8bad24ebb87d64.29T7QtXkZ29Cyy40SP6q6cgpWEkfQ77322use5XtoVYlemon-ui-lemon-collapse--single--dark:hash: v1.k794b7964.65ef796c86e1ddd6ee7cd18d9ebde0417033722f605050294c2dcfaccc3e0393.fPuKRoyoEQctZqi4P7fahjCcw9PmwwEk7gqo4koN270lemon-ui-lemon-collapse--single--light:- hash: v1.k794b7964.0e9dde2fc48bc6cf8ee5a584d1340b4fb7292fcf6fa6cd89f6414190d05f8b19.aWICU3W9G-h3WUcc1m9YOeUW-Um02Lu-al1v6FJFOB8+ hash: v1.k794b7964.81081969524af21fafed643be74990973c85259a9762be86708f37dd27f17c9f.AQv8vtGka6ajW9SIwAEgDiYO8l8yzXqNBZoOQdHBrjIlemon-ui-lemon-collapse--small--dark:hash: v1.k794b7964.cb841264bbaa26a08e3d89e34274e7c9a253a20caf1c406a28c76762d9fb433a.MuAEbxBgmkqbbHYyg0jc0KFajNySota7ixjh6offdcIlemon-ui-lemon-collapse--small--light:@@ -6035,23 +6035,23 @@ snapshots:scenes-app-ai-observability-instrumentation-checklist-card--collecting--dark:hash: v1.k794b7964.6f9f209d5daaf8573020fb50615421d426055c8090d0ee73a2629487d30cbf29.g4iTGpNCX68yiOgdFhRMYO2xEGf0WhTu4ji2Rqijrocscenes-app-ai-observability-instrumentation-checklist-card--collecting--light:- hash: v1.k794b7964.5b59fa66c967caa25a3b42447aef2a9cc28e7a7297f68bf2c6ef52f93868340b.Vu-uZ6ASRxq7Xtww0upiQBEtM7K4W8bW1n2NbiZzAlY+ hash: v1.k794b7964.b0e06944ee7afe4af8cb39363280135111e71ba215aab56a3e410c79de62238b.Cw3SVye0_xUZTothUmT5zmq0IshhT3Ri8CwOWNGIZBMscenes-app-ai-observability-instrumentation-checklist-card--first-load--dark:hash: v1.k794b7964.6f9f209d5daaf8573020fb50615421d426055c8090d0ee73a2629487d30cbf29.TYHHCod2JSAu1qqe-WenUDbqhn0YlDo5gRGxTyanWocscenes-app-ai-observability-instrumentation-checklist-card--first-load--light:- hash: v1.k794b7964.5b59fa66c967caa25a3b42447aef2a9cc28e7a7297f68bf2c6ef52f93868340b.Ecas14W8dqnPe5sx8n14DBpWhPgJlRnmlhunbzkynfQ+ hash: v1.k794b7964.b0e06944ee7afe4af8cb39363280135111e71ba215aab56a3e410c79de62238b._XQ_EnUwobzEsnefgACx1168-6QTB2FjoX8QSbRxrYYscenes-app-ai-observability-instrumentation-checklist-card--passing--dark:hash: v1.k794b7964.6f9f209d5daaf8573020fb50615421d426055c8090d0ee73a2629487d30cbf29.3G8C6lRoRMCOFPTyHUc1fUVrQ9SWQSBU5GDHVxfxkK0scenes-app-ai-observability-instrumentation-checklist-card--passing--light:- hash: v1.k794b7964.5b59fa66c967caa25a3b42447aef2a9cc28e7a7297f68bf2c6ef52f93868340b.c-ITenm00lDNHO7YfYrQTyOgaWKwNMXQimGkVuPBJoo+ hash: v1.k794b7964.b0e06944ee7afe4af8cb39363280135111e71ba215aab56a3e410c79de62238b.TntScnC00SlYEHWU1ke1Di_m6dlwXme7akOY4GEDWtsscenes-app-ai-observability-instrumentation-checklist-card--warnings--dark:hash: v1.k794b7964.6f9f209d5daaf8573020fb50615421d426055c8090d0ee73a2629487d30cbf29.U5AhEdEUppDlS_0j56Kjpl4cQqLYrXk-auBMToD6KV0scenes-app-ai-observability-instrumentation-checklist-card--warnings--light:- hash: v1.k794b7964.5b59fa66c967caa25a3b42447aef2a9cc28e7a7297f68bf2c6ef52f93868340b.rtL19Q--FVLDDrBkmW1rNs9WmUOnseaz8nFeCHl6xEw+ hash: v1.k794b7964.b0e06944ee7afe4af8cb39363280135111e71ba215aab56a3e410c79de62238b.4ZIDvyPB_XDQiLQh2GjcfXzdT5hvm7WrVFwKhvgiT90scenes-app-ai-observability-instrumentation-checklist-card--warnings-with-a-dismissal--dark:hash: v1.k794b7964.6f9f209d5daaf8573020fb50615421d426055c8090d0ee73a2629487d30cbf29.stsWopH6BI50ASXjhDxCWn-Xa46oqy_cH4v0xAO4VIQscenes-app-ai-observability-instrumentation-checklist-card--warnings-with-a-dismissal--light:- hash: v1.k794b7964.5b59fa66c967caa25a3b42447aef2a9cc28e7a7297f68bf2c6ef52f93868340b.VU8b650GOEljJTYfBvHHLbvSMPSS35X5ZJzE63xAv6M+ hash: v1.k794b7964.b0e06944ee7afe4af8cb39363280135111e71ba215aab56a3e410c79de62238b.WtW8suUOWanaTrvjxhV2Z_ANVDRmEW3bqHpTrTe5GoIscenes-app-ai-observability-prompts--empty-state--dark:hash: v1.k794b7964.3881018cfbf85cf1beed0dd610d747267571381277a983c7b8239acc5d372b86.yIUKSXpWrhD6XV_uZ1Sk-kb3tJbbBLfdcYML7kWkw40scenes-app-ai-observability-prompts--empty-state--light:@@ -6523,7 +6523,7 @@ snapshots:scenes-app-data-management-actions--action--dark:hash: v1.k794b7964.00b57c65346e514c9454e88054c04eb8aef6f1093d64fdc46cbbef3604e7f2d6.89yiroC6COFhV4T8jtCoYYdBQat6ZW24vyN_AW3GRTIscenes-app-data-management-actions--action--light:- hash: v1.k794b7964.beb09296b4cd231bcc6b8067b8976e50e541095f18ec43f4523349ca0efc89a4.dEJitejN7lJT0FU6gQAaF5ydaZd_RGES2jbQNI4WuDw+ hash: v1.k794b7964.01991f5b587ce8b67319035310436131bdc75c0a13959fe581d282029b14c84f.gOBOxAz7KA0qJWzxJDdwKKsqAGfzX9anWCouWgYrpwMscenes-app-data-management-actions--actions-list--dark:hash: v1.k794b7964.bd5168e579fa746d3f0fe22cd50e94e879f638b594e39b93ed3cbf329d797045.t0zAJGmPzUfxAEBp7io3QgPwzbXoekfensWiOF3PmVoscenes-app-data-management-actions--actions-list--light:@@ -6531,11 +6531,11 @@ snapshots:scenes-app-data-management-actions--new-action--dark:hash: v1.k794b7964.ba971e6b4e8a8e72c512b1edc53fc699eff7142f207aed6e1d22e4cc79d18c9c.WK1mMQL1L81fqQ7rDdXG0tr5I9kdtzLDkznyHOd7bN8scenes-app-data-management-actions--new-action--light:- hash: v1.k794b7964.63452e5f18d10890adc95905388cc73a7139ebeb10c19eeace75a7da0e2debec.qpdIi0uow-kdQvBB0FNLFB-yXrl-xNgCWFuohl_l3z0+ hash: v1.k794b7964.1f645c933009b0be73528f04ff97cf4f098f956a8e9b394e24330947519e165c.GaYMgqk5vdu3_IKK85vXoyu57VCAD1OFAxU6cJwq_-kscenes-app-data-management-actions--screen-action--dark:hash: v1.k794b7964.a7d45c674c8c2c5b4a953da0a6edc035c483190477dae0d543c1b6b2b1a6cf85.eslQPw_7Y7zBCu9G7OoVbBuAzSA-bqUoje0pbZUki6Qscenes-app-data-management-actions--screen-action--light:- hash: v1.k794b7964.39d810c27996398aae992eb54ef4e84e23c3f53c4812346e1931563a4c1ee0cf._NpDegv8HN4WQn2IpzgYw9J0f6Lc1kTMckTXMi6llq0+ hash: v1.k794b7964.e1aa47cc899a55d9dbb81ab75b9359f0dbccc5b7e13d97788a4f425eebb564c3.1-xT7t4rwCttUwS4xNKzAG3aGXNBR6O5wXuui1lJ8R8scenes-app-data-management-comments--comments--dark:hash: v1.k794b7964.e21cefe38419260e81d5eda7e10656d10d1eff95ee3c0445c8a0b9be07b79086.PePuIy_3nZEV8tVawLvzhj85hMz3DwVUBpP0ggnCqeAscenes-app-data-management-comments--comments--light:@@ -6713,7 +6713,7 @@ snapshots:scenes-app-data-warehouse-settings-schemas--default--light:hash: v1.k794b7964.62abbaebed2e50cc731d2816d8ff2ffd75665676c1d448039b77697b11cfda3d.yhKMeKZR4Sv4nIaEdQNjBtd1fGZhog5pIDHUUPJZlaUscenes-app-data-warehouse-settings-schemas--multi-schema--dark:- hash: v1.k794b7964.a1f856f6850f014c67d316b6b991f7d22c6926162d98821b08381551ebb0210a.LckDFFHZtedM5hRnsCZUyHAPWA4_QRjE0RGlh39_65M+ hash: v1.k794b7964.22840c30d80b9e1a3bd41d5a31af2ab81a54d9f90fb82d540fb9494b44cda050.oC_UUgUXZVqKMZ6LuInaQADAzqeWAvw2dZ8T5eENhIQscenes-app-data-warehouse-settings-schemas--multi-schema--light:hash: v1.k794b7964.e5d678194a8e191fdf4f8a92cd7328f1e3cb162a81d3c4d05ef608f3c61537da.ZshlecoDn8CpsaVHaONi7UiXq8r-Xi4zJSWKeg7nAP0scenes-app-data-warehouse-sql-editor--managed-warehouse-connection--dark:@@ -7421,33 +7421,37 @@ snapshots:scenes-app-inbox-scene--triage--light:hash: v1.k794b7964.ea1f0a1a3cd9c029a33e39277a276be15a04555ba2addee17df2aacb108316dc.CFYN_7EjRWTlSCsBQMuZ6Bq_ViTyRy7_RqqtqKfg05wscenes-app-inbox-scoutconfigform--custom-cron-schedule--dark:- hash: v1.k794b7964.710f629fd43594de384d7da9bf5e972eb67784a6027fa051a4c7c16231a42fa3.6zVJ70OCR4ISZL7fSny3AwE1-ySkXsJgBOhEaCb46tE+ hash: v1.k794b7964.7de0320249ecdd4b0cd91db5eea2327330d1beefcaacfb24214c7bb3426465eb.SRvP04SWHH7ip5pVK7ciSGitpQc4cWAXXWSX-WCdzsAscenes-app-inbox-scoutconfigform--custom-cron-schedule--light:- hash: v1.k794b7964.79844f18e768b4da770a547e49a2e47b6e243089af719d26cdda0e665fa47ab8.1sP7keEyvErr-gdyk7bjEo0vqjhd6Fip6oKXKODMioM+ hash: v1.k794b7964.72a98b8df13616a9a196b924716f8a6fe9d41b6c5857e6b0655c2ce93667c66f.5Cycqcc795gyqumSF2ZTNlPTcxDH9mWoAr32VED43OEscenes-app-inbox-scoutconfigform--disabled--dark:- hash: v1.k794b7964.45bf80e76c6f9f64f70fdb73e39e4887d434af8a7b49ae27e68249fc96ea4c94.0KWEn_DUJy7e1OVgi-6Pn7jVimpyKV6BMwzObvYwAFU+ hash: v1.k794b7964.d2338bc8c7756703513f837c8ffc5d69fd006e9db002e3cd9bb1304fe3a43fa6.448oDboN2xSL7iuQSIFyoPwPG-3OX5MhSGm9s9N9Cwoscenes-app-inbox-scoutconfigform--disabled--light:- hash: v1.k794b7964.59d91d077fc830a93efe84998f60b37a1a20760dde69c6a8d0f92422b308c860.xsyzlASEpqu8f_tLCQIXMJn3JEWg3Ka8awXe1q39f1s+ hash: v1.k794b7964.4b933ee0e1f9cb96d270ad4a859ba7d0d76afc0c0fb72e8745060a864a984fd9.0pJU5OrhI-CRByw7I_GSv0v-khCo5If7Vv_AK0jzpz0scenes-app-inbox-scoutconfigform--dry-run--dark:- hash: v1.k794b7964.84c138ddecb2d09017546b1ea34cda28a949a7151eced51595e302c334958f57.UkqAe7l364Q6DfZrFrFft2EM1j4vrVMUqHAd0JZTuuo+ hash: v1.k794b7964.05f4a058c8cfa853c801e20827c43e6fd0b6c8c37030cf43ac5b477ca2e9f9aa.nqQrUiJiX2EfFSKuY2c1wvK3x4imvuxUqpoUdc_d2SMscenes-app-inbox-scoutconfigform--dry-run--light:- hash: v1.k794b7964.7ea868058af152d90b3d566a7839f30f48528524cf216e1be597a9726d1252bc.0eenbFD7przUwR8a1ZnKmOP-r0RezoEW3nTlJiqFx7M+ hash: v1.k794b7964.47217ed771ca354538a47457015c1e3b2379fb9777c9d649a46bea4cf75c77fa.x0Va3ZLcSbPeSWH38mdSN8TfgqG_E3eW7QX64KluFTUscenes-app-inbox-scoutconfigform--live--dark:- hash: v1.k794b7964.31a75df9896a00491896d3b025cc3cae4975b7984c80ef66311011b76bc4e6b9.xaW7BvBA50R9K93vEmCYIsGxtw7V-rwecMcHXcf8F8Y+ hash: v1.k794b7964.2254c4f20c124353232ff16e95b9521f904755a95919ec143fd90f693dc07e10.jo-O3P1pMMrdY4mjlkea-I70otIvGUWzPBaZl5489h4scenes-app-inbox-scoutconfigform--live--light:- hash: v1.k794b7964.fa5b9fb262974ec0e598bce13dca3cd2bdb7665fe36e02b6beb3932c372b6a2d.4pRjy2pH6q9xhl5RUhnkUBfj7AleTLep2kOyhfj3Jpc+ hash: v1.k794b7964.abfdf04f449a5db73cabbafabaeacde830f66207858f6fa5b136aa2b8588887b.J_7SLtlKbFxcobP0FgsutwXl8Byl6hDI480O1Ybm4A4+ scenes-app-inbox-scoutconfigform--slack-channel-destination--dark:+ hash: v1.k794b7964.c4dfd41902e4bdf270978e5b33afee6000dd8a0f1372895eee5d6804361db289.uQX6RzVXbBvw6Pvi7hNZOqCDqPuaVCd8JQGw6eeHXaA+ scenes-app-inbox-scoutconfigform--slack-channel-destination--light:+ hash: v1.k794b7964.1e8d0ca3b4fac78bd34d83c563bea98883d850bf09b469840bd6f24a0cb4ccc5.dMdTjzPGpj1ZOTq96YB1_oyzsniljV5noz3kWHEd2YQscenes-app-inbox-scoutconfigform--weekly-schedule--dark:- hash: v1.k794b7964.fc2822b7d7186c7f0f7eccc2c7134b70aea363060c36524d20a3ac4af8a795c1.TXoW31nQ2x8rjtUeYn6BLF77pNBtTW_Ks5RTeyASjAU+ hash: v1.k794b7964.e9a1cd20e5412b583cf614d164efd96d78087779d49fe6c8bb722ba6765102c6.sZivNSlRdhLYc8CY0SVelWu6swaLkvai_KCpasuN7tcscenes-app-inbox-scoutconfigform--weekly-schedule--light:- hash: v1.k794b7964.ba7a9fd83e93228306e182af9edbf2b3ed6983e6c9bcd2e6d032733339d7f8c4.7uu1q1x2JMWHOnPYLpc0rhf4j04ntW-jtxaqiPPbS8E+ hash: v1.k794b7964.b305519fa776432d2e8d1686d536e09782a66f217c75ce2b37038343e3b8cef8.Rug7RUaqdbIMdQ1ra_OhS6bzMQJ6f-AIjdbTEJCeHmoscenes-app-inbox-scoutmcpserverspicker--create-dialog-variant--dark:hash: v1.k794b7964.afe2203f4dd53373a3203fcfa611b5b65555341bdc2fc7fd73c15c2d83914600.O4kSRnOgICuQDkyD2HJCwBXdzE-KwsfzWT98nm43_5Ascenes-app-inbox-scoutmcpserverspicker--create-dialog-variant--light:hash: v1.k794b7964.52ea24b706c17b6194aa901ede7083b98628a47b85893fa67fea5060e27aae0c.-CvgHcWxOm0IRQxBZw2wgeHd3sAcJn4jfgdkqmxpt9wscenes-app-inbox-scoutmcpserverspicker--scout-settings-variant--dark:- hash: v1.k794b7964.cb0a021303b103cdcd037db93be44c2c5eae3e59494ab8a726ac8e430f631dfd.n4BzfjRbtrkqXUS8HZwDAYrPQHYDeqCHuny9Z4Oz134+ hash: v1.k794b7964.53010a7a3437924fd184d73b4320064ad38ffd44ef81d160604dac1e12c5e88a.Y92n1b56b5bA7f-bfG359ksnUgXFr1x94Ot5CKSn64gscenes-app-inbox-scoutmcpserverspicker--scout-settings-variant--light:- hash: v1.k794b7964.2f1013abc412adb4544bca6a00209d3051c46969db69d4242ab201ecf5d189f3.YVfbrzpaRzPwuCbeFXmaVOLla0fvhHmAm1CkuaKWCLI+ hash: v1.k794b7964.459dec9ec804a32a9e6657c2af968643cb4aaed8abd8c9c7690e5c94f2a8b74d.LAxByndCg2pW4lOYdczYQlXFIdF1lw1vOkAdY0uP-S0scenes-app-inbox-scoutowners--states--dark:hash: v1.k794b7964.2ee1d4942c7c04c494fc25af3d73031dd26190ecca1ecdf02f5b0c21751d3084.WJ8hfD7b6hZxiBmCQ_k4Wx9LrTXdLrk39-Kau-gMIJUscenes-app-inbox-scoutowners--states--light:@@ -8853,13 +8857,13 @@ snapshots:scenes-app-support-threadreportentry--several-reports-across-states--light:hash: v1.k794b7964.ec55e023b31b2a327072c0e9fe3b164f74d81a226aa3efae9d6fe79d98db5da6.R5v-7fBBPhhayu8hBAHgU6eyTieyIbMYD3ewFUeP_Voscenes-app-surveys--new-multi-question-survey-section--dark:- hash: v1.k794b7964.2ca7cfe8058d9bb074e60e795308ce170bba030323193c9aa1d9bf15230dcdd2.nabqRm_sKv773DVOxobE7ALkDaOTsvsM0VV7h_vbg80+ hash: v1.k794b7964.f1587352973fbb7df0437cfdbfbaa542471fc17044e083be0e4efad7647bbbfe.RMYkIsFv05--LXj0yuYuDLg5-_bX6Ucy9iUMuY6kaYwscenes-app-surveys--new-multi-question-survey-section--light:hash: v1.k794b7964.ad5861ea909368188bb3fec2edfddf542bfb31230e9bdcdbd7f993ea42885d23.Ych93ianW7eWaE-_7KUOaJTKhoW4jS34LwLcqIP0ncAscenes-app-surveys--new-survey--dark:- hash: v1.k794b7964.2a148d3140b9d56f9a2a1c790306f14227c5a3d744c8f884ea5091ddec40eff0.tL6oOWHzANfwva7tgjQ_MSZ5eyh7bocfKZ5wWu7dgdA+ hash: v1.k794b7964.743d7e70837c5888369cfee589f3f0eec882ecdf6432afed3f4f9f7d232c01df.QPoGwmId8jidosxDszIf3KWG547h_uoj60OZ4OYYl4gscenes-app-surveys--new-survey--light:- hash: v1.k794b7964.5139a48ccd5c3055b230e3090a598b559b4527978db4a252de14fac7f5840b01.BWRtjm-hAperWfkUHoGDhRv2bFoZdkJlU06XzkPupww+ hash: v1.k794b7964.0e5ca7513ec62ac7c98b9a595efd4ea8ca5eebf20eb3e5c05133de7d3b2349b4.5AkPKR-R64le1ar72ys-xshuTbCyLPZ5UMBYUjU5Ofkscenes-app-surveys--new-survey-customisation-section--dark:hash: v1.k794b7964.d4210b609a372ab27d92150c27a4b1384ec949650beb560dde9d01a947daaa19.dB_p0daXC7_Q2cnpwGqdoStHKPIauujl3wE1WBpAc5Qscenes-app-surveys--new-survey-customisation-section--light:@@ -8869,13 +8873,13 @@ snapshots:scenes-app-surveys--new-survey-targeting-section--light:hash: v1.k794b7964.751f6cd96d51519b47dcd64f7b6c9f24cc71a17acd3290bd3b4fe8acd25cb0b0.VT2rnqmAvRpIAW1jIZg-k2ZZeN153-8GZj-nzYtxyuUscenes-app-surveys--new-survey-with-html-question-description--dark:- hash: v1.k794b7964.a574ed86e292ebc92b497686542327da0720d3ed1574c4a729d935bbe7877dd0.eqQXnqs8DOn2gZvkqXuppmNbOMx-y_73R2AJggWhbRc+ hash: v1.k794b7964.0a9a5c9f055991d3d19ca02f133bac354223a764592c7da6e051933d07b6e7fb.mFqOSdNOcD4d1UYg9nZqXp94CVuuxWd733Hl9iEsgqUscenes-app-surveys--new-survey-with-html-question-description--light:hash: v1.k794b7964.b74e0f2ebaac866fe89e4f263882124381d73c752f60d6c47deb66313238de90.By3dMrp1mkPzQeybSWmGytMVvrKcXikGhGqrOsIAxKwscenes-app-surveys--new-survey-with-text-question-description-that-does-not-render-html--dark:- hash: v1.k794b7964.b5c0785a4a4e24977f02827d2daadd37cae7b0b31ed3826db998940fd497cf1b.UdXETJ6sSCA061BgPz5FZThOOLVu1bko64wYSM7ojSE+ hash: v1.k794b7964.9cbe2779dc764884068e52cca5b2e51be9591e5c632a6344db75104c9ffbdb5b.zLU9nqfqK9nIStEuVCix_A_nuVyrsaiypdQmRJmpwy0scenes-app-surveys--new-survey-with-text-question-description-that-does-not-render-html--light:- hash: v1.k794b7964.330d7ebc3fa161e5a5407fe56558bae6751d79ba6a71fbde761c0a5e7f4d8ece.CFfpPARTbAs-YcF1dSkqHGTSDh4PjtO82En8zVk2Q80+ hash: v1.k794b7964.bdd6755a72ec571efaa9b38ef0bff6e87b78d504b254006a409f2114354d7afc.tu-CzwdxzR8jjFs-Eam3yR-MQDTaJGOSQFTevQSXczEscenes-app-surveys--survey-results--dark:hash: v1.k794b7964.593d9cfd1f47b2ff7296eb4d5e2e31be1636bd2a39a9b350b4c1b5e157684cbb.al8-igeJ8c_xg1N5V4_LD874kwxo1rnKFtrfQGu3daYscenes-app-surveys--survey-results--light:diff --git a/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx b/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsxindex f80dc212edbd..54a4ee49c128 100644--- a/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx+++ b/frontend/src/lib/lemon-ui/LemonButton/LemonButton.tsx@@ -33,6 +33,8 @@ export interface LemonButtonPropsBase| 'role'| 'aria-haspopup'| 'aria-pressed'+ | 'aria-expanded'+ | 'aria-controls'> {children?: React.ReactNodetype?: 'primary' | 'secondary' | 'tertiary'diff --git a/frontend/src/lib/lemon-ui/LemonCollapse/LemonCollapse.test.tsx b/frontend/src/lib/lemon-ui/LemonCollapse/LemonCollapse.test.tsxindex f4ce00bee57c..9febcc7d7687 100644--- a/frontend/src/lib/lemon-ui/LemonCollapse/LemonCollapse.test.tsx+++ b/frontend/src/lib/lemon-ui/LemonCollapse/LemonCollapse.test.tsx@@ -21,4 +21,21 @@ describe('LemonCollapse', () => {expect(within(container).getByText('Body')).toBeInTheDocument()})++ // The header button is the only focusable control, so a screen reader can only learn that the+ // panel hides content, and what it hides, from the button itself.+ it('states the panel state and the body it controls on the header button', () => {+ const { container, rerender } = render(<LemonCollapse panels={panels} />)+ const header = (): HTMLElement => container.querySelector<HTMLElement>('.LemonCollapsePanel__header')!++ expect(header()).toHaveAttribute('aria-expanded', 'false')+ expect(header()).not.toHaveAttribute('aria-controls')++ rerender(<LemonCollapse panels={panels} activeKey="only" />)++ expect(header()).toHaveAttribute('aria-expanded', 'true')+ const body = within(container).getByText('Body').closest('.LemonCollapsePanel__body')+ expect(body?.id).toBeTruthy()+ expect(header()).toHaveAttribute('aria-controls', body?.id)+ })})diff --git a/frontend/src/lib/lemon-ui/LemonCollapse/LemonCollapse.tsx b/frontend/src/lib/lemon-ui/LemonCollapse/LemonCollapse.tsxindex a6100f703b6f..e2ace3941398 100644--- a/frontend/src/lib/lemon-ui/LemonCollapse/LemonCollapse.tsx+++ b/frontend/src/lib/lemon-ui/LemonCollapse/LemonCollapse.tsx@@ -1,7 +1,7 @@import './LemonCollapse.scss'import clsx from 'clsx'-import React, { ReactNode, useEffect, useMemo, useRef, useState } from 'react'+import React, { ReactNode, useEffect, useId, useMemo, useRef, useState } from 'react'import useResizeObserver from 'use-resize-observer'import { IconCollapse, IconExpand } from '@posthog/icons'@@ -140,6 +140,7 @@ function LemonCollapsePanel({const { height: contentHeight, ref: contentRef } = useResizeObserver({ box: 'border-box' })const bodyRef = useRef<HTMLDivElement>(null)const { rendered, shown } = useAnimatedPresence(isExpanded, 200, bodyRef)+ const bodyId = useId()const { headerChildren, headerProps } = useMemo((): HeaderDefinition => {if (header && typeof header === 'object' && 'children' in header) {@@ -166,6 +167,12 @@ function LemonCollapsePanel({icon={isExpanded ? <IconCollapse /> : <IconExpand />}{...(dataAttr ? { 'data-attr': dataAttr } : {})}size={size}+ // The header button is the only focusable control, so the panel state has to+ // reach a screen reader from here. The wrapper below carries the same state for+ // CSS, where a non-focusable element is all a stylesheet needs.+ aria-expanded={isExpanded}+ // A closed panel unmounts its body, so point at it only while it exists.+ aria-controls={rendered ? bodyId : undefined}>{headerChildren}</LemonButton>@@ -183,6 +190,7 @@ function LemonCollapsePanel({{rendered && (<divref={bodyRef}+ id={bodyId}className={clsx('LemonCollapsePanel__body', bodyClassName)}// eslint-disable-next-line react/forbid-dom-propsstyle={{ height: shown ? contentHeight : 0 }}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.stories.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.stories.tsxindex a79cf41e0fef..67fd91f6d313 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.stories.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.stories.tsx@@ -3,6 +3,8 @@ import { useState } from 'react'import { FEATURE_FLAGS } from 'lib/constants'+import { mswDecorator } from '~/mocks/browser'+import type { SignalScoutConfigApi as SignalScoutConfig } from 'products/signals/frontend/generated/api.schemas'import { mockScoutConfigs } from '../../../__mocks__/scoutConfigs'@@ -59,3 +61,29 @@ export const WeeklySchedule: Story = {export const CustomCronSchedule: Story = {render: () => <EditableConfigForm initialConfig={{ ...mockScoutConfigs[0], run_cron_schedule: '0 9 * * 1-5' }} />,}++// A scout that posts into a Slack channel: the collapsed section names the channel, so where the+// output goes is readable without opening it. The workspace has to be mocked, or the header reports+// the saved channel as disconnected, which is what an unresolvable workspace means.+export const SlackChannelDestination: Story = {+ decorators: [+ mswDecorator({+ get: {+ '/api/environments/:team_id/integrations/': () => [+ 200,+ { results: [{ id: 1, kind: 'slack', display_name: 'PostHog', config: {}, errors: null }] },+ ],+ },+ }),+ ],+ render: () => (+ <EditableConfigForm+ initialConfig={{+ ...mockScoutConfigs[0],+ output_destinations: {+ slack: { integration_id: 1, channel: 'C123|#scout-alerts', thread_reports: true },+ },+ }}+ />+ ),+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.test.tsxindex 27637e008596..6cf167d394ea 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.test.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.test.tsx@@ -1,4 +1,4 @@-import { cleanup, render } from '@testing-library/react'+import { cleanup, fireEvent, render } from '@testing-library/react'import { useMocks } from '~/mocks/jest'import { initKeaTests } from '~/test/init'@@ -30,8 +30,11 @@ describe('ScoutCreateModal', () => {/>)- expect(await findByText('Slack destination')).toBeTruthy()- expect(await findByText('Connect a Slack workspace')).toBeTruthy()expect(await findByText('Tags')).toBeTruthy()++ // The destination section is collapsed, so its body only proves the section is wired up+ // once the header opens it.+ fireEvent.click(await findByText('Slack destination'))+ expect(await findByText('Connect a Slack workspace')).toBeTruthy()})})diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersPicker.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersPicker.test.tsxnew file mode 100644index 000000000000..c689578a1679--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersPicker.test.tsx@@ -0,0 +1,142 @@+import { MOCK_DEFAULT_USER } from 'lib/api.mock'++import '@testing-library/jest-dom'++import { cleanup, fireEvent, render, screen } from '@testing-library/react'++import { FEATURE_FLAGS } from 'lib/constants'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'++import { useMocks } from '~/mocks/jest'+import { initKeaTests } from '~/test/init'++import type { MCPServiceAccountServerApi } from 'products/mcp_store/frontend/generated/api.schemas'++import { ScoutMcpServersPicker } from './ScoutMcpServersPicker'++function server(id: string, name: string): MCPServiceAccountServerApi {+ return {+ id,+ shared_by: {+ id: MOCK_DEFAULT_USER.id,+ uuid: MOCK_DEFAULT_USER.uuid,+ email: MOCK_DEFAULT_USER.email,+ hedgehog_config: null,+ },+ scope: 'team',+ name,+ description: `${name} workspace`,+ url: `https://mcp.${name.toLowerCase()}.example.com/mcp`,+ icon_key: name.toLowerCase(),+ icon_domain: `${name.toLowerCase()}.com`,+ connection_state: 'ready',+ reachable: true,+ }+}++const SERVERS = [+ server('linear-id', 'Linear'),+ server('notion-id', 'Notion'),+ server('github-id', 'GitHub'),+ server('stripe-id', 'Stripe'),+]++describe('ScoutMcpServersPicker', () => {+ beforeEach(() => {+ // featureFlagLogic persists to localStorage, which jsdom keeps across tests.+ localStorage.clear()+ initKeaTests()+ featureFlagLogic.mount()+ featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.MCP_GATEWAY], { [FEATURE_FLAGS.MCP_GATEWAY]: true })+ // msw handlers reset between tests, so register per test rather than once per file.+ useMocks({+ get: {+ '/api/projects/:team_id/mcp_gateway/service_accounts/': () => [+ 200,+ {+ count: 1,+ next: null,+ previous: null,+ results: [+ {+ id: 'scout-id',+ name: 'scout',+ description: 'Scheduled scouts',+ handle: 'svc-scout',+ agent_key: 'scout',+ status: 'active',+ server_ids: SERVERS.map(({ id }) => id),+ servers: SERVERS,+ last_active_at: null,+ created_at: '2026-07-22T00:00:00Z',+ updated_at: '2026-07-22T00:00:00Z',+ },+ ],+ },+ ],+ },+ })+ })+ afterEach(cleanup)++ // The header is all most people read, so a scout with servers must not read "None". The names+ // come from the team's shares, so a selection whose share was withdrawn drops out of the header+ // the same way it drops out of what the run mounts.+ it.each([+ ['the servers it may use', ['linear-id'], ['Linear'], ['None', 'Notion']],+ ['nothing selected', [], ['None'], ['Linear']],+ ['a selection the team no longer shares', ['retired-id'], ['None'], []],+ // A scout may hold up to 100 servers. An unbounded header would push the row it+ // summarizes, and everything under it, off the screen.+ [+ 'more servers than the header shows',+ ['linear-id', 'notion-id', 'github-id', 'stripe-id'],+ ['GitHub', 'Linear', 'Notion', '+1 more'],+ ['Stripe'],+ ],+ ])(+ 'summarizes %s in the header, with the section closed',+ async (_name, selectedServerIds: string[], expected: string[], unexpected: string[]) => {+ render(<ScoutMcpServersPicker compact selectedServerIds={selectedServerIds} onChange={jest.fn()} />)++ for (const text of expected) {+ expect(await screen.findByText(text)).toBeInTheDocument()+ }+ for (const text of unexpected) {+ expect(screen.queryByText(text)).not.toBeInTheDocument()+ }+ }+ )++ // A scout keeps mounting every server it holds when the lookup fails, so a header that read+ // "None" would report access the scout still has as removed.+ it('says nothing about servers when the lookup fails', async () => {+ useMocks({+ get: {+ '/api/projects/:team_id/mcp_gateway/service_accounts/': () => [500, { detail: 'nope' }],+ },+ })++ render(<ScoutMcpServersPicker compact selectedServerIds={['linear-id']} onChange={jest.fn()} />)++ expect(await screen.findByText('MCP servers')).toBeInTheDocument()+ expect(screen.queryByText('None')).not.toBeInTheDocument()+ expect(screen.queryByText('Linear')).not.toBeInTheDocument()+ })++ // The selection must be settable before the scout is enabled, or the first run of a newly+ // enabled scout races out with the wrong toolset. The form passes no disabled reason for that,+ // so the switches inside the panel stay live.+ it('opens to switches that are still editable', async () => {+ const onChange = jest.fn()+ render(<ScoutMcpServersPicker compact selectedServerIds={[]} onChange={onChange} />)++ fireEvent.click(await screen.findByText('MCP servers'))++ const linearSwitch = await screen.findByLabelText('Let this scout use Linear')+ expect(linearSwitch).not.toBeDisabled()++ fireEvent.click(linearSwitch)+ expect(onChange).toHaveBeenCalledWith(['linear-id'])+ })+})diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersPicker.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersPicker.tsxindex bfb44c070591..62985256ec5b 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersPicker.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersPicker.tsx@@ -2,7 +2,7 @@ import { useMountedLogic, useValues } from 'kea'import { useState } from 'react'import { IconChevronRight, IconServer } from '@posthog/icons'-import { LemonSwitch, LemonTag, Link, Spinner } from '@posthog/lemon-ui'+import { LemonCollapse, LemonSwitch, LemonTag, Link, Spinner } from '@posthog/lemon-ui'import { ServerIcon } from '@posthog/products-mcp-store/frontend/scene/icons'import { FEATURE_FLAGS } from 'lib/constants'@@ -13,6 +13,7 @@ import { agentServerConnectionIssue } from 'products/mcp_store/frontend/gateway/import type { MCPServiceAccountServerApi } from 'products/mcp_store/frontend/generated/api.schemas'import { scoutMcpServersLogic } from '../../../logics/scoutMcpServersLogic'+import { ScoutMcpServersSummary } from './ScoutMcpServersSummary'/** Rows shown before the list collapses behind "See more". */const MAX_VISIBLE_SERVERS = 2@@ -189,21 +190,24 @@ function FullPicker(props: ScoutMcpServersPickerProps): JSX.Element {)}+/**+ * The settings-form variant: collapsed by default, with the servers this scout may use in the+ * header, so a scout that uses none costs one line.+ */function CompactPicker(props: ScoutMcpServersPickerProps): JSX.Element {useMountedLogic(scoutMcpServersLogic)+ const { scoutAccount, teamScoutServers } = useValues(scoutMcpServersLogic)const state = usePickerState(props)+ const selectedServers = teamScoutServers.filter((server) => props.selectedServerIds.includes(server.id))- return (- <div className="flex flex-col gap-2 border-t border-primary pt-2">- <div className="flex flex-col min-w-0">- <span className="text-xs text-default">MCP servers</span>- <span className="text-[11.5px] text-muted">- Choose which of the team's shared MCP servers this scout can use.{' '}- <Link to={urls.mcpGateway()} target="_blank">- Manage MCP servers- </Link>- </span>- </div>+ const body = (+ <div className="flex flex-col gap-2">+ <span className="text-[11.5px] text-muted">+ Choose which of the team's shared MCP servers this scout can use.{' '}+ <Link to={urls.mcpGateway()} target="_blank">+ Manage MCP servers+ </Link>+ </span>{state.initialLoading ? (<span className="flex items-center gap-2 text-[11.5px] text-muted"><Spinner /> Loading MCP servers...@@ -242,4 +246,32 @@ function CompactPicker(props: ScoutMcpServersPickerProps): JSX.Element {)}</div>)++ return (+ <div className="border-t border-primary pt-2">+ <LemonCollapse+ embedded+ size="small"+ panels={[+ {+ key: 'mcp-servers',+ dataAttr: 'scout-mcp-servers',+ header: (+ <div className="flex flex-1 items-center justify-between gap-2">+ <span className="text-xs text-default">MCP servers</span>+ <div className="flex flex-wrap items-center gap-1">+ <ScoutMcpServersSummary+ loading={state.initialLoading}+ resolved={scoutAccount !== null}+ selectedServers={selectedServers}+ />+ </div>+ </div>+ ),+ content: body,+ },+ ]}+ />+ </div>+ )}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersSummary.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersSummary.tsxnew file mode 100644index 000000000000..fb1203c56379--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutMcpServersSummary.tsx@@ -0,0 +1,48 @@+import { LemonTag } from '@posthog/lemon-ui'++import type { MCPServiceAccountServerApi } from 'products/mcp_store/frontend/generated/api.schemas'++/**+ * Tags shown before the rest collapse into a count. `MAX_SCOUT_MCP_GATEWAY_SERVERS` lets a scout+ * hold 100 servers, so an unbounded header would push the row it summarizes off the screen.+ */+const MAX_SUMMARY_TAGS = 3++/**+ * What the scout may reach, for the collapsed header of the settings picker. The names come from+ * the team's shared servers, so a selected id whose share was withdrawn drops out, matching what a+ * run mounts.+ */+export function ScoutMcpServersSummary({+ loading,+ resolved,+ selectedServers,+}: {+ loading: boolean+ /** False when the shared-server lookup did not answer, so no selection can be read from it. */+ resolved: boolean+ selectedServers: MCPServiceAccountServerApi[]+}): JSX.Element | null {+ // "None" is a verdict about a resolved list. A failed lookup would otherwise report that the+ // scout reaches nothing while its runs still mount every server it holds.+ if (loading || !resolved) {+ return null+ }+ if (selectedServers.length === 0) {+ return <span className="text-[11.5px] text-muted">None</span>+ }+ const shown = selectedServers.slice(0, MAX_SUMMARY_TAGS)+ const hiddenCount = selectedServers.length - shown.length+ return (+ <>+ {shown.map((server) => (+ // A server name holds up to 200 characters, which would otherwise widen the header+ // past the row. The full name stays reachable on hover.+ <LemonTag key={server.id} size="small" type="option" className="max-w-32" title={server.name}>+ <span className="min-w-0 truncate">{server.name}</span>+ </LemonTag>+ ))}+ {hiddenCount > 0 ? <span className="text-[11.5px] text-muted">+{hiddenCount} more</span> : null}+ </>+ )+}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestination.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestination.test.tsxnew file mode 100644index 000000000000..e19e5d679a53--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestination.test.tsx@@ -0,0 +1,113 @@+import '@testing-library/jest-dom'++import { cleanup, fireEvent, render, screen } from '@testing-library/react'++import { useMocks } from '~/mocks/jest'+import { initKeaTests } from '~/test/init'+import type { IntegrationType } from '~/types'++import type { SignalScoutSlackDestinationApi } from 'products/signals/frontend/generated/api.schemas'++import { ScoutSlackDestination } from './ScoutSlackDestination'++const SLACK_WORKSPACE = { id: 1, kind: 'slack', display_name: 'PostHog' } as IntegrationType+const BROKEN_WORKSPACE = { ...SLACK_WORKSPACE, errors: 'TOKEN_REFRESH_FAILED' } as IntegrationType++describe('ScoutSlackDestination', () => {+ let workspaces: IntegrationType[] = []++ beforeEach(() => {+ initKeaTests()+ workspaces = [SLACK_WORKSPACE]+ // msw handlers reset between tests, so register per test rather than once per file.+ useMocks({+ get: {+ '/api/environments/:team_id/integrations/': () => [200, { results: workspaces }],+ },+ })+ })+ afterEach(cleanup)++ // The header is all most people read, so it has to name the target the next run actually posts+ // to. Reading "Off" or "Not connected" over a live destination would hide a scout that is+ // already posting into a channel.+ it.each([+ ['a channel', { integration_id: 1, channel: 'C123|#alerts' }, true, ['#alerts'], ['Threaded', 'Disconnected']],+ [+ 'a threaded channel',+ { integration_id: 1, channel: 'C123|#alerts', thread_reports: true },+ true,+ ['#alerts', 'Threaded'],+ [],+ ],+ // A channel saved through the API carries no name, and the opaque id names nothing a+ // reader recognizes.+ ['a bare channel id', { integration_id: 1, channel: 'C0123ABC456' }, true, ['Slack channel'], ['C0123ABC456']],+ ['several DM recipients', { integration_id: 1, users: ['U1|@ana', 'U2|@bo'] }, true, ['DM to 2 people'], []],+ ['a single DM recipient', { integration_id: 1, users: ['U1|@ana'] }, true, ['DM to 1 person'], []],+ // The harness threads each direct message too, so a header that reported threading only+ // for channels would hide how the report arrives.+ [+ 'threaded direct messages',+ { integration_id: 1, users: ['U1|@ana'], thread_reports: true },+ true,+ ['DM to 1 person', 'Threaded'],+ [],+ ],+ // Delivery fails on every run once the workspace behind a saved destination is gone, so a+ // header that still read as a live channel would hide a scout that posts nowhere.+ [+ 'a destination whose workspace was disconnected',+ { integration_id: 99, channel: 'C123|#alerts' },+ true,+ ['#alerts', 'Disconnected'],+ [],+ ],+ ['no destination', undefined, true, ['Off'], []],+ ['no Slack workspace', undefined, false, ['Not connected'], []],+ ])(+ 'summarizes %s in the header, with the section closed',+ async (+ _name,+ destination: SignalScoutSlackDestinationApi | undefined,+ connected: boolean,+ expected: string[],+ unexpected: string[]+ ) => {+ workspaces = connected ? [SLACK_WORKSPACE] : []++ render(<ScoutSlackDestination destination={destination} onChange={jest.fn()} />)++ for (const text of expected) {+ expect(await screen.findByText(text)).toBeInTheDocument()+ }+ for (const text of unexpected) {+ expect(screen.queryByText(text)).not.toBeInTheDocument()+ }+ expect(screen.queryByText(/Post each scout run/)).not.toBeInTheDocument()+ }+ )++ // The picker's health checks only run once the panel opens, so without this a workspace whose+ // token was revoked reads as a live channel and every run silently fails to deliver.+ it('reports a workspace that can no longer authenticate, with the section closed', async () => {+ workspaces = [BROKEN_WORKSPACE]++ render(+ <ScoutSlackDestination destination={{ integration_id: 1, channel: 'C123|#alerts' }} onChange={jest.fn()} />+ )++ expect(await screen.findByText('Reconnect')).toBeInTheDocument()+ expect(screen.getByText('#alerts')).toBeInTheDocument()+ expect(screen.queryByText('Disconnected')).not.toBeInTheDocument()+ })++ it('opens the picker from the header', async () => {+ render(<ScoutSlackDestination destination={undefined} onChange={jest.fn()} />)++ fireEvent.click(await screen.findByText('Slack destination'))++ expect(await screen.findByText(/Post each scout run/)).toBeInTheDocument()+ expect(screen.getByText('Direct message')).toBeInTheDocument()+ })+})diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestination.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestination.tsxindex f50a4f62d55d..2b2f46de786b 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestination.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestination.tsx@@ -2,7 +2,7 @@ import { useMountedLogic, useValues } from 'kea'import { useState } from 'react'import { IconTrash } from '@posthog/icons'-import { LemonButton, LemonSegmentedButton, LemonSelect, LemonSwitch, Link } from '@posthog/lemon-ui'+import { LemonButton, LemonCollapse, LemonSegmentedButton, LemonSelect, LemonSwitch, Link } from '@posthog/lemon-ui'import { integrationsLogic } from 'lib/integrations/integrationsLogic'import { SlackChannelPicker, SlackUserPicker } from 'lib/integrations/SlackIntegrationHelpers'@@ -13,6 +13,8 @@ import type {SignalScoutSlackDestinationApi,} from 'products/signals/frontend/generated/api.schemas'+import { ScoutSlackDestinationSummary } from './ScoutSlackDestinationSummary'+// Mirrors MAX_SCOUT_SLACK_DM_TARGETS on the backend serializer.const MAX_DM_RECIPIENTS = 5@@ -24,6 +26,10 @@ interface ScoutSlackDestinationProps {onChange: (outputDestinations: SignalScoutOutputDestinationsApi) => void}+/**+ * Slack delivery for one scout in its settings form: collapsed by default, with the target it+ * posts to in the header, so a scout that never posts to Slack costs one line.+ */export function ScoutSlackDestination({destination,disabledReason,@@ -36,6 +42,7 @@ export function ScoutSlackDestination({? integrations.find((integration) => integration.id === destination.integration_id): undefinedconst selectedIntegration = configuredIntegration ?? (integrations.length === 1 ? integrations[0] : null)+ const workspacesLoading = integrationsLoading && slackIntegrations === undefinedconst hasChannel = Boolean(destination?.channel)const hasUsers = Boolean(destination?.users?.length)@@ -116,15 +123,12 @@ export function ScoutSlackDestination({onChange({})}- return (- <div className="flex flex-col gap-2 border-t border-primary pt-2">- <div className="flex flex-col min-w-0">- <span className="text-xs text-default">Slack destination</span>- <span className="text-[11.5px] text-muted">- Post each scout run's output to a channel, or send it as a direct message- </span>- </div>- {integrationsLoading && slackIntegrations === undefined ? (+ const body = (+ <div className="flex flex-col gap-2">+ <span className="text-[11.5px] text-muted">+ Post each scout run's output to a channel, or send it as a direct message+ </span>+ {workspacesLoading ? (<span className="text-xs text-muted">Loading Slack workspaces…</span>) : integrations.length === 0 ? (<Link to={urls.settings('environment-integrations', 'integration-slack')}>@@ -225,4 +229,32 @@ export function ScoutSlackDestination({)}</div>)++ return (+ <div className="border-t border-primary pt-2">+ <LemonCollapse+ embedded+ size="small"+ panels={[+ {+ key: 'slack-destination',+ dataAttr: 'scout-slack-destination',+ header: (+ <div className="flex flex-1 items-center justify-between gap-2">+ <span className="text-xs text-default">Slack destination</span>+ <div className="flex flex-wrap items-center gap-1">+ <ScoutSlackDestinationSummary+ destination={destination}+ workspaces={integrations}+ loading={workspacesLoading}+ />+ </div>+ </div>+ ),+ content: body,+ },+ ]}+ />+ </div>+ )}diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestinationSummary.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestinationSummary.tsxnew file mode 100644index 000000000000..7483f35db092--- /dev/null+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutSlackDestinationSummary.tsx@@ -0,0 +1,104 @@+import { LemonTag } from '@posthog/lemon-ui'++import { slackChannelDisplayName } from 'lib/integrations/slackChannel'++import type { IntegrationType } from '~/types'++import type { SignalScoutSlackDestinationApi } from 'products/signals/frontend/generated/api.schemas'++/** Why the next run cannot deliver to the saved target, or `null` when nothing is wrong. */+type DestinationFault = 'disconnected' | 'reconnect' | null++/**+ * A picker value carries the channel name after a pipe. A destination saved through the API can+ * hold a bare channel id instead, which names nothing a reader recognizes, so it falls back to the+ * same generic label the picker uses for a channel it cannot name.+ */+function channelLabel(channel: string): string {+ const name = slackChannelDisplayName(channel)+ return name === channel ? 'Slack channel' : name+}++/**+ * Whether the workspace behind a saved destination can still deliver. Both faults come from the+ * integration list, which loads while the section is closed, so neither costs a request. The+ * picker's own health checks only run once the section opens, and a report that never arrives is+ * exactly what a reader must not have to open the section to find out about.+ */+function destinationFault(+ destination: SignalScoutSlackDestinationApi | null | undefined,+ workspaces: IntegrationType[],+ loading: boolean+): DestinationFault {+ if (loading) {+ return null+ }+ const workspace = workspaces.find((candidate) => candidate.id === destination?.integration_id)+ if (!workspace) {+ return 'disconnected'+ }+ // The API records a refresh failure here, which is how a revoked or expired token surfaces+ // without asking Slack again.+ return workspace.errors ? 'reconnect' : null+}++/**+ * Where this scout's output goes, for the collapsed header of the settings form. The saved+ * destination answers on its own, so a scout with Slack set up reads the same before the workspace+ * list arrives.+ */+export function ScoutSlackDestinationSummary({+ destination,+ workspaces,+ loading,+}: {+ destination?: SignalScoutSlackDestinationApi | null+ /** Slack workspaces connected to the project. Empty until `loading` is false. */+ workspaces: IntegrationType[]+ loading: boolean+}): JSX.Element | null {+ const channel = destination?.channel+ const recipientCount = destination?.users?.length ?? 0++ if (!channel && recipientCount === 0) {+ // A project with Slack connected must not read "Not connected" while its workspaces load,+ // so the header stays blank until the list resolves.+ if (loading) {+ return null+ }+ return <span className="text-[11.5px] text-muted">{workspaces.length > 0 ? 'Off' : 'Not connected'}</span>+ }++ const fault = destinationFault(destination, workspaces, loading)++ return (+ <>+ {channel ? (+ <LemonTag size="small" type="option">+ {channelLabel(channel)}+ </LemonTag>+ ) : (+ <span className="text-[11.5px] text-muted">+ DM to {recipientCount} {recipientCount === 1 ? 'person' : 'people'}+ </span>+ )}+ {/* The scout harness reads `thread_reports` once and applies it to a channel and to+ each direct message alike, so both targets report it. */}+ {destination?.thread_reports ? (+ <LemonTag size="small" type="muted">+ Threaded+ </LemonTag>+ ) : null}+ {fault === 'disconnected' ? (+ <LemonTag size="small" type="warning">+ Disconnected+ </LemonTag>+ ) : null}+ {fault === 'reconnect' ? (+ <LemonTag size="small" type="danger">+ Reconnect+ </LemonTag>+ ) : null}+ </>+ )+}