: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): merge the scout detail page into one tab bar (#117615)
posthog[bot]0fce1e441704
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 700058cdc0bf..77df2aa08687 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -12167,29 +12167,29 @@ snapshots:scenes-app-inbox-scoutconfigform--weekly-schedule--light:hash: v1.k794b7964.62f1e75b6e6af2dcb9c7b76cdeb75e98a0b03fe621e0cef391b73127339c9647.Hgi_ML-SBs595LxTuUEXJ1tCsOvBIG2cz4U_cP7lVUoscenes-app-inbox-scoutdetailview--scout-page--dark:- hash: v1.k794b7964.3d4d74ea471b75106f6cb9f0d092c748dcf223f16ffe0e9f77ce0dac76bd9e4e.BO6fjgJJyc51UwDNdIXqx2CDmvELzew8gnvbwL8aYh0+ hash: v1.k794b7964.af12f933be7a8cf42bd706080819f7df9fc262dc192224e9b022bd8037a55a64.tg6xQCrfyh-4U_nT0uLnp3dqtTfCpbZEn5UYocgS9QAscenes-app-inbox-scoutdetailview--scout-page--light:- hash: v1.k794b7964.f2aa181cea89c680945676d94fb3ece1e1f1cdac71a1c85a31b994b1fb9890ff.QQ_K1NpWd1q-eF-8EOAgIdZweOPKX3hwln08MEZc3k0+ hash: v1.k794b7964.38853040ce8d5daacd23f3fa3705bc5b713f25b9a3c865bf1b77f94613813ca3.9SNuf8gxuxm3lJOHX2RHMgyU38143eiAkjS4skfXZQUscenes-app-inbox-scoutdetailview--scout-page-narrow-run-history--dark:- hash: v1.k794b7964.1a4398eac8db3788f3472b757e624696141f9faa72e1d412be07bebdb66de430.dACK5-ydRNWXFX0iwp4FmXfeZUv0jGEFB67MiFzQgJ0+ hash: v1.k794b7964.cd74619e7ed6b96f08e12783eafba48cf28478049f486b1c11c28e1e7d26d0e4.MxU1wyjdZ9w-r7aRp1KUsHNGNIwfzsJ6T30hBtLxHzwscenes-app-inbox-scoutdetailview--scout-page-narrow-run-history--light:- hash: v1.k794b7964.8bd12f695e885047359472c0355c7d4f56c93869dd847d88e1df8a12cfa03bb7.ZpJ0zEBsmhddLYuc8e14aZQnxKzpPxTjI7nFIvn_nJs+ hash: v1.k794b7964.0630377060dbbcc5b0dfca8750b88df86088b4a26872b52683cd005d6e4d5ee4.4H9HNihF5kGdUubZZVkRmgcKzsm6pXwjP-bJ2Y7VqSAscenes-app-inbox-scoutdetailview--scout-page-no-reports--dark:- hash: v1.k794b7964.ec383f6e0f81a76fa1b483abb5915f32027485ba918cf486bce5de2d578ac90f.32XIDfgNNP8rFJFathnkfROTykcr8LPVulxn1vQ1_C4+ hash: v1.k794b7964.93ae979dddb80c5efc36b79b3f32520410b9e5aacb49190bd8bce892a5041ae7.ElR4R2uy_RK5YYbQBTMPRTWu_jWUc64DCGcRy_5gp9Ascenes-app-inbox-scoutdetailview--scout-page-no-reports--light:- hash: v1.k794b7964.47e611768c3fa52f1863097b67aba15eb504a65932f30d034b4770b5d11f6c8e.bpN2emdQtG8w8fcnS4fzTocp_v5YPDamzuFHyN9Qu8g+ hash: v1.k794b7964.bf4ecca30f13c3c2b8cc36fa3019a19e22c42a88ee94f77f50599d19a99e648d.W6zbj9_SnRrz1TWBGotZLemo000iYsSJnE6m8mTsXscscenes-app-inbox-scoutdetailview--scout-page-non-staff--dark:- hash: v1.k794b7964.e70b731168a680d148a5d576ef9611345d00428df5444703ef33ade496e7bd80.9jvQOv4iAYtCuJCZBslHuCqL3mbbvz87bVtdDxufEO0+ hash: v1.k794b7964.9b96e6f1be1795608a4291d7f7f96e9bc7ba3cfcb1808c42dd00808721a97ce7.dcePYQ9Ryjxs2sjbrs9VK2NusiiKEMxymfo9vfoQ_ZUscenes-app-inbox-scoutdetailview--scout-page-non-staff--light:- hash: v1.k794b7964.5119d04aa5317d237e23beaba3aa962b61c34bf892a7c5805896b2ff7555cf9c.6Bcj0DHNeqiJFU9DLfFQBRrmgIt48A1nAjLjbfDphvI+ hash: v1.k794b7964.99cb124c9205bf56dc3ee16ba35cebb6d0c3d32f22066c663ad1fe249ee65304.w6PLdtozCHRwebxj1qmc5qW-5olaXuIs8I4fV1Dp8r0scenes-app-inbox-scoutdetailview--scout-page-trials--dark:- hash: v1.k794b7964.738b8073ef76e0dee935d13b808a3bb76192e22ef34ffe09cce1ff741caf6c9a.GHeipsKTSvEWz5NFjLkZplR6F1KU4EsYsrsHwS1EnSo+ hash: v1.k794b7964.52eeb7b3afc8610d1694827cfcb426cda2020373837006e759eb5ec63e49747d.qCanqI0__u7ATyzZyHwBGdQfNGkf17tjOqupP8iUHdgscenes-app-inbox-scoutdetailview--scout-page-trials--light:- hash: v1.k794b7964.062c8ee1d81c4bbcb5af658980ca450f6ab88fc5314d34edceb299d69f087ba9.rCQR-BH8Y3AqDUfsfaHilKTNPqV_fErn8lru2FjFMpM+ hash: v1.k794b7964.5946d40e9188aa3aa83d55de1aacec69e9b14b1f129fdbf34fb88eeeec5d0e19.y8gMya_TLfhafRqmrhfK-0gjf6iku4w8RLJwYuay6csscenes-app-inbox-scoutdetailview--scout-page-trials-narrow--dark:- hash: v1.k794b7964.972f5987327f397cbd72e9da1f433713a4fb0287cdc23b6ff627cfa31261b2ed.UTwItZYgqbtONSRmMw3bAV1D_pQsmFZt5anFnXzdwkw+ hash: v1.k794b7964.e87148d6e9c7bf4ab1eadd958d709fd0383e9ac603097166b73987cdfbbc6d16.fIJ-jRh34SvxC-IXvZs_CvLfqurWXQu5bErnZa0NsCcscenes-app-inbox-scoutdetailview--scout-page-trials-narrow--light:- hash: v1.k794b7964.048f70ef87a1af67d29cbf5d1833ba72690502b98cd4255d3acb3e47b4bc8c99.RytXH4qouNV8o7tusjPtI_b2Q7_CanQfeC1qgCWm-X4+ hash: v1.k794b7964.76a8f07bd0691c5c2358626e19a57ce4335186d3eb5ab2f03be6e46e7d5651fb.jREnparZoFM-Pp0MGzKuKmSH1rFoHtldUEYTNtzP9xEscenes-app-inbox-scoutmcpserverspicker--create-dialog-variant--dark:hash: v1.k794b7964.afe2203f4dd53373a3203fcfa611b5b65555341bdc2fc7fd73c15c2d83914600.O4kSRnOgICuQDkyD2HJCwBXdzE-KwsfzWT98nm43_5Ascenes-app-inbox-scoutmcpserverspicker--create-dialog-variant--light:diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsxindex 04a2546f88ec..e616764682ac 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutDetailHeader.tsx@@ -205,6 +205,7 @@ export function ScoutDetailHeader({<ScoutExemptionBadge config={config} group="watching" /><ScoutOwners config={config} /><span className="flex-1" />+ <LeaveScoutNoteButton skillName={config.skill_name} /><LemonButtontype="secondary"size="small"diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutDetailView.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutDetailView.tsxindex 56b7bf829f0a..4e6587268b30 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutDetailView.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutDetailView.tsx@@ -21,18 +21,11 @@ import { ScoutAskAiComposer } from './ScoutAskAiComposer'import { ScoutAttentionBanner, ScoutDetailHeader } from './ScoutDetailHeader'import { ScoutEmissionCard } from './ScoutEmissionCard'import { ScoutLearnedPanel } from './ScoutLearnedPanel'-import { LeaveScoutNoteButton, ScoutNotesPanel } from './ScoutNotesPanel'+import { ScoutNotesPanel } from './ScoutNotesPanel'import { ScoutReportCard } from './ScoutReportCard'import { ScoutRunFilterPills, ScoutRunHistorySection } from './ScoutRunHistorySection'import { ScoutTrials } from './trials/ScoutTrials'-/** The two panes that sit in the right rail at full width, and join the main tab bar below it. */-const RAIL_TABS: ScoutDetailTab[] = ['told', 'learned']--function isRailTab(tab: ScoutDetailTab): boolean {- return RAIL_TABS.includes(tab)-}-/*** One scout's page, at `/inbox/scouts/:skillName`. The header says whether the scout is worth* keeping on; tabs below it hold what it produced (Reports, Runs, Signals) and what it carries@@ -54,22 +47,6 @@ export function ScoutDetailView({ skillName }: { skillName: string }): JSX.Elemeconst { currentTeamId } = useValues(teamLogic)const { setScoutDetailTab } = useActions(inboxSceneLogic)const [runFilter, setRunFilter] = useState<ScoutRunFilter>('all')- // Above the breakpoint both tab bars are on screen, so a click in one has to leave the other- // where it was. The URL has room for one pane, the one the last click opened, so each column- // also keeps its own last pane here. Following the URL rather than the click keeps these right- // through a Back press, which moves the pane without going through the bar.- const [mainColumnTab, setMainColumnTab] = useState<ScoutDetailTab | null>(null)- const [railColumnTab, setRailColumnTab] = useState<ScoutDetailTab>('told')- useEffect(() => {- if (!scoutDetailTab) {- return- }- if (isRailTab(scoutDetailTab)) {- setRailColumnTab(scoutDetailTab)- } else {- setMainColumnTab(scoutDetailTab)- }- }, [scoutDetailTab])// Deep-linking straight to a scout (or a narrow viewport where the roster isn't mounted)// means nobody else is polling the runs window, so the header + rollup would read empty@@ -91,8 +68,8 @@ export function ScoutDetailView({ skillName }: { skillName: string }): JSX.Eleme// Reports leads for a scout that files them, because that is what the scout is for; Runs leads// for the rest. Held until the runs window settles, so the default doesn't move under a reader// a beat after the page opens.- const defaultMainTab: ScoutDetailTab = !scoutRunsLoadedOnce || reportCount > 0 ? 'reports' : 'runs'- const tab = (scoutDetailTab === 'trials' && !canAccessTrials ? null : scoutDetailTab) ?? defaultMainTab+ const defaultTab: ScoutDetailTab = !scoutRunsLoadedOnce || reportCount > 0 ? 'reports' : 'runs'+ const tab = (scoutDetailTab === 'trials' && !canAccessTrials ? null : scoutDetailTab) ?? defaultTabconst scoutName = config ? scoutDisplayName(config) : null// Registered by the page as well as the AI panel, so the scout is already attached when the@@ -181,9 +158,6 @@ export function ScoutDetailView({ skillName }: { skillName: string }): JSX.Elemeconst signalCount = emissionRows.lengthconst runCount = rollup?.runs.length ?? 0const windowEmittedCount = rollup?.emittedCount ?? 0- const previousMainTab = mainColumnTab === 'trials' && !canAccessTrials ? null : mainColumnTab- const mainTab = isRailTab(tab) ? (previousMainTab ?? defaultMainTab) : tab- const railTab = isRailTab(tab) ? tab : railColumnTabconst switchTab = (next: ScoutDetailTab): void => {captureScoutAction({@@ -201,118 +175,64 @@ export function ScoutDetailView({ skillName }: { skillName: string }): JSX.Eleme// can fail outright, and hiding the tab then would say the scout emitted nothing while its// panel is the only place that reports the failed fetch. Whichever pane is open also keeps its// tab, so a link naming a pane this scout has none of still has a tab to select.- const mainTabs = [- (!scoutRunsLoadedOnce || reportCount > 0 || mainTab === 'reports') && {+ const tabs = [+ (!scoutRunsLoadedOnce || reportCount > 0 || tab === 'reports') && {key: 'reports' as ScoutDetailTab,label: `Reports ${reportCount}`,},{ key: 'runs' as ScoutDetailTab, label: `Runs ${runCount}` },- canAccessTrials && {- key: 'trials' as ScoutDetailTab,- label: 'Trials',- 'data-attr': 'scout-detail-trials-tab',- },- (!scoutRunsLoadedOnce || windowEmittedCount > 0 || mainTab === 'signals') && {+ (!scoutRunsLoadedOnce || windowEmittedCount > 0 || tab === 'signals') && {key: 'signals' as ScoutDetailTab,// The window's count stands in until the rows land, so a failed fetch is not labelled// zero beside a panel that says the fetch failed.label: `Signals ${signalCount > 0 ? signalCount : windowEmittedCount}`,},- ]- const railTabs = [{ key: 'told' as ScoutDetailTab, label: `Told ${toldCount}` },{ key: 'learned' as ScoutDetailTab, label: `Learned ${learnedCount}` },+ canAccessTrials && {+ key: 'trials' as ScoutDetailTab,+ label: 'Trials',+ 'data-attr': 'scout-detail-trials-tab',+ },]- const mainPanel = (which: ScoutDetailTab): JSX.Element =>- which === 'runs' ? (- <ScoutRunHistorySection skillName={skillName} filter={runFilter} />- ) : which === 'trials' && canAccessTrials ? (- <ScoutTrials configId={config.id} />- ) : which === 'signals' ? (- <ScoutSignalsPanel skillName={skillName} />- ) : (- <ScoutReportsPanel skillName={skillName} />- )-- const railPanel = (which: ScoutDetailTab): JSX.Element =>- which === 'learned' ? <ScoutLearnedPanel skillName={skillName} /> : <ScoutNotesPanel skillName={skillName} />+ const runFilterPills = <ScoutRunFilterPills skillName={skillName} filter={runFilter} onChange={setRunFilter} />return (<div className="@container flex min-h-0 flex-1 flex-col overflow-auto"><ScoutDetailHeader config={config} rollup={rollup} noteCount={toldCount} learnedCount={learnedCount} /><ScoutAskAiComposer skillName={skillName} scoutName={scoutDisplayName(config)} />- <div className="grid grid-cols-1 items-start gap-4 px-4 py-4 @4xl:grid-cols-[minmax(0,1fr)_20rem]">- <div className="flex min-w-0 flex-col gap-4">- <ScoutAttentionBanner config={config} />-- {/* Two tab bars for the same state: below the breakpoint the rail's panes have- nowhere to sit, so they join this bar rather than stacking under the run- list where nobody scrolls to them. */}- <div className="flex flex-col gap-1 @4xl:hidden">- <LemonTabs- activeKey={tab}- onChange={switchTab}- size="small"- tabs={[...mainTabs, ...railTabs]}- />- {/* The open pane's control gets its own row here rather than the bar's- right slot. This bar carries the rail tabs, and the slot does not shrink:- it pins over the tab strip and hides the rail tabs behind it. The note- button is repeated from the rail bar because the rail column itself is- not rendered at this width, which would leave the pane unwritable. */}- {tab === 'runs' && (- <ScoutRunFilterPills skillName={skillName} filter={runFilter} onChange={setRunFilter} />- )}- {tab === 'told' && (- <div className="flex">- <LeaveScoutNoteButton skillName={skillName} size="xsmall" />- </div>- )}- </div>- <div className="hidden @4xl:block">- <LemonTabs- activeKey={mainTab}- onChange={switchTab}- size="small"- tabs={mainTabs}- rightSlot={- mainTab === 'runs' ? (- <ScoutRunFilterPills- skillName={skillName}- filter={runFilter}- onChange={setRunFilter}- />- ) : undefined- }- />- </div>-- {isRailTab(tab) ? (- <>- <div className="@4xl:hidden">{railPanel(tab)}</div>- <div className="hidden @4xl:block">{mainPanel(mainTab)}</div>- </>- ) : (- mainPanel(tab)- )}- </div>+ <div className="flex min-w-0 flex-col gap-4 px-4 py-4">+ <ScoutAttentionBanner config={config} />- <div className="hidden min-w-0 flex-col gap-4 @4xl:flex">+ <div className="flex flex-col gap-1">+ {/* The right slot does not shrink. In a narrow pane it would pin over the tab+ strip and hide the last tabs, so there the pills get their own row. */}<LemonTabs- activeKey={railTab}+ activeKey={tab}onChange={switchTab}size="small"- tabs={railTabs}- rightSlot={- railTab === 'told' ? (- <LeaveScoutNoteButton skillName={skillName} size="xsmall" />- ) : undefined- }+ tabs={tabs}+ rightSlot={tab === 'runs' ? runFilterPills : undefined}+ rightSlotClassName="hidden @4xl:flex"/>- {railPanel(railTab)}+ {tab === 'runs' && <div className="@4xl:hidden">{runFilterPills}</div>}</div>++ {tab === 'runs' ? (+ <ScoutRunHistorySection skillName={skillName} filter={runFilter} />+ ) : tab === 'trials' && canAccessTrials ? (+ <ScoutTrials configId={config.id} />+ ) : tab === 'signals' ? (+ <ScoutSignalsPanel skillName={skillName} />+ ) : tab === 'told' ? (+ <ScoutNotesPanel skillName={skillName} />+ ) : tab === 'learned' ? (+ <ScoutLearnedPanel skillName={skillName} />+ ) : (+ <ScoutReportsPanel skillName={skillName} />+ )}</div></div>)diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutLearnedPanel.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutLearnedPanel.tsxindex 9a60e3eb94e2..7a4cf466bdbb 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutLearnedPanel.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutLearnedPanel.tsx@@ -49,21 +49,18 @@ export function ScoutLearnedPanel({ skillName }: { skillName: string }): JSX.EleNothing yet. Scouts write here when they settle on a baseline or rule something out.</div>) : (- <>+ <div className="flex flex-col rounded border border-primary bg-surface-primary">{visible.map((entry) => (<ScratchpadEntryCard key={entry.key} entry={entry} titled />))}{entries.length > visible.length && (- <LemonButton- size="xsmall"- type="tertiary"- className="self-start"- onClick={() => setShowAll(true)}- >- Show all {pluralize(entries.length, 'entry', 'entries')}- </LemonButton>+ <div className="px-3 py-2">+ <LemonButton size="xsmall" type="tertiary" onClick={() => setShowAll(true)}>+ Show all {pluralize(entries.length, 'entry', 'entries')}+ </LemonButton>+ </div>)}- </>+ </div>)}<LemonButton size="xsmall" type="tertiary" className="self-start" onClick={() => setScratchpadOpen(true)}>All scoutsdiff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutNotesPanel.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutNotesPanel.tsxindex 35aec44b8122..77f1a61e4fe0 100644--- a/products/signals/frontend/inbox/components/config/scouts/ScoutNotesPanel.tsx+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutNotesPanel.tsx@@ -96,7 +96,7 @@ function LeaveNoteDialog({})}-/** Opens the note composer. Sits in the scout page header and above the notes panel. */+/** Opens the note composer. Sits in the scout page header and in the attention banner. */export function LeaveScoutNoteButton({skillName,size = 'small',diff --git a/products/signals/frontend/inbox/components/scratchpad/ScratchpadEntryCard.tsx b/products/signals/frontend/inbox/components/scratchpad/ScratchpadEntryCard.tsxindex 9f5734d7a357..96e7063fd4e5 100644--- a/products/signals/frontend/inbox/components/scratchpad/ScratchpadEntryCard.tsx+++ b/products/signals/frontend/inbox/components/scratchpad/ScratchpadEntryCard.tsx@@ -15,7 +15,7 @@ import { stripScoutPrefix } from '../../utils/scoutRunsWindow'import { KIND_TAG_TYPE, scratchpadKindOf } from '../../utils/scratchpadKeys'/**- * One scratchpad entry, as the scout page's memory panel shows it. Shares the collapse/expand+ * One scratchpad entry, as a row of the scout page's Learned list. Shares the collapse/expand* grammar of the scout emission cards: a header (chevron · kind · key · expiry · updated time) that* stays visible, a 2-line preview when collapsed, the full body plus an attribution footer (which* scout created it, when, and how long it's been carried forward) when open.@@ -27,7 +27,7 @@ import { KIND_TAG_TYPE, scratchpadKindOf } from '../../utils/scratchpadKeys'* the storage key drops out. Every entry there belongs to that scout, so a truncated key says less* than the name the scout gave the learning.*- * The fleet-wide panel uses a ledger table instead; this card is the compact per-scout shape.+ * The fleet-wide panel uses a ledger table instead; this row is the compact per-scout shape.*/export function ScratchpadEntryCard({entry,@@ -57,11 +57,11 @@ export function ScratchpadEntryCard({entry.created_at && entry.updated_at ? dayjs(entry.updated_at).diff(dayjs(entry.created_at), 'day') : 0return (- <div className="flex flex-col rounded border border-primary bg-bg-light">+ <div className="flex flex-col border-b border-primary last:border-b-0"><buttontype="button"onClick={() => toggleEntry(entry.key)}- className="flex items-center gap-2 px-3 py-2 text-left"+ className="flex items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-surface-secondary"aria-expanded={expanded}><IconChevronDowndiff --git a/products/signals/frontend/inbox/inboxSceneLogic.ts b/products/signals/frontend/inbox/inboxSceneLogic.tsindex efbd1150db2a..1a361c88fbd3 100644--- a/products/signals/frontend/inbox/inboxSceneLogic.ts+++ b/products/signals/frontend/inbox/inboxSceneLogic.ts@@ -145,9 +145,7 @@ export function mergeSignalRuns(scoutRuns: SignalScoutRunSummary[], signalTasks:}/**- * Which pane of the scout detail page is open. The main column holds Reports, Runs, Trials and Signals; the- * rail holds Told and Learned. One value covers both, because below the detail page's container- * breakpoint the rail's tabs join the main tab bar and only one pane shows at a time.+ * Which pane of the scout detail page is open. One tab bar holds every pane, so one pane shows at a time.** `null` means nobody has chosen: the page picks Reports when the scout has any, else Runs.*/