Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(inbox): add stories for uncovered inbox states and remove dead files (#129103)

Andrew Maguire17fe8b0696d9
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 587fa7850e5d..830c9b608450 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -12626,6 +12626,14 @@ snapshots:
hash: v1.k794b7964.4a72fd69c80a076b8f6040c0473d1a42aa0e574e51cd9ac16c16ce74f5434d4b.UJFgWCDdVPiMssuUXnf6Px4wj9tZljS4fKvI_6WmIqI
scenes-app-inbox-report-metrics--wide--light:
hash: v1.k794b7964.3465b8cd1a9bf286b7ae698d78dba847138201548b8a3c56978fae74b431da53.2bz4A6FW49b2OIDhumSwnnmW8eVEaLSHMmBLZx_eFOg
+ scenes-app-inbox-reportcontextmenu--dismissed-report--dark:
+ hash: v1.k794b7964.538503ea8f2ff8d5f9bc59cbd2fe6f749a34285eacb19bd55bbbf65b786f8130.Y_TVBSmFznRCGYCnTQk9WwwKP_qT0i8QHW3UlhjJ1lI
+ scenes-app-inbox-reportcontextmenu--dismissed-report--light:
+ hash: v1.k794b7964.984731323d87222335ee674a82e17a4fd8a9fbf31e1f572532060db38a89d42e.ed0IqQXxc1CISgAM65o6FeQbqRGGalf0_RPn1wx5bmM
+ scenes-app-inbox-reportcontextmenu--ready-report--dark:
+ hash: v1.k794b7964.8fae2325b7a3cc5674613065bacffd12a0855dfd3865d414e729a68e68d15ca6.8pFAO6wyG9AOdZxqFNY2OdzkmONAd4LKn34lmrwp61E
+ scenes-app-inbox-reportcontextmenu--ready-report--light:
+ hash: v1.k794b7964.91421cab5636c75d6282fc276529e33083349cb1bcb0b4fa4e6646e5847b2b70.sI6Pnxg2d8yvNBEl_1exzJf6uA20ZG5yp-4XitAXeV4
scenes-app-inbox-reportfeedbackcelebration--in-footer--dark:
hash: v1.k794b7964.8c093b90ac7410e55c7b3827842eb0942adee6a57b0e818870012b04c56edd86.7qvPamSn8HsMppKivui1JK1Y24EQOXmKD7_1MT6mCS4
scenes-app-inbox-reportfeedbackcelebration--in-footer--light:
@@ -12670,6 +12678,14 @@ snapshots:
hash: v1.k794b7964.281117c64fc5141cee0ca2eb0955504de79aaaba26101b06f647cc1d16e23053.MgRPSbf2yoIPnBhGmG4Ctcd0NstOaiXKLZMoR6cM_Xk
scenes-app-inbox-scene--reports-narrow--light:
hash: v1.k794b7964.9ecd8790364701078d187380cf3853f86de835f5de1345b1d88b8e9289bff3ee.aLMSWf2cvBLc_gMVODQSxuVokIV50-ocsmr-2OGSTZQ
+ scenes-app-inbox-scene--scout-findings--dark:
+ hash: v1.k794b7964.7bbca6e056bf956578bdbbcebcf08b33a81134de6a5200593a6bd4350be01905.q0TVMQ-iYQWoT0O-lF6SFmgx47II18c6_MCnhcq6fM8
+ scenes-app-inbox-scene--scout-findings--light:
+ hash: v1.k794b7964.189524bdd54bbd0e5c72c6fef4f5f632343f1f2d465c0917a719a2dc9ba39b6d.Osyf4-nB2jmK37mrNf68J_HGbqdj5f6MH3b2Nty07Ho
+ scenes-app-inbox-scene--scout-findings-load-failed--dark:
+ hash: v1.k794b7964.94394ff358d5b87be1b27f8b63f9092fa38015cca5b5e77c7563338796122421.h5pnPRyvVdZqlvy64hEuvIeqN-hYujdB1EvIJXEkWH8
+ scenes-app-inbox-scene--scout-findings-load-failed--light:
+ hash: v1.k794b7964.0f5d81d40aeb072a9206665aa5eb32f7779ee1d17ba169c168292695e2965a0a.7PK7Y980dpjdK3qWVRF-BHyQzGb0TtP_9s9cF15br38
scenes-app-inbox-scene--scouts--dark:
hash: v1.k794b7964.342b6ade0a3245d92d924e2e7d37484d96e28dcc699b3f565f87c8dfda96be96.T5RoSmtn2CUXtooHEFwovo4fJfyjBXJDwg9KGBQs-ls
scenes-app-inbox-scene--scouts--light:
@@ -12930,6 +12946,10 @@ snapshots:
hash: v1.k794b7964.9f73ee38379c8315f7d3386e7a4afcb76c06f81b726cb6b922d6b9ff8950f76f.qNAw52THbIKzasFDGIsBGIEPX6sQKP024_mxU-5Cpjw
scenes-app-inbox-scoutconfigform--weekly-schedule--light:
hash: v1.k794b7964.62f1e75b6e6af2dcb9c7b76cdeb75e98a0b03fe621e0cef391b73127339c9647.Hgi_ML-SBs595LxTuUEXJ1tCsOvBIG2cz4U_cP7lVUo
+ scenes-app-inbox-scoutcreatemodal--turn-on-existing-scout--dark:
+ hash: v1.k794b7964.17e7526c978c3c839fbdf23ff46b53d488a546a279e3b386d14e569b41020da1.DfWDBVa5IdrRxDI0iaNhRnqt6lvQBJruT56YFRWRgS0
+ scenes-app-inbox-scoutcreatemodal--turn-on-existing-scout--light:
+ hash: v1.k794b7964.d4b0a95d1f0bc1539e29b24a5b103320b53880d0592a270c1e4c026b48efde9d.l4U-DHeLd56PFFMxidKyAwZeDzqu1UwCGFZSUdc6eas
scenes-app-inbox-scoutdetailview--scout-page--dark:
hash: v1.k794b7964.af12f933be7a8cf42bd706080819f7df9fc262dc192224e9b022bd8037a55a64.tg6xQCrfyh-4U_nT0uLnp3dqtTfCpbZEn5UYocgS9QA
scenes-app-inbox-scoutdetailview--scout-page--light:
diff --git a/products/signals/frontend/inbox/InboxScene.stories.tsx b/products/signals/frontend/inbox/InboxScene.stories.tsx
index 5951b004bc02..60d80611ee0f 100644
--- a/products/signals/frontend/inbox/InboxScene.stories.tsx
+++ b/products/signals/frontend/inbox/InboxScene.stories.tsx
@@ -21,7 +21,7 @@ import {
mockTeamConfig,
reportTabReports,
} from './__mocks__/inboxMocks'
-import { mockLargeScoutFleet, mockScoutConfigs, mockScoutRuns } from './__mocks__/scoutConfigs'
+import { mockLargeScoutFleet, mockScoutConfigs, mockScoutRuns, mockScoutSuggestionSet } from './__mocks__/scoutConfigs'
import { InboxScene } from './InboxScene'
import { INBOX_LAST_UI_STATE_STORAGE_KEY } from './logics/inboxOnboardingLogic'
@@ -191,6 +191,112 @@ export const Scouts: Story = {
],
}
+const findingsRuns = [
+ {
+ run_id: 'findings-run-errors',
+ skill_name: 'signals-scout-error-tracking',
+ emitted_count: 2,
+ emitted_finding_ids: ['checkout-500s', 'invite-null-email'],
+ emitted_report_ids: [],
+ created_at: '2026-06-10T18:00:00Z',
+ },
+ {
+ run_id: 'findings-run-replay',
+ skill_name: 'signals-scout-session-replay',
+ emitted_count: 1,
+ emitted_finding_ids: ['rage-clicks-billing'],
+ emitted_report_ids: [reportTabReports[0].id],
+ created_at: '2026-06-10T12:00:00Z',
+ },
+].map((run) => ({
+ ...run,
+ total_spend: null,
+ skill_version: 1,
+ status: 'completed' as const,
+ started_at: run.created_at,
+ completed_at: run.created_at,
+ task_url: null,
+ summary: 'Filed what changed since the last run.',
+ edited_report_ids: [],
+ metadata: {},
+}))
+
+const findingsEmissions = [
+ {
+ id: 'emission-checkout-500s',
+ run_id: 'findings-run-errors',
+ finding_id: 'checkout-500s',
+ description: 'A new TypeError on the checkout page started at 14:00 and now affects about one in ten sessions.',
+ severity: 'P1' as const,
+ tags: ['new-error', 'checkout'],
+ source_id: 'run:findings-run-errors:finding:checkout-500s',
+ emitted_at: '2026-06-10T18:10:00Z',
+ },
+ {
+ id: 'emission-invite-null-email',
+ run_id: 'findings-run-errors',
+ finding_id: 'invite-null-email',
+ description: 'Team invites with an empty recipient row raise a 500 instead of a validation error.',
+ severity: 'P2' as const,
+ tags: ['regression'],
+ source_id: 'run:findings-run-errors:finding:invite-null-email',
+ emitted_at: '2026-06-10T18:08:00Z',
+ },
+ {
+ id: 'emission-rage-clicks-billing',
+ run_id: 'findings-run-replay',
+ finding_id: 'rage-clicks-billing',
+ description: 'People rage-click the disabled upgrade button on the billing page before they leave.',
+ severity: 'P3' as const,
+ tags: ['usability'],
+ source_id: 'run:findings-run-replay:finding:rage-clicks-billing',
+ emitted_at: '2026-06-10T12:12:00Z',
+ },
+]
+
+function findingsMocks(emissionsFail = false): Decorator {
+ return mswDecorator({
+ get: {
+ '/api/projects/:id/signals/scout/configs': () => [200, mockScoutConfigs],
+ '/api/projects/:id/signals/scout/runs': () => [200, findingsRuns],
+ '/api/projects/:id/signals/scout/runs/findings/summary/': () => [200, null],
+ '/api/projects/:id/signals/scout/metadata/current/': () => [200, null],
+ '/api/projects/:id/signals/scout/scratchpad/': () => [200, []],
+ '/api/projects/:id/signals/scout/suggestions/': () => [200, mockScoutSuggestionSet()],
+ '/api/projects/:id/vision/scanners/': { count: 0, next: null, previous: null, results: [] },
+ },
+ post: {
+ '/api/projects/:id/signals/scout/configs/sync/': () => [200, mockScoutConfigs],
+ '/api/projects/:id/signals/scout/runs/emissions/batch/': () =>
+ emissionsFail ? [500, { detail: 'Server error' }] : [200, findingsEmissions],
+ '/api/projects/:id/signals/scout/runs/emissions/reports/batch/': () => [
+ 200,
+ [
+ {
+ finding_id: 'invite-null-email',
+ source_id: 'run:findings-run-errors:finding:invite-null-email',
+ report: { id: reportTabReports[0].id, title: reportTabReports[0].title, status: 'ready' },
+ },
+ ],
+ ],
+ },
+ })
+}
+
+export const ScoutFindings: Story = {
+ decorators: [routeTo(urls.inboxFindings()), findingsMocks()],
+ play: async ({ canvas }) => {
+ await expect(canvas.findByText(/rage-click the disabled upgrade button/)).resolves.toBeVisible()
+ },
+}
+
+export const ScoutFindingsLoadFailed: Story = {
+ decorators: [routeTo(urls.inboxFindings()), findingsMocks(true)],
+ play: async ({ canvas }) => {
+ await expect(canvas.findByText(/Couldn't load signals/)).resolves.toBeVisible()
+ },
+}
+
export const Settings: Story = {
decorators: [routeTo(urls.inbox('settings'))],
}
diff --git a/products/signals/frontend/inbox/SourcesList.tsx b/products/signals/frontend/inbox/SourcesList.tsx
deleted file mode 100644
index 72dd8ef22089..000000000000
--- a/products/signals/frontend/inbox/SourcesList.tsx
+++ /dev/null
@@ -1,232 +0,0 @@
-import { useActions, useValues } from 'kea'
-import { useState } from 'react'
-
-import { IconArrowRight, IconBell, IconGithub, IconGraph, IconHeartPlus, IconLinear } from '@posthog/icons'
-import { LemonButton } from '@posthog/lemon-ui'
-
-import { IconSlack } from 'lib/lemon-ui/icons'
-
-import { iconForType } from '~/layout/panel-layout/ProjectTree/defaultTree'
-
-import iconZendesk from 'public/services/zendesk.svg'
-
-import { captureSignalSourceInterest } from './inboxAnalytics'
-import { PgAnalyzeIcon as IconPgAnalyze } from './PgAnalyzeIcon'
-import { signalSourcesLogic } from './signalSourcesLogic'
-
-type SourceProps =
- | {
- icon: React.ReactNode
- title: string
- description: string
- variant: 'coming-soon'
- }
- | {
- icon: React.ReactNode
- title: string
- description: string
- variant: 'available'
- checked: boolean
- loading?: boolean
- /** Whether enabling requires going through a setup flow (shows an arrow icon on the enable button) */
- requiresSetup?: boolean
- onToggle: () => void
- config?: {
- display: React.ReactNode
- buttonLabel: string
- onClick: () => void
- }
- onClearClick?: () => void
- statusSection?: React.ReactNode
- }
-
-function NotifyMeButton({ source }: { source: string }): JSX.Element {
- const [notified, setNotified] = useState(false)
-
- return (
- <LemonButton
- type="secondary"
- size="xsmall"
- disabledReason={notified ? "We'll let you know!" : undefined}
- onClick={() => {
- captureSignalSourceInterest(source)
- setNotified(true)
- }}
- icon={<IconBell />}
- className="-my-4" // Prevent the button's height from affecting the row's height
- >
- {notified ? "We'll notify you!" : 'Notify me when available'}
- </LemonButton>
- )
-}
-
-function Source(props: SourceProps): JSX.Element {
- const isComingSoon = props.variant === 'coming-soon'
-
- return (
- <div className="flex gap-3 pb-3 last:pb-0 px-1 items-start">
- <div className="shrink-0 mt-2">{props.icon}</div>
- <div className="flex-1 min-w-0">
- <div className="flex items-center justify-between gap-2">
- <div className="font-medium text-sm">{props.title}</div>
- {isComingSoon ? (
- <NotifyMeButton source={props.title} />
- ) : props.checked ? (
- <LemonButton
- type="tertiary"
- size="xsmall"
- loading={props.loading}
- onClick={props.onToggle}
- className="-my-4"
- >
- Disable
- </LemonButton>
- ) : (
- <LemonButton
- type="secondary"
- size="xsmall"
- loading={props.loading}
- icon={props.requiresSetup ? <IconArrowRight /> : undefined}
- onClick={props.onToggle}
- className="-my-4"
- >
- Enable
- </LemonButton>
- )}
- </div>
- <p className="text-xs text-secondary mt-0.25 mb-0 pr-8">{props.description}</p>
- {!isComingSoon && props.checked && props.config !== undefined && (
- <>
- <div className="mt-2 border rounded">
- <div className="flex items-center justify-between px-2 pt-2">
- <span className="text-xs font-semibold text-secondary">Filters</span>
- <div className="flex items-center gap-1">
- {props.onClearClick && (
- <LemonButton type="tertiary" size="xsmall" onClick={props.onClearClick}>
- Clear
- </LemonButton>
- )}
- <LemonButton type="secondary" size="xsmall" onClick={props.config.onClick}>
- {props.config.buttonLabel}
- </LemonButton>
- </div>
- </div>
- {props.config.display}
- </div>
- {props.statusSection}
- </>
- )}
- </div>
- </div>
- )
-}
-
-export function SourcesList(): JSX.Element {
- const {
- githubIssuesConfig,
- linearIssuesConfig,
- zendeskTicketsConfig,
- pgAnalyzeIssuesConfig,
- errorTrackingIsFullyEnabled,
- healthChecksConfig,
- anomalyInvestigationConfig,
- isGithubIssuesToggling,
- isLinearIssuesToggling,
- isZendeskTicketsToggling,
- isPgAnalyzeIssuesToggling,
- isErrorTrackingToggling,
- isHealthChecksToggling,
- isAnomalyInvestigationToggling,
- } = useValues(signalSourcesLogic)
- const { initiateDataWarehouseSourceToggle, toggleErrorTracking, toggleHealthChecks, toggleAnomalyInvestigation } =
- useActions(signalSourcesLogic)
-
- return (
- <div className="divide-y space-y-3">
- <Source
- icon={
- <div className="flex *:text-xl group/colorful-product-icons colorful-product-icons-true">
- {iconForType('error_tracking')}
- </div>
- }
- title="PostHog Error tracking"
- description="New issues, reopenings, and volume spikes → Signals"
- variant="available"
- checked={errorTrackingIsFullyEnabled}
- loading={isErrorTrackingToggling}
- onToggle={() => toggleErrorTracking()}
- />
-
- <Source
- icon={<IconHeartPlus className="size-5 text-danger" />}
- title="PostHog Health checks"
- description="Instrumentation issues: missing events, proxy gaps, outdated SDKs → Signals"
- variant="available"
- checked={!!healthChecksConfig?.enabled}
- loading={isHealthChecksToggling}
- onToggle={() => toggleHealthChecks()}
- />
-
- <Source
- icon={<IconGraph className="size-5 text-accent" />}
- title="PostHog Product analytics"
- description="Anomalies in your tracked metrics, investigated automatically → Signals"
- variant="available"
- checked={!!anomalyInvestigationConfig?.enabled}
- loading={isAnomalyInvestigationToggling}
- onToggle={() => toggleAnomalyInvestigation()}
- />
-
- <Source
- icon={<img className="size-5" src={iconZendesk} />}
- title="Zendesk"
- description="Incoming support tickets → Signals"
- variant="available"
- checked={!!zendeskTicketsConfig?.enabled}
- loading={isZendeskTicketsToggling}
- requiresSetup
- onToggle={() => initiateDataWarehouseSourceToggle('zendesk')}
- />
-
- <Source
- icon={<IconLinear className="size-5" />}
- title="Linear"
- description="New issues and updates → Signals"
- variant="available"
- checked={!!linearIssuesConfig?.enabled}
- loading={isLinearIssuesToggling}
- requiresSetup
- onToggle={() => initiateDataWarehouseSourceToggle('linear')}
- />
-
- <Source
- icon={<IconGithub className="size-5" />}
- title="GitHub issues"
- description="New issues and updates → Signals"
- variant="available"
- checked={!!githubIssuesConfig?.enabled}
- loading={isGithubIssuesToggling}
- requiresSetup
- onToggle={() => initiateDataWarehouseSourceToggle('github')}
- />
-
- <Source
- icon={<IconPgAnalyze className="size-5" />}
- title="pganalyze"
- description="Postgres performance signals, slow queries, and index recommendations → Signals"
- variant="available"
- checked={!!pgAnalyzeIssuesConfig?.enabled}
- loading={isPgAnalyzeIssuesToggling}
- requiresSetup
- onToggle={() => initiateDataWarehouseSourceToggle('pganalyze')}
- />
-
- <Source
- icon={<IconSlack className="size-5 grayscale" />}
- title="Slack"
- description="Messages and threads from channels → Signals"
- variant="coming-soon"
- />
- </div>
- )
-}
diff --git a/products/signals/frontend/inbox/components/cards/ReportContextMenu.stories.tsx b/products/signals/frontend/inbox/components/cards/ReportContextMenu.stories.tsx
new file mode 100644
index 000000000000..2aade4e5235f
--- /dev/null
+++ b/products/signals/frontend/inbox/components/cards/ReportContextMenu.stories.tsx
@@ -0,0 +1,87 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { fireEvent, waitFor, within } from '@testing-library/dom'
+
+import { mswDecorator } from '~/mocks/browser'
+
+import { makeReport, mockReviewers } from '../../__mocks__/inboxMocks'
+import { mockScoutSuggestionSet } from '../../__mocks__/scoutConfigs'
+import { SignalReport, SignalReportStatus } from '../../types'
+import { ReportCard } from './ReportCard'
+import { ReportContextMenu } from './ReportContextMenu'
+
+// The right-click menu on a report row. It renders only while open, so no scene story shows it.
+
+const readyReport = makeReport({
+ id: 'context-menu-ready',
+ title: 'fix(invites): Handle incomplete recipient data in team invite form',
+ status: SignalReportStatus.READY,
+ priority: 'P1',
+ actionability: 'immediately_actionable',
+ created_at: '2026-06-10T09:00:00Z',
+ updated_at: '2026-06-10T09:00:00Z',
+})
+
+const dismissedReport = makeReport({
+ id: 'context-menu-dismissed',
+ title: 'fix(billing): Stop double-charging annual plans on renewal',
+ status: SignalReportStatus.SUPPRESSED,
+ priority: 'P2',
+ created_at: '2026-06-09T09:00:00Z',
+ updated_at: '2026-06-10T09:00:00Z',
+})
+
+function ReportRowWithMenu({ report }: { report: SignalReport }): JSX.Element {
+ return (
+ <div className="w-[520px]">
+ <ReportContextMenu report={report} sectionKey="needs-decision">
+ <ReportCard report={report} />
+ </ReportContextMenu>
+ </div>
+ )
+}
+
+const meta: Meta<typeof ReportRowWithMenu> = {
+ title: 'Scenes-App/Inbox/ReportContextMenu',
+ component: ReportRowWithMenu,
+ parameters: {
+ mockDate: '2026-06-11',
+ testOptions: { snapshotTargetSelector: '.primitive-menu-content', waitForLoadersToDisappear: false },
+ },
+ decorators: [
+ mswDecorator({
+ get: {
+ '/api/projects/:id/signals/reports/': { count: 0, next: null, previous: null, results: [] },
+ '/api/projects/:id/signals/reports/available_reviewers/': () => [200, mockReviewers],
+ '/api/projects/:id/signals/scout/configs/': () => [200, []],
+ '/api/projects/:id/signals/scout/suggestions/': () => [200, mockScoutSuggestionSet()],
+ '/api/projects/:id/tasks/@me/config/': { ai_run_preferences: {}, resolved_ai_run_defaults: {} },
+ },
+ }),
+ ],
+}
+export default meta
+
+type Story = StoryObj<typeof ReportRowWithMenu>
+
+async function openMenu(canvasElement: HTMLElement, title: RegExp): Promise<void> {
+ fireEvent.contextMenu(await within(canvasElement).findByText(title), { clientX: 240, clientY: 40 })
+ await waitFor(() => {
+ if (!document.querySelector('.primitive-menu-content')) {
+ throw new Error('The context menu is not open yet')
+ }
+ })
+}
+
+export const ReadyReport: Story = {
+ args: { report: readyReport },
+ play: async ({ canvasElement }) => {
+ await openMenu(canvasElement, /incomplete recipient data/)
+ },
+}
+
+export const DismissedReport: Story = {
+ args: { report: dismissedReport },
+ play: async ({ canvasElement }) => {
+ await openMenu(canvasElement, /double-charging annual plans/)
+ },
+}
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.stories.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.stories.tsx
new file mode 100644
index 000000000000..8ebd5eb34646
--- /dev/null
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.stories.tsx
@@ -0,0 +1,55 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { mswDecorator } from '~/mocks/browser'
+
+import { ScoutCreateModal } from './ScoutCreateModal'
+
+// The form opened on a scout that already exists, to turn it on. The name, description and
+// instructions are read-only, and only the run settings can change. ScoutNewButton stories cover
+// the form that creates a new scout.
+
+const meta: Meta<typeof ScoutCreateModal> = {
+ title: 'Scenes-App/Inbox/ScoutCreateModal',
+ component: ScoutCreateModal,
+ parameters: {
+ mockDate: '2026-06-11',
+ testOptions: { snapshotTargetSelector: '.LemonModal', waitForLoadersToDisappear: false },
+ },
+ args: {
+ isOpen: true,
+ onClose: () => {},
+ },
+ decorators: [
+ mswDecorator({
+ get: {
+ '/api/projects/:id/signals/scout/configs/': () => [200, []],
+ '/api/projects/:id/mcp_gateway/service_accounts/': () => [
+ 200,
+ { count: 0, next: null, previous: null, results: [] },
+ ],
+ },
+ }),
+ ],
+}
+export default meta
+
+type Story = StoryObj<typeof ScoutCreateModal>
+
+export const TurnOnExistingScout: Story = {
+ args: {
+ initialValues: {
+ existingConfigId: 'scout-checkout-failures',
+ display_name: 'Checkout failures',
+ name: 'signals-scout-checkout-failures',
+ description: 'Investigates recurring checkout failures and reports meaningful changes.',
+ body: [
+ '# Checkout failures',
+ '',
+ 'Look at exceptions raised on the checkout pages in the last day.',
+ 'Group them by error type and compare with the week before.',
+ 'Report a group only when it is new or grew by more than half.',
+ ].join('\n'),
+ config: { run_interval_minutes: 1440, tags: ['checkout', 'errors'] },
+ },
+ },
+}
diff --git a/products/signals/frontend/inbox/components/shell/InboxSearchFilterBar.tsx b/products/signals/frontend/inbox/components/shell/InboxSearchFilterBar.tsx
deleted file mode 100644
index 56ae5f02a026..000000000000
--- a/products/signals/frontend/inbox/components/shell/InboxSearchFilterBar.tsx
+++ /dev/null
@@ -1,225 +0,0 @@
-import { useActions, useValues } from 'kea'
-import { useEffect, useState } from 'react'
-
-import { IconChevronDown, IconFlag, IconRefresh, IconSearch, IconSort, IconTarget } from '@posthog/icons'
-import { LemonButton, LemonInput } from '@posthog/lemon-ui'
-
-import {
- INBOX_PRIORITY_OPTIONS,
- INBOX_SORT_OPTIONS,
- INBOX_SOURCE_OPTIONS,
- PRIORITY_ACCENT,
- PRIORITY_MEANING,
- inboxPriorityFilterLabel,
- inboxSortOptionKey,
- inboxSourceFilterLabel,
-} from '../../filterOptions'
-import { inboxFiltersLogic } from '../../logics/inboxFiltersLogic'
-import { scoutFleetLogic } from '../../logics/scoutFleetLogic'
-import { prettifyScoutSkillName } from '../../utils/scoutRunsWindow'
-import { FilterItem, FilterPopover } from './filterControls'
-
-/**
- * Collapsible per-scout sub-filter nested under the "Scout" source row. Collapsed by default
- * (fleets can be large); auto-expanded while any scout is selected so active filters stay visible.
- */
-function ScoutSubFilter({
- scoutNames,
- scoutFilter,
- onToggle,
- onClear,
-}: {
- scoutNames: string[]
- scoutFilter: string[]
- onToggle: (scout: string) => void
- onClear: () => void
-}): JSX.Element {
- const [expanded, setExpanded] = useState(scoutFilter.length > 0)
- // Auto-expand whenever a scout selection appears — including URL navigation or persisted-state
- // hydration into an already-mounted popover — so active filters stay visible. Still collapsible
- // by hand once no scout is selected.
- useEffect(() => {
- if (scoutFilter.length > 0) {
- setExpanded(true)
- }
- }, [scoutFilter.length])
- return (
- <div className="pl-5">
- <div className="flex items-center justify-between gap-1">
- <button
- type="button"
- onClick={() => setExpanded(!expanded)}
- className="flex min-w-0 flex-1 items-center gap-1 rounded px-1.5 py-1 text-left text-xs text-muted transition-colors hover:bg-surface-secondary"
- >
- <IconChevronDown
- className={`shrink-0 text-sm transition-transform ${expanded ? '' : '-rotate-90'}`}
- />
- <span>
- Filter by scout
- {scoutFilter.length > 0 && <span className="text-default"> · {scoutFilter.length}</span>}
- </span>
- </button>
- {scoutFilter.length > 0 && (
- <LemonButton size="xsmall" type="tertiary" onClick={onClear}>
- Clear
- </LemonButton>
- )}
- </div>
- {expanded && (
- <div className="max-h-48 overflow-y-auto deprecated-space-y-px">
- {scoutNames.map((skillName) => (
- <FilterItem
- key={skillName}
- label={prettifyScoutSkillName(skillName)}
- active={scoutFilter.includes(skillName)}
- onClick={() => onToggle(skillName)}
- />
- ))}
- </div>
- )}
- </div>
- )
-}
-
-interface InboxSearchFilterBarProps {
- searchPlaceholder?: string
- /** Triggers a reload of the report list (lives on `inboxSceneLogic`). */
- onRefresh?: () => void
- refreshing?: boolean
-}
-
-/**
- * Search input + Sort / Source / Priority filter popovers + refresh. There is no
- * status filter (desktop dropped it; status is a fixed request constant). Each
- * popover stays a quiet, muted chip until its filter is in use, then gains a
- * solid border and shows its value. Filter state is persisted via
- * `inboxFiltersLogic`; the central scene reloads on change.
- */
-export function InboxSearchFilterBar({
- searchPlaceholder = 'Search by title or description…',
- onRefresh,
- refreshing,
-}: InboxSearchFilterBarProps): JSX.Element {
- const {
- searchQuery,
- activeSortField: sortField,
- activeSortDirection: sortDirection,
- sourceProductFilter,
- scoutFilter,
- priorityFilter,
- } = useValues(inboxFiltersLogic)
- const { setSearchQuery, setSort, toggleSourceProduct, toggleScout, clearScoutFilter, togglePriority } =
- useActions(inboxFiltersLogic)
- const { scoutConfigs } = useValues(scoutFleetLogic)
-
- const activeSort = INBOX_SORT_OPTIONS.find((o) => o.field === sortField && o.direction === sortDirection)
- const activeSortKey = inboxSortOptionKey(sortField, sortDirection)
-
- // Selected scouts always stay listed (even if their config was since deleted) so they can be untoggled.
- const scoutNames = [...new Set([...(scoutConfigs ?? []).map((c) => c.skill_name), ...scoutFilter])].sort((a, b) =>
- prettifyScoutSkillName(a).localeCompare(prettifyScoutSkillName(b))
- )
-
- return (
- <div className="flex items-center gap-2 flex-wrap w-full">
- <LemonInput
- className="min-w-[220px] max-w-[420px] [&_.LemonInput__input]:pr-4"
- type="search"
- value={searchQuery}
- onChange={setSearchQuery}
- placeholder={searchPlaceholder}
- prefix={<IconSearch />}
- size="small"
- />
-
- {/* ml-auto right-aligns the cluster; flex-wrap + max-w-full keep the controls from
- overflowing on narrow viewports — each can wrap within the group rather than the
- whole row clipping, the behavior the flat (ungrouped) layout had before. */}
- <div className="flex flex-wrap items-center justify-end gap-2 ml-auto max-w-full">
- <FilterPopover
- label="Sort"
- value={activeSort?.label ?? 'Priority first'}
- icon={<IconSort />}
- active={activeSortKey !== 'priority:asc'}
- >
- {INBOX_SORT_OPTIONS.map((option) => (
- <FilterItem
- key={inboxSortOptionKey(option.field, option.direction)}
- icon={option.icon}
- label={option.label}
- active={sortField === option.field && sortDirection === option.direction}
- onClick={() => setSort(option.field, option.direction)}
- />
- ))}
- </FilterPopover>
-
- <FilterPopover
- label="Source"
- value={inboxSourceFilterLabel(sourceProductFilter, scoutFilter)}
- icon={<IconTarget />}
- active={sourceProductFilter.length > 0 || scoutFilter.length > 0}
- >
- {INBOX_SOURCE_OPTIONS.map((option) => (
- <div key={option.value}>
- <FilterItem
- icon={option.icon}
- label={option.label}
- active={sourceProductFilter.includes(option.value)}
- onClick={() => toggleSourceProduct(option.value)}
- />
- {option.value === 'signals_scout' && scoutNames.length > 0 && (
- <ScoutSubFilter
- scoutNames={scoutNames}
- scoutFilter={scoutFilter}
- onToggle={toggleScout}
- onClear={clearScoutFilter}
- />
- )}
- </div>
- ))}
- </FilterPopover>
-
- <FilterPopover
- label="Priority"
- value={inboxPriorityFilterLabel(priorityFilter)}
- icon={<IconFlag />}
- active={priorityFilter.length > 0}
- >
- {INBOX_PRIORITY_OPTIONS.map((priority) => (
- <FilterItem
- key={priority}
- icon={
- <span
- className="size-2 rounded-full"
- // eslint-disable-next-line react/forbid-dom-props
- style={{ backgroundColor: PRIORITY_ACCENT[priority] }}
- />
- }
- label={
- <span>
- {priority}
- <span className="text-muted"> · {PRIORITY_MEANING[priority].label}</span>
- </span>
- }
- active={priorityFilter.includes(priority)}
- onClick={() => togglePriority(priority)}
- />
- ))}
- </FilterPopover>
-
- {onRefresh && (
- <LemonButton
- type="secondary"
- size="xsmall"
- icon={<IconRefresh />}
- loading={refreshing}
- tooltip="Refresh"
- aria-label="Refresh"
- onClick={onRefresh}
- className="bg-surface-primary"
- />
- )}
- </div>
- </div>
- )
-}