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.

fix(autoresearch): put detail-tab sections on white cards (#115272)

posthog[bot]49dfa25b2e19
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index f1051b2963a7..359b479666a1 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6563,57 +6563,57 @@ snapshots:
products-autoresearch-lifecycle-strip--validated-champion--light:
hash: v1.k794b7964.131ecc736b38defef5b8ba34fa9836f1d2d5132e1d109e4b995b9591a5d9255c.759giT71A_8sdMCqx-FasPgdZzZWHgRvaoUmqVtYYKw
products-autoresearch-model-detail-scene--accuracy--narrow--dark:
- hash: v1.k794b7964.bba5cd4781b922d63c9ec2892f96e47be92348f60b13c89e4c27589e1f9bc19f.1LLSE4lMVlwoDHZhRR1CV5rQPwOUbKaTil-AwyfPJF8
+ hash: v1.k794b7964.0131fa2a83a07edaa2c861515efb408fe43304690fc5d5d38aa3816a3dd49a23.J9awvFmY6Pn1s-oWPqAnejGDIAwddfAHgY8xbNcFyJk
products-autoresearch-model-detail-scene--accuracy--narrow--light:
- hash: v1.k794b7964.d1cf885e94b7b5a8009a241e6c13566fe53e3b30c12a7a33488b2bafb72040a8.98ETMbotAyOoqoZT7kpGP1q4VY8iMc7Ex4tz2vOdhvw
+ hash: v1.k794b7964.3a8de6d5fad0b1f3e307af7bca498dd33b6a59bc89ce31d429a4cf066cf7128b.r5aiv5W6zb2ru9_PycWf1I6lMRQAf1RpYgzjFgexwxI
products-autoresearch-model-detail-scene--accuracy--wide--dark:
- hash: v1.k794b7964.a4dc11c6e77cbd7fcc56da0bed5d1510ddd037d12a3bb07a5eaa6f4362f3daa8.UON_fOX7Jn8GaEfs2Q8aXhxIT_ScAVBYzLfAP0neN34
+ hash: v1.k794b7964.22101685dac81aca3c1571f854015397be350c53305fb3869c7c26bf2b5a5917.3ig445ptf8q-cA0jvU0lo6sxJcgXMOpKnQzPrkjdmqw
products-autoresearch-model-detail-scene--accuracy--wide--light:
- hash: v1.k794b7964.d25c744b33325893085ff451db1857b0199ae81b31412d5cc10f4db4cb7fb78d.j8dOrAFot09FYopy_6ZgoV67BEQslHF1B5MkoowaZXw
+ hash: v1.k794b7964.8a9cfef58f60664cbac82a55c0d1e95651ee0ff147ab0f207badd7d4cb11b546.pFG9Zq4rulyBRBLHksTFzWMpsIX_jRMTR-Lw-yVTCZ8
products-autoresearch-model-detail-scene--accuracy-before-precision-recall--wide--dark:
- hash: v1.k794b7964.f5a93a008ee426539faf447233438616f02063130e0c8379504b2230c7fdc100.ZixG8syKynNL_4Xoxgwnai_dbR6DrhLIXpxLpqkfX1c
+ hash: v1.k794b7964.72015c93da744ac165c241ba268d7d8217f61294e15b794a5a49a26dae1651a0.-WLIXPLFx1bqZ38wxHMYgTkpik4ujwXsHjGL3RUsGvA
products-autoresearch-model-detail-scene--accuracy-before-precision-recall--wide--light:
- hash: v1.k794b7964.8889f1c4e0c4f7508bb25824f85c560042338ccba9cd9a92635b7ad7554cc7cb.lo2fwfoTjLpSjmz00TsOd2j-IousiuI0Ia3Xfr9wCZs
+ hash: v1.k794b7964.a2cb6200ea532a239a92826eea1e652bf90631cff34f043b6d8a11b52e7e1e34.3Fmsd_-HZsxTxIyp-hJXbhJmfolQnhq8rB1UbuE118w
products-autoresearch-model-detail-scene--agent-research-narrow--narrow--dark:
- hash: v1.k794b7964.f93d956dd6b2730aab90a6814c2390b8da4a91de458519de984f47d3d3326121.oR9SFhtaCjj8t3wbQ6h-XXcszi43-OrREfNKHnNYS0A
+ hash: v1.k794b7964.30d2a61a4d85714b8aa85d7a3551956a34d963b3c08fdf8543bac8ff298e393d.JWWJ93sVqwsvhTlOfR5BbtFkHXWx_0vKG74yU5gFln0
products-autoresearch-model-detail-scene--agent-research-narrow--narrow--light:
- hash: v1.k794b7964.2d76141982d2dece38447c9a26a7ad138d202ace1db4197b1b5d2d1fd250fc68.fCWrbW3ZWUteQtH2RaWa6VGb9cTIdUeZT0VN2WLdcnk
+ hash: v1.k794b7964.5e6ac0591a15b387087c35a38c222364782bc217a38492f36ade0bd177319b71.Rf99y4ns4bgamhRDXrjUtWkUphR-21ps5-z2zKrui6s
products-autoresearch-model-detail-scene--agent-research-wide--wide--dark:
- hash: v1.k794b7964.f84ea27477df5109cad15751a24757be85a8ab7a0cd98573aa1b75504168c4be.6eO8edXltWaPVrCnv3nA7Y7tXuyp9wyabFTcatdausQ
+ hash: v1.k794b7964.b74d014f7df17eae944c2d1617c9c5f7f5dca7e0fd47118ee1c79586722fae82.LMBrryOp9NjhaqHO9d7I9QkJmAQ5Vyy3sFfUvkGWdxQ
products-autoresearch-model-detail-scene--agent-research-wide--wide--light:
- hash: v1.k794b7964.22e7923d51837968f8a2b8b50728a16424d62bd29de3c1ffafcc9b4b1b9b11d8.V3K-9qrGu3L0Kw3P5AIugEk9mSooVKtHXMjzAXutmyQ
+ hash: v1.k794b7964.a8249c53caa4af1687731fd2fd05785c8edf78cdb4e9c8c1250bb064585249ca.G_lrb4ODihzN6JFOpzGe1T2zGGhL_54bVGOc2XE7BQk
products-autoresearch-model-detail-scene--coverage-below-cap--narrow--dark:
- hash: v1.k794b7964.4e43edc26f1f7617df0b9ab5a0461a452ffeaaac42866cf177de7d6a37ef9f57.HuUUWBynAYTLHQ0baecnM7XmuDjZK848f3l4QSwlyKA
+ hash: v1.k794b7964.152ee821492c266c89b740640ef7a91a4f67257a384bc2c6d526cc84df685d14.Rw2tjHmhWsFwm2-n-i1sOVP227F8AkhWTS4Lt96rV8k
products-autoresearch-model-detail-scene--coverage-below-cap--narrow--light:
- hash: v1.k794b7964.25c1e3a691cdce3afc6707117290f5f9baf78f32ea6665cc4fd314d46b2b8212.4lZJM_CKAmsI1z7VkYRae4ZyvdSGzJNhWH1bZhEB9h0
+ hash: v1.k794b7964.8b85874a8510cc9ac620a6360f915ef9fad9ff9168381f153b4476edeb257305.7lEqS90V1PKLx7mI-kuNhYFrm7FvermoDgbRKCG-_tA
products-autoresearch-model-detail-scene--coverage-below-cap--wide--dark:
- hash: v1.k794b7964.5625b06041f958263a883741de07e56e0ea22b9f3f600ea2e9952146fdfc7c1c.B3cnfe1hT3J2-vnea-5ImDGE_mVpyiwAsnJQMabJq_8
+ hash: v1.k794b7964.2a7460ae7c4eae10331edb2e54a10bf944932a01ad4b8d1eb408dede6d05ee03.vHL1FF5inDvRNfzNWYhL6HOINnyNZlH-lwP5f0mSiFE
products-autoresearch-model-detail-scene--coverage-below-cap--wide--light:
- hash: v1.k794b7964.1f350c2f315f0ca74330604ae35b7ccc2d77d52bc18da09a34a2d8b9c09eeba7.lo43kMkTZGhgkWNOd7Fz1Iaqq89uLS41teZFQ3yLS_c
+ hash: v1.k794b7964.714b9d38ec4d9a9951aa6a264ceccc95770029fbf21e67f0fe4fde230c9e1f2e.ZjOuLQQvIgd_YVEMe2FGnlm2YM_nOGrYNxSkcwiFRvM
products-autoresearch-model-detail-scene--coverage-rolling-mid-cycle--narrow--dark:
- hash: v1.k794b7964.1517002a8859c840f3d8e3c8b51dde48c0c0c8a74358a7b1e754bd0af324a176.UE5BH4Oult8tdMzFZGekiaFsTMS-9Ln4UIAiCj8CYWE
+ hash: v1.k794b7964.0e9f6a634a0ce036704e1ae40a3a269e520bb35965107459543d845835129f58.8wO2TTB9MQvDYz419LZaHyj792zNN0nuSgWi9IOkcpI
products-autoresearch-model-detail-scene--coverage-rolling-mid-cycle--narrow--light:
- hash: v1.k794b7964.f30ac4dfeb1017151451c962d7bf71fd7c3b83b3e320a0e2a15fae4d0fe3e496.9Mw-jnr4jRd339DlsAOgqYUwO7gB4QSYaRgpqr4Y8ko
+ hash: v1.k794b7964.600621aa236383eef70dc1f93a10227a8ce6dbdcd52647237d8c9bcb8cdbfe9e._-R_fAQOI97_1m_hsbtEMILj9l19VGbisuIuqd_69zo
products-autoresearch-model-detail-scene--coverage-rolling-mid-cycle--wide--dark:
- hash: v1.k794b7964.233b87d1bd3b880f00bbd5dd385bb225a1ef0725e5e9e946911584ab5a262919.ZeZSguEir_06IeQ6UJFGk3DmOX1opgTemvy0KlnExkU
+ hash: v1.k794b7964.905ec0ac29c887b94f15d33abc76ca9f5e104755d4bfacdfb79fe4c446faf717.0xSOAyw0fVXIixI_a_XNfUJCqZotC9W9mgvMNILdwzA
products-autoresearch-model-detail-scene--coverage-rolling-mid-cycle--wide--light:
- hash: v1.k794b7964.9a390abbd9cd9129d3bb994ac0d7fba2c42f24c86772158913344485c49f4193.h4A9K-TQ4HjDqfrIN1XY3V3tQpgFlqb3T-7qngIEQeE
+ hash: v1.k794b7964.a972f40d1aee3ed43147f57b29cbdd13c2a4e4dd58dc9e763ef91573990e883c.u_XZhFTgtkJ9TQiWD-06D9JQD1zFKUpuLKT8KRKchsY
products-autoresearch-model-detail-scene--coverage-with-failed-runs--narrow--dark:
- hash: v1.k794b7964.dcfa2bfa839b6f5d53dffed1cb9ef1169e16609769bd6bf3fe0e539adb3e7d8d.9wEtUCYRaHsi-F7vzlHxY0EFCotO9CYzn0OOCz7j4aM
+ hash: v1.k794b7964.5c238af99fab1ef0a4bef33f7837051ff977331581e39db887102bd673d2b895.bOwR6Kx4sbqPEEBS0t_ZcOqavzfAZ6gDOuA6z333akQ
products-autoresearch-model-detail-scene--coverage-with-failed-runs--narrow--light:
- hash: v1.k794b7964.2f67bcc8bc73793f78e3924e3baeb8b9d3e4b0d636f28f215ad224738e915ef9.wiTTfZkL7qs10VhXsEW9a0FTsWIEEHeywcih7NVXdv8
+ hash: v1.k794b7964.fcc55a250637ae170122988f33efb7fffb8bb56e5c35317adf7456eb1f84387c.9eZcjMzAx5TX821Zl8bvWDoL3QSkSw-fNCzb4xKClF4
products-autoresearch-model-detail-scene--coverage-with-failed-runs--wide--dark:
- hash: v1.k794b7964.243216a8469f3ff645764447f893ff8f2ab5559494ef6318ddf437bbd1006f23.2OdjhN4lHq_UEfdYlZindTaOHce4vh6IjSrllT7R3sI
+ hash: v1.k794b7964.d370442d7b2b91bbe29e09f1b1b184ac10568bc946ab58c013a14e6de3dbc5b2.YA1HzZ9gKlsmt3z8W_SPF36y32G75KrRlPjGDpxIn1w
products-autoresearch-model-detail-scene--coverage-with-failed-runs--wide--light:
- hash: v1.k794b7964.ed9f0633f2e496a16e293b395f692fd69a5ba492a6d8b3296385b7e7368f12ab.ZeInQ-roAfD25wO3YNElEDBAH8nsa4Twq-kN1Yb4suM
+ hash: v1.k794b7964.7fb45eaa6040a6f20dd015543842635fc88d068203a295d299dbf302f418032b.56I2KWH6Azy_G23S1LLxllPyaNcvRh9Qdt62a1VgvqE
products-autoresearch-model-detail-scene--narrow--narrow--dark:
- hash: v1.k794b7964.c3ef7f3a7938bef4e0d2e04069fdbeaeb4e7fdfeae799b961d157116e6462a08.J7paTdt4-VUAMfE_MVamn2piXgtLZF7XgWXmMA1xwwU
+ hash: v1.k794b7964.8c38dd469af3a3c2fa3003ce281be5d58987209adf0c8aace518f7880dca44a7.XiFUy5mYsM23iEy1LSGhGBbAbK-1ipKxZa4tEAhiGQs
products-autoresearch-model-detail-scene--narrow--narrow--light:
- hash: v1.k794b7964.9c294b354388a47476fab373631d06c696fee66142f22e0a214abe72e79bfb7d.GPXydv4tanlj-nCL2fpFVDBlN6QbYb9GPsAQDoB25bA
+ hash: v1.k794b7964.0cc69b5560f729652f3ba1734ba4b2eedcc50cc20a24c7396bf6aadf9c9ed0d0.rjxp-hLAgxYedXpksnvsbqnWC3pqDz_V9mc9aoyTW84
products-autoresearch-model-detail-scene--wide--wide--dark:
- hash: v1.k794b7964.666220372bba1865f19d61c88c6364aac2b1f19b07e97c45f4b2e55dcf96e0da.3dNk60c4eKV_ocxKLKSbNqw2VBot_GNxf5gRf9KhWqU
+ hash: v1.k794b7964.0a93aadb03edbceced1fe280d5ee0914b6bb6b943027df848a0700f0a8e4584e.dFrYrbOfMUuIt7x-RUa8XWGWWhYkLphH7G6GCWPr7iI
products-autoresearch-model-detail-scene--wide--wide--light:
- hash: v1.k794b7964.614d0667fdb8e4c424f5054c49281725df8e5cb28f1e981f7476594adfd50510.0Y7BmV2ztuwUZWtNnISERLoQ-G7ukfSYOt5WaErWRwE
+ hash: v1.k794b7964.80ebf1b109236a53138a1337174cc37670ac9bc84bdc0c14845e78d1c75e172a.aG-YLj2Raw4ZMUX3ARP5Wn5VINR7WioYSrAw0R2WzS8
products-autoresearch-probability-histogram--bimodal--dark:
hash: v1.k794b7964.f95d3982e7c08f2e1b51655520f15e37293aa98e5ca87126a5653d2300bd776b.2G0LsuSx-SLqWn1Oxm_bUHSqfeDPFF6Pof0vDvhZEHM
products-autoresearch-probability-histogram--bimodal--light:
diff --git a/products/autoresearch/frontend/pipeline/AgentNotes.tsx b/products/autoresearch/frontend/pipeline/AgentNotes.tsx
index 5c73cb16ad1a..ca21eba8884e 100644
--- a/products/autoresearch/frontend/pipeline/AgentNotes.tsx
+++ b/products/autoresearch/frontend/pipeline/AgentNotes.tsx
@@ -3,6 +3,7 @@ import { useValues } from 'kea'
import { LemonCollapse } from '@posthog/lemon-ui'
import { autoresearchPipelineLogic } from '../autoresearchPipelineLogic'
+import { SectionCard } from './SectionCard'
/** What the newest completed run learned, and what comes next. Renders nothing before any notes exist. */
export function AgentNotes(): JSX.Element | null {
@@ -15,8 +16,7 @@ export function AgentNotes(): JSX.Element | null {
const hasReaderNotes = !!readerSummary || nextSteps.length > 0
const hasWorkingNotes = !!distillation || !!recommendedNext
return (
- <div className="border rounded p-3 space-y-2">
- <div className="text-sm font-semibold">What the agent learned</div>
+ <SectionCard title="What the agent learned">
{hasReaderNotes ? (
<>
{readerSummary && <div className="text-sm">{readerSummary}</div>}
@@ -57,6 +57,6 @@ export function AgentNotes(): JSX.Element | null {
</>
)}
<div className="text-xs text-muted">From run {runNumber}</div>
- </div>
+ </SectionCard>
)
}
diff --git a/products/autoresearch/frontend/pipeline/AgentSearchChart.tsx b/products/autoresearch/frontend/pipeline/AgentSearchChart.tsx
index fca4ba72a801..3c7cae9068cb 100644
--- a/products/autoresearch/frontend/pipeline/AgentSearchChart.tsx
+++ b/products/autoresearch/frontend/pipeline/AgentSearchChart.tsx
@@ -9,6 +9,7 @@ import { useChartTheme } from 'lib/charts/hooks'
import { type SearchPoint, formatDelta, searchYDomain } from '../agentSearch'
import { autoresearchPipelineLogic } from '../autoresearchPipelineLogic'
import { AgentSearchOverlay } from './AgentSearchOverlay'
+import { SectionCard } from './SectionCard'
const STATUS_LABEL: Record<SearchPoint['status'], string> = {
kept: 'Kept',
@@ -74,13 +75,10 @@ export function AgentSearchChart(): JSX.Element | null {
}
return (
- <div className="border rounded p-3 space-y-2">
- <div>
- <div className="text-sm font-semibold">How the agent found it</div>
- <div className="text-xs text-muted">
- Each dot is one experiment. The agent keeps a change only when it beats the best score so far.
- </div>
- </div>
+ <SectionCard
+ title="How the agent found it"
+ description="Each dot is one experiment. The agent keeps a change only when it beats the best score so far."
+ >
<div className="h-64 min-w-0 flex flex-col">
<ScatterChart
series={series}
@@ -116,6 +114,6 @@ export function AgentSearchChart(): JSX.Element | null {
<AgentSearchOverlay search={agentSearch} />
</ScatterChart>
</div>
- </div>
+ </SectionCard>
)
}
diff --git a/products/autoresearch/frontend/pipeline/ConfusionMatrixCard.tsx b/products/autoresearch/frontend/pipeline/ConfusionMatrixCard.tsx
index 73183728fa9d..4e7af29472fc 100644
--- a/products/autoresearch/frontend/pipeline/ConfusionMatrixCard.tsx
+++ b/products/autoresearch/frontend/pipeline/ConfusionMatrixCard.tsx
@@ -7,6 +7,7 @@ import { dayjs } from 'lib/dayjs'
import { autoresearchPipelineLogic } from '../autoresearchPipelineLogic'
import { ACCURACY_CUTOFFS, PooledConfusion, percent } from '../onlinePerformance'
import { MetricCard } from './MetricCard'
+import { SectionCard } from './SectionCard'
function dateRange({ firstDate, lastDate }: PooledConfusion): string {
const last = dayjs(lastDate).format('MMM D, YYYY')
@@ -29,11 +30,9 @@ export function ConfusionMatrixCard(): JSX.Element {
const target = pipeline?.target_event ?? 'the target event'
return (
- <section className="space-y-2">
- <div className="flex flex-wrap items-center justify-between gap-2">
- <h3 className="text-sm font-semibold mb-0">
- Who the model flagged{confusion ? `, ${dateRange(confusion)}` : ''}
- </h3>
+ <SectionCard
+ title={`Who the model flagged${confusion ? `, ${dateRange(confusion)}` : ''}`}
+ actions={
<LemonSegmentedButton
size="small"
value={accuracyCutoff}
@@ -41,7 +40,8 @@ export function ConfusionMatrixCard(): JSX.Element {
options={ACCURACY_CUTOFFS.map(({ key, label }) => ({ value: key, label }))}
data-attr="autoresearch-model-accuracy-cutoff"
/>
- </div>
+ }
+ >
{!confusion ? (
<p className="text-sm text-muted mb-0">
Precision and recall start from the next checked date. Dates checked before that have no counts.
@@ -98,6 +98,6 @@ export function ConfusionMatrixCard(): JSX.Element {
)}
</>
)}
- </section>
+ </SectionCard>
)
}
diff --git a/products/autoresearch/frontend/pipeline/ExperimentLog.tsx b/products/autoresearch/frontend/pipeline/ExperimentLog.tsx
index acf1a1577e73..224279dc77bd 100644
--- a/products/autoresearch/frontend/pipeline/ExperimentLog.tsx
+++ b/products/autoresearch/frontend/pipeline/ExperimentLog.tsx
@@ -5,6 +5,7 @@ import { LemonButton, LemonSegmentedButton } from '@posthog/lemon-ui'
import type { ExperimentLogFilter } from '../agentSearch'
import { autoresearchPipelineLogic } from '../autoresearchPipelineLogic'
import { ExperimentLogEntry } from './ExperimentLogEntry'
+import { SectionCard } from './SectionCard'
import { TrainingRunRow } from './TrainingRunRow'
const FILTER_OPTIONS: { value: ExperimentLogFilter; label: string }[] = [
@@ -19,9 +20,9 @@ export function ExperimentLog(): JSX.Element {
const { experimentLogGroups, experimentLogFilter, expandedLogRunIds } = useValues(autoresearchPipelineLogic)
const { setExperimentLogFilter, toggleLogRun } = useActions(autoresearchPipelineLogic)
return (
- <div className="space-y-2">
- <div className="flex items-center justify-between gap-2 flex-wrap">
- <div className="text-sm font-semibold">Experiment log</div>
+ <SectionCard
+ title="Experiment log"
+ actions={
<LemonSegmentedButton
size="xsmall"
value={experimentLogFilter}
@@ -29,7 +30,8 @@ export function ExperimentLog(): JSX.Element {
options={FILTER_OPTIONS}
data-attr="autoresearch-experiment-log-filter"
/>
- </div>
+ }
+ >
{experimentLogGroups.map((group, index) => {
const showEntries = index === 0 || expandedLogRunIds.includes(group.run.id)
return (
@@ -64,6 +66,6 @@ export function ExperimentLog(): JSX.Element {
</TrainingRunRow>
)
})}
- </div>
+ </SectionCard>
)
}
diff --git a/products/autoresearch/frontend/pipeline/LiveModelCard.tsx b/products/autoresearch/frontend/pipeline/LiveModelCard.tsx
index 610b8f1f3fac..780d521beafe 100644
--- a/products/autoresearch/frontend/pipeline/LiveModelCard.tsx
+++ b/products/autoresearch/frontend/pipeline/LiveModelCard.tsx
@@ -5,6 +5,7 @@ import { LemonTag, Tooltip } from '@posthog/lemon-ui'
import { autoresearchPipelineLogic } from '../autoresearchPipelineLogic'
import { FeatureImportanceChart } from './FeatureImportanceChart'
import { MetricCard } from './MetricCard'
+import { SectionCard } from './SectionCard'
/** The champion model: its metrics, feature drivers, and the agent's description. Renders nothing before a champion exists. */
export function LiveModelCard(): JSX.Element | null {
@@ -13,15 +14,18 @@ export function LiveModelCard(): JSX.Element | null {
return null
}
return (
- <div className="border rounded p-4 space-y-4">
- <div className="flex items-center gap-2">
- <span className="text-sm font-semibold text-muted">Live model</span>
- {champion.is_preliminary && (
- <Tooltip title="Promoted on holdout AUC alone. Realized metrics confirm it once prediction horizons elapse.">
- <LemonTag type="warning">Preliminary</LemonTag>
- </Tooltip>
- )}
- </div>
+ <SectionCard
+ title={
+ <>
+ Live model
+ {champion.is_preliminary && (
+ <Tooltip title="Promoted on holdout AUC alone. Realized metrics confirm it once prediction horizons elapse.">
+ <LemonTag type="warning">Preliminary</LemonTag>
+ </Tooltip>
+ )}
+ </>
+ }
+ >
<div className="grid grid-cols-2 gap-3">
<MetricCard
label="Holdout AUC"
@@ -43,6 +47,6 @@ export function LiveModelCard(): JSX.Element | null {
{champion.agent_description && (
<div className="text-sm text-muted italic">"{champion.agent_description}"</div>
)}
- </div>
+ </SectionCard>
)
}
diff --git a/products/autoresearch/frontend/pipeline/MetricCard.tsx b/products/autoresearch/frontend/pipeline/MetricCard.tsx
index cf2be19d3b66..32dd7cbefa23 100644
--- a/products/autoresearch/frontend/pipeline/MetricCard.tsx
+++ b/products/autoresearch/frontend/pipeline/MetricCard.tsx
@@ -7,7 +7,7 @@ export function MetricCard({ label, value, tooltip }: { label: string; value: st
</div>
)
return (
- <div className="border rounded p-3 space-y-1">
+ <div className="rounded bg-surface-secondary p-3 space-y-1">
{tooltip ? <Tooltip title={tooltip}>{labelElement}</Tooltip> : labelElement}
<div className="text-lg font-bold truncate">{value}</div>
</div>
diff --git a/products/autoresearch/frontend/pipeline/OnlinePerformanceTab.tsx b/products/autoresearch/frontend/pipeline/OnlinePerformanceTab.tsx
index 954657eb34a8..b950c43b2b49 100644
--- a/products/autoresearch/frontend/pipeline/OnlinePerformanceTab.tsx
+++ b/products/autoresearch/frontend/pipeline/OnlinePerformanceTab.tsx
@@ -12,6 +12,7 @@ import { ConfusionMatrixCard } from './ConfusionMatrixCard'
import { EmptyTab } from './EmptyTab'
import { RealizedAucChart } from './RealizedAucChart'
import { ScoreNowButton } from './ScoreNowButton'
+import { SectionCard } from './SectionCard'
import { SegmentCalibrationBars } from './SegmentCalibrationBars'
const MODEL_ROLE: Record<string, { type: 'success' | 'default' | 'highlight'; label: string }> = {
@@ -89,36 +90,41 @@ export function OnlinePerformanceTab(): JSX.Element {
return (
<div className="space-y-6">
- <div className="space-y-1">
- <p className="text-base font-semibold mb-0">
- {accuracyHeadline(latestChampionPerformance, pipeline.target_event)}
- </p>
- {ranking && <p className="text-sm text-muted mb-0">{ranking}</p>}
- {precisionRecall && <p className="text-sm text-muted mb-0">{precisionRecall}</p>}
- </div>
+ <SectionCard>
+ <div className="space-y-1">
+ <p className="text-base font-semibold mb-0">
+ {accuracyHeadline(latestChampionPerformance, pipeline.target_event)}
+ </p>
+ {ranking && <p className="text-sm text-muted mb-0">{ranking}</p>}
+ {precisionRecall && <p className="text-sm text-muted mb-0">{precisionRecall}</p>}
+ </div>
+ </SectionCard>
<ConfusionMatrixCard />
{segmentCalibration.length > 0 && (
- <section className="space-y-2">
- <h3 className="text-sm font-semibold mb-0">Predicted and actual rate by segment, {latestDate}</h3>
+ <SectionCard title={`Predicted and actual rate by segment, ${latestDate}`}>
<SegmentCalibrationBars segments={segmentCalibration} />
- </section>
+ </SectionCard>
)}
{realizedAucPoints.length > 0 && (
- <section className="space-y-2">
- <h3 className="text-sm font-semibold mb-0">Realized AUC over time</h3>
- <p className="text-xs text-muted mb-0">
- Realized AUC measures how well the model ranked people who did {pipeline.target_event} above
- people who did not. 0.5 is a coin flip and 1 is a perfect ranking. The holdout line is the score
- the model got in training.
- </p>
+ <SectionCard
+ title="Realized AUC over time"
+ description={
+ <>
+ Realized AUC measures how well the model ranked people who did {pipeline.target_event} above
+ people who did not. 0.5 is a coin flip and 1 is a perfect ranking. The holdout line is the
+ score the model got in training.
+ </>
+ }
+ >
<RealizedAucChart points={realizedAucPoints} holdoutAuc={champion?.holdout_score ?? null} />
- </section>
+ </SectionCard>
)}
<LemonCollapse
+ className="bg-surface-primary"
panels={[
{
key: 'history',
diff --git a/products/autoresearch/frontend/pipeline/PredictionActionsPanel.tsx b/products/autoresearch/frontend/pipeline/PredictionActionsPanel.tsx
index 5d225fedacc4..5601006d5b3f 100644
--- a/products/autoresearch/frontend/pipeline/PredictionActionsPanel.tsx
+++ b/products/autoresearch/frontend/pipeline/PredictionActionsPanel.tsx
@@ -9,6 +9,7 @@ import {
likelySegmentWorkflowUrl,
predictionBreakdownInsightUrl,
} from '../predictionSegments'
+import { SectionCard } from './SectionCard'
export function PredictionActionsPanel(): JSX.Element | null {
const { pipeline, segmentThresholds, segmentDefinitions } = useValues(autoresearchPipelineLogic)
@@ -22,9 +23,10 @@ export function PredictionActionsPanel(): JSX.Element | null {
const segmentsLoading = !segmentThresholds ? 'Segments are still loading' : undefined
return (
- <div className="border rounded p-4 bg-surface-primary">
- <h3 className="font-semibold mb-1">Act on these predictions</h3>
- <p className="text-sm text-secondary mb-3">Each link opens a prefilled draft. Review it, then save.</p>
+ <SectionCard
+ title="Act on these predictions"
+ description="Each link opens a prefilled draft. Review it, then save."
+ >
<div className="flex flex-col gap-1">
<LemonButton
icon={<IconFlag />}
@@ -56,6 +58,6 @@ export function PredictionActionsPanel(): JSX.Element | null {
Chart {pipeline.target_event} by predicted probability
</LemonButton>
</div>
- </div>
+ </SectionCard>
)
}
diff --git a/products/autoresearch/frontend/pipeline/PredictionSegmentCards.tsx b/products/autoresearch/frontend/pipeline/PredictionSegmentCards.tsx
index 3c67e9fa5310..7d267ec94996 100644
--- a/products/autoresearch/frontend/pipeline/PredictionSegmentCards.tsx
+++ b/products/autoresearch/frontend/pipeline/PredictionSegmentCards.tsx
@@ -20,7 +20,7 @@ function SegmentCard({ segment }: { segment: PredictionSegmentDefinition }): JSX
const outputProperty = pipeline?.output_person_property ?? ''
return (
- <div className="flex-1 min-w-60 border rounded p-4 flex flex-col gap-2 bg-surface-primary">
+ <div className="flex-1 min-w-60 rounded p-4 flex flex-col gap-2 bg-surface-secondary">
<div className="flex items-center gap-2">
<span className={`size-2.5 rounded-full shrink-0 ${segment.colorClassName}`} />
<span className="font-semibold">{segment.label}</span>
diff --git a/products/autoresearch/frontend/pipeline/PredictionsTab.tsx b/products/autoresearch/frontend/pipeline/PredictionsTab.tsx
index 37a5bd01e2c4..78fa6eb987c6 100644
--- a/products/autoresearch/frontend/pipeline/PredictionsTab.tsx
+++ b/products/autoresearch/frontend/pipeline/PredictionsTab.tsx
@@ -12,6 +12,7 @@ import { CoverageHistoryChart, CoverageSummaryBanner } from './PredictionCoverag
import { PredictionSegmentCards } from './PredictionSegmentCards'
import { ProbabilityUsersTable } from './ProbabilityUsersTable'
import { ScoreNowButton } from './ScoreNowButton'
+import { SectionCard } from './SectionCard'
function DailyVolumePanel(): JSX.Element {
const { dailyVolume, dailyVolumeError } = useValues(autoresearchPipelineLogic)
@@ -74,19 +75,25 @@ export function PredictionsTab(): JSX.Element {
return (
<div className="space-y-6">
- <p className="text-sm text-muted">
- Each scoring run writes the champion's predicted probability to the{' '}
- <code>{pipeline.output_person_property}</code> person property and emits an{' '}
- <code>autoresearch_prediction</code> event. These views read straight from those events.
- </p>
-
<CoverageSummaryBanner />
- <PredictionSegmentCards />
+ <SectionCard
+ title="Likelihood segments"
+ description={
+ <>
+ Each scoring run writes the champion's predicted probability to the{' '}
+ <code>{pipeline.output_person_property}</code> person property and emits an{' '}
+ <code>autoresearch_prediction</code> event. These views read straight from those events.
+ </>
+ }
+ >
+ <PredictionSegmentCards />
+ </SectionCard>
<PredictionActionsPanel />
<LemonCollapse
+ className="bg-surface-primary"
multiple
defaultActiveKeys={['distribution', 'people']}
panels={[
diff --git a/products/autoresearch/frontend/pipeline/SectionCard.tsx b/products/autoresearch/frontend/pipeline/SectionCard.tsx
new file mode 100644
index 000000000000..30827a59ded0
--- /dev/null
+++ b/products/autoresearch/frontend/pipeline/SectionCard.tsx
@@ -0,0 +1,29 @@
+import { LemonCard } from '@posthog/lemon-ui'
+
+/** The white surface for one section of a detail tab: an optional title row with a control on the right, then the body. */
+export function SectionCard({
+ title,
+ description,
+ actions,
+ children,
+}: {
+ title?: React.ReactNode
+ description?: React.ReactNode
+ actions?: React.ReactNode
+ children?: React.ReactNode
+}): JSX.Element {
+ return (
+ <LemonCard hoverEffect={false} className="p-4 flex flex-col gap-3 min-w-0">
+ {(title || description || actions) && (
+ <div className="flex flex-wrap items-start justify-between gap-2">
+ <div className="min-w-0 space-y-1">
+ {title && <h3 className="flex items-center gap-2 text-sm font-semibold mb-0">{title}</h3>}
+ {description && <div className="text-xs text-muted">{description}</div>}
+ </div>
+ {actions}
+ </div>
+ )}
+ {children}
+ </LemonCard>
+ )
+}
diff --git a/products/autoresearch/frontend/pipeline/SetupTab.tsx b/products/autoresearch/frontend/pipeline/SetupTab.tsx
index 77de34916876..3b5fa0068ead 100644
--- a/products/autoresearch/frontend/pipeline/SetupTab.tsx
+++ b/products/autoresearch/frontend/pipeline/SetupTab.tsx
@@ -7,6 +7,7 @@ import { dayjs } from 'lib/dayjs'
import { autoresearchPipelineLogic } from '../autoresearchPipelineLogic'
import { AutoresearchPipelineApi } from '../generated/api.schemas'
import { MetricCard } from './MetricCard'
+import { SectionCard } from './SectionCard'
export function SetupTab(): JSX.Element {
const { pipeline } = useValues(autoresearchPipelineLogic)
@@ -14,17 +15,27 @@ export function SetupTab(): JSX.Element {
return <LemonSkeleton className="h-40" />
}
return (
- <div className="space-y-4">
- <div className="grid grid-cols-2 gap-4 md:grid-cols-4">
- <MetricCard label="Target event" value={pipeline.target_event} />
- <MetricCard label="Prediction horizon" value={`${pipeline.horizon_days ?? '—'}d`} />
- <MetricCard label="Training lookback" value={`${pipeline.training_lookback_days ?? '—'}d`} />
- <MetricCard
- label="Budget remaining"
- value={`${pipeline.iteration_budget_remaining} / ${pipeline.iteration_budget ?? '—'}`}
- />
+ <SectionCard
+ title="Model definition"
+ description={
+ <>
+ Editing the target, populations, and budget in the UI is coming soon. For now, use the{' '}
+ <code>autoresearch</code> API or MCP tools, or recreate the model.
+ </>
+ }
+ >
+ <div className="@container">
+ <div className="grid grid-cols-2 gap-3 @2xl:grid-cols-4">
+ <MetricCard label="Target event" value={pipeline.target_event} />
+ <MetricCard label="Prediction horizon" value={`${pipeline.horizon_days ?? '—'}d`} />
+ <MetricCard label="Training lookback" value={`${pipeline.training_lookback_days ?? '—'}d`} />
+ <MetricCard
+ label="Budget remaining"
+ value={`${pipeline.iteration_budget_remaining} / ${pipeline.iteration_budget ?? '—'}`}
+ />
+ </div>
</div>
- <div className="border rounded p-4">
+ <div>
<DetailRow label="Output person property">
<code>{pipeline.output_person_property ?? '—'}</code>
</DetailRow>
@@ -39,11 +50,7 @@ export function SetupTab(): JSX.Element {
{pipeline.created_by?.first_name ? ` by ${pipeline.created_by.first_name}` : ''}
</DetailRow>
</div>
- <p className="text-sm text-muted">
- Editing the target, populations, and budget in the UI is coming soon. For now, use the{' '}
- <code>autoresearch</code> API or MCP tools, or recreate the model.
- </p>
- </div>
+ </SectionCard>
)
}
diff --git a/products/autoresearch/frontend/pipeline/SuggestionForm.tsx b/products/autoresearch/frontend/pipeline/SuggestionForm.tsx
index 00ead7a3c763..160a48088975 100644
--- a/products/autoresearch/frontend/pipeline/SuggestionForm.tsx
+++ b/products/autoresearch/frontend/pipeline/SuggestionForm.tsx
@@ -9,8 +9,7 @@ export function SuggestionForm(): JSX.Element {
const { suggestionDraft, suggestionPriority, suggestionSubmitResultLoading } = useValues(autoresearchPipelineLogic)
const { setSuggestionDraft, setSuggestionPriority, submitSuggestion } = useActions(autoresearchPipelineLogic)
return (
- <div className="border rounded p-3 space-y-2">
- <div className="text-sm font-semibold">Steer the agent</div>
+ <div className="space-y-2">
<LemonTextArea
value={suggestionDraft}
maxLength={2000}
diff --git a/products/autoresearch/frontend/pipeline/SuggestionsTab.tsx b/products/autoresearch/frontend/pipeline/SuggestionsTab.tsx
index 92a0edaf4127..c46da445a172 100644
--- a/products/autoresearch/frontend/pipeline/SuggestionsTab.tsx
+++ b/products/autoresearch/frontend/pipeline/SuggestionsTab.tsx
@@ -10,6 +10,7 @@ import {
AutoresearchSuggestionPriorityEnumApi,
AutoresearchSuggestionStatusEnumApi,
} from '../generated/api.schemas'
+import { SectionCard } from './SectionCard'
import { SuggestionForm } from './SuggestionForm'
const SUGGESTION_STATUS: Record<
@@ -31,11 +32,10 @@ export function SuggestionsTab(): JSX.Element {
const { suggestions, suggestionsLoading, suggestionsError } = useValues(autoresearchPipelineLogic)
const { loadSuggestions } = useActions(autoresearchPipelineLogic)
return (
- <div className="space-y-4">
- <p className="text-sm text-muted">
- Inject a free-text hypothesis into the training loop. The agent reads queued suggestions at the start of
- each iteration batch and decides whether to act on, apply, or dismiss each one.
- </p>
+ <SectionCard
+ title="Steer the agent"
+ description="Inject a free-text hypothesis into the training loop. The agent reads queued suggestions at the start of each iteration batch and decides whether to act on, apply, or dismiss each one."
+ >
<SuggestionForm />
{suggestionsLoading ? (
<Spinner />
@@ -55,7 +55,7 @@ export function SuggestionsTab(): JSX.Element {
) : (
<div className="space-y-2">
{suggestions.map((s: AutoresearchSuggestionApi) => (
- <div key={s.id} className="border rounded p-3 space-y-1">
+ <div key={s.id} className="rounded bg-surface-secondary p-3 space-y-1">
<div className="flex items-center gap-2">
<LemonTag type={SUGGESTION_STATUS[s.status].type}>
{SUGGESTION_STATUS[s.status].label}
@@ -73,6 +73,6 @@ export function SuggestionsTab(): JSX.Element {
))}
</div>
)}
- </div>
+ </SectionCard>
)
}