: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): add a show in inbox switch to scout settings (#120204)
posthog[bot]a276c002d87f
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 73b0209b7617..e0c453c1fcd1 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -12051,33 +12051,33 @@ snapshots:scenes-app-inbox-scout-trials-setup--unsaved-rubric--light:hash: v1.k794b7964.64c0d8ac04bb10ab54ff05a9c7d2efd237b622b116771aee794fa1c7af421bcc.XeqOuTw49vlR0b-89jf7K-rnc7FjBV6h-EJZoDc8Su8scenes-app-inbox-scoutconfigform--custom-cron-schedule--dark:- hash: v1.k794b7964.6378a9596309fa4fd12a964073a13246e6af771163b2e74fc68e61c1db4292d7.RhdRT5KWraixvvTHP_y3dVuIW8J0SL5igyirjcewljk+ hash: v1.k794b7964.192681e0042126bf2f466fe4c5a37d60554e9c32a84c8d3308dd1a2bfae7143a.9Vyn6MrqE6n3XQ0X88hAjq9dlxXt-AeIuBFvtqOUCscscenes-app-inbox-scoutconfigform--custom-cron-schedule--light:- hash: v1.k794b7964.c51eebe91da2aeb28af4f6802d59c5dceab7007829c18a1c59649789e95e6a5c.Ze3mbrtkpUrYDjhEgGbG4RAgefvaPF2O5zbIRe3aWjw+ hash: v1.k794b7964.5e7b810833527e01840b254a6d562a54905d57a3e683c14437c0115dae191fe4.SHlnQRvVD9bAWvL_sdrqvhdN4s-pr_WnZ8v4PW0qMjUscenes-app-inbox-scoutconfigform--disabled--dark:- hash: v1.k794b7964.ec7ef2256997314be550c838d3850710ada229040515da4ad6bc85d9a13425bb.z1WoHpY-gF9ZkDjQA7oUCo5g1AGcQcc3YxSbGRzLfYo+ hash: v1.k794b7964.bdd7f68a15bc03b7e4f871009d0d3eb7852c3d88b88d8a49fc4d99f765f72cc4.wg3FMDlDV-9A0c1_mko5N6aHDWUrkIS2uqVGrEr0zfQscenes-app-inbox-scoutconfigform--disabled--light:- hash: v1.k794b7964.596758660f7fdf9a8f1ab581681c25df603bc176d67e5ea252b43159027acf80.CNYZsuIe7fRU07w3HllIPtvyHf2oZnSzJHoQg8LBHGo+ hash: v1.k794b7964.ac7bd49fdb75bfc4020ec4133e8f72f7440cf16c529f2f96793c2ca13a1f2781.YGCZawyFeaZceQSIqhHCNdgSdr51yWIW5lTK2XioFYQscenes-app-inbox-scoutconfigform--dry-run--dark:- hash: v1.k794b7964.85bd04d313a2246719a978813f5d8fcaa469c2d7ed16204149059287a86939b5.qdlsrpAcHCZ-4f7ENoKhuyZTuhNd32Ye64gltyx6Epk+ hash: v1.k794b7964.c95323d70ea372e410b15ac927fb6ad362d075d85de2df5c49665d708715a874.xGwEpnEo09fqlBFNB7M8LcmPyP6DzWBjmGLJo_PRIPcscenes-app-inbox-scoutconfigform--dry-run--light:- hash: v1.k794b7964.215350b36bf14f21836f445d13adff456921786f52802da0f98f0b2ebead11c7.0H_WI7L82A1TPFC1tK9dgdmtKX6f9Ow03DdSc9YC2ro+ hash: v1.k794b7964.a444096e40a6c46e5bebbf5fd9003be167224e4860546dc6ae9e0c3a72827862.0OTQ6gPi_lu7-jsgNXROJmLF_vUxSpXarWlfgqiFhNkscenes-app-inbox-scoutconfigform--live--dark:- hash: v1.k794b7964.22844e997fdf12c3b3a39012a3e09c61bc1dfae1c8fe3af7195662dd168994d4.RxkaFU88ZioRIWXQIsENqd0Tr7cgwqRsJZO9NjEInX0+ hash: v1.k794b7964.e7e9c3132cdbd4d939353252acf7f165ab50d65dd492a5c0fe5b18b92f031488.0TZxM73kAWr1ighBs4VmYaCy5px40wxS0pbdxOKFZS4scenes-app-inbox-scoutconfigform--live--light:- hash: v1.k794b7964.3438cb4bf321db1086dd10eabbaceb30f09530872427303742ad3d3907a1b23f.oGx_AuCL0y8v-S7odhR7Lbp-2vT7pjerHN9QZNJ-g9s+ hash: v1.k794b7964.ba4ab2f12772bb6c2e72303c8c889c8f05f6f602bc036df03e195bf11e93e889.5D8fJVQ_8wcI7N37RlupGAWQuv5ZBfMN5nH-E53ndfYscenes-app-inbox-scoutconfigform--slack-channel-destination--dark:- hash: v1.k794b7964.7d472808fd14a8663ab8ac4f1b894547b055f1babcac80dc5b803d5fe2428706.pRsthoDdjt9hjwjoLTHRcAnXw7M1TATeQgcBgSZCxSk+ hash: v1.k794b7964.332d510cc92e7c3eee9be3e55aa0e70453e9acd407778891b1e100a90c1ef67f.zp5ztHAgZFE4rdELlNustK8TmhENrR36Sc-d5ZhK32sscenes-app-inbox-scoutconfigform--slack-channel-destination--light:- hash: v1.k794b7964.7a5fdbdd6b03b474e9ac2c698d678c828fca0e4dbbc5d89121292153d4be5a31.j294iEwXC5J9schhlogtSwB1rocD1l_Zd0I73yaqS1U+ hash: v1.k794b7964.579070a214549cfff6b6537bf34d321c219786fb308b995fa114be3585380bb5.bgvLP20mdBdDeQ-jDXj8SAjqqiEu-bTGj3YJnsbGI44scenes-app-inbox-scoutconfigform--structured-output--dark:- hash: v1.k794b7964.c34f609a1d1034e4b8ee91c8c44fb02641b0107ffbaee4ee5ab78443aba0f58b.58MUI3Jrc2lRSHzvOaF1rWyQ8OmW1_P0myra_v2g_ow+ hash: v1.k794b7964.4a371b040cea82e9d24a1401264b9ce1c1b177984bdb190d0556524af2b8d0c7.COEdBWzueP2G6BBU3XqWoSonTJCzKWISSQGUzQpTuE4scenes-app-inbox-scoutconfigform--structured-output--light:- hash: v1.k794b7964.8fd03bb1e0bcf6bfd12d4e1998b5c748a628d77305ed3ecd4f65c06dfb912859.47heuQ1PD7usF5OCbISOMs8eLB0VYyCdqi4LsN8OUb4+ hash: v1.k794b7964.c8981edfcd37d988cf6c1949c555195086e0454713055ccf1443651a1931b22f.7SVORkB4vzHg7i2pbZg37iMBqqjoCXaNAdrcMCstG2sscenes-app-inbox-scoutconfigform--weekly-schedule--dark:- hash: v1.k794b7964.aa7da945516a905ecf22b1032b498239a19af44e75b3c476417096c620952730.lUIjdBY7-uy4Oiuhvn1aBXxW_qjoliRsX0Kj1yQd6aY+ hash: v1.k794b7964.9f73ee38379c8315f7d3386e7a4afcb76c06f81b726cb6b922d6b9ff8950f76f.qNAw52THbIKzasFDGIsBGIEPX6sQKP024_mxU-5Cpjwscenes-app-inbox-scoutconfigform--weekly-schedule--light:- hash: v1.k794b7964.504737de87284126ec0dc3dc0ec444f6a2637aa6caf79659061e904ff6be2be3.rlZQm2FDzS0j_cYW8xKRw6DgnBmxX2-WQiBETvCl5qc+ hash: v1.k794b7964.62f1e75b6e6af2dcb9c7b76cdeb75e98a0b03fe621e0cef391b73127339c9647.Hgi_ML-SBs595LxTuUEXJ1tCsOvBIG2cz4U_cP7lVUoscenes-app-inbox-scoutdetailview--scout-page--dark:hash: v1.k794b7964.3d4d74ea471b75106f6cb9f0d092c748dcf223f16ffe0e9f77ce0dac76bd9e4e.BO6fjgJJyc51UwDNdIXqx2CDmvELzew8gnvbwL8aYh0scenes-app-inbox-scoutdetailview--scout-page--light:diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsxindex a1bf2570d637..fd1536cc0758 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.test.tsx@@ -92,6 +92,7 @@ describe('ScoutConfigForm', () => {it.each([['dry-run', emitSwitchLabel],['owner lock', 'signals-scout-general only the owner can pause or delete'],+ ['show in inbox', 'signals-scout-general show in inbox'],])('leaves the %s switch editable while the scout is disabled', (_name, label) => {const onUpdate = jest.fn()const { getByLabelText } = render(@@ -261,6 +262,32 @@ describe('ScoutConfigForm', () => {unmount()})+ // An update replaces the stored destinations, so a toggle that sends only the inbox flag+ // would silently turn off Slack delivery and drop the webhook.+ it.each([+ ['hides', true, false],+ ['shows', false, true],+ ])('%s the scout in the inbox and keeps its Slack and webhook destinations', (_action, inbox, expected) => {+ const onUpdate = jest.fn()+ const outputDestinations = {+ slack: { integration_id: 7, channel: 'C123', thread_reports: false },+ webhook: { hog_function_id: 'hog-function-1' },+ inbox,+ }+ const { getByLabelText, unmount } = render(+ <ScoutConfigForm config={{ ...config, output_destinations: outputDestinations }} onUpdate={onUpdate} />+ )+ const inboxSwitch = getByLabelText(`${config.skill_name} show in inbox`)+ expect(inboxSwitch).toHaveAttribute('aria-checked', String(inbox))++ fireEvent.click(inboxSwitch)++ expect(onUpdate).toHaveBeenCalledWith('config-1', {+ output_destinations: { ...outputDestinations, inbox: expected },+ })+ unmount()+ })+it('adds normalized tags as a full replacement set', () => {const onUpdate = jest.fn()const { getByLabelText, unmount } = render(diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsxindex dc536f277d25..9178a5a2b901 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx@@ -350,6 +350,25 @@ export function ScoutConfigForm({</div><ScoutTagsEditor config={config} onUpdate={onUpdate} updating={updating} /></div>+ <div className="flex items-center justify-between gap-4">+ <div className="flex flex-col min-w-0">+ <span className="text-xs text-default">Show in inbox</span>+ <span className="text-[11.5px] text-muted">+ Turn this off to keep this scout's reports out of the inbox, for example when you read them in+ Slack.+ </span>+ </div>+ <LemonSwitch+ size="small"+ checked={config.output_destinations?.inbox ?? true}+ disabledReason={updating ? 'Saving scout settings' : undefined}+ // The update replaces the stored destinations, so resend Slack and the webhook with the flag.+ onChange={(checked) =>+ onUpdate(config.id, { output_destinations: { ...config.output_destinations, inbox: checked } })+ }+ aria-label={`${config.skill_name} show in inbox`}+ />+ </div><ScoutSlackDestinationdestination={config.output_destinations?.slack}onChange={(outputDestinations) => onUpdate(config.id, { output_destinations: outputDestinations })}