: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
fix(inbox): a bunch of ui nits (#65808)
Joshua Snyder97eeaa0a0292
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 4994ef67aa59..08112119aa11 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -5465,9 +5465,9 @@ snapshots:scenes-app-identitymatching--identity-matching-paid-attribution--light:hash: v1.k794b7964.4d3b2361bc470388be7c04dd4c875cc658c5edb251ba36c938f332c2a01ff21b._ojUVhjnh-D6MFt_1IvN7KxuZ76IXepPLsNFy8aveX0scenes-app-inbox-badges--all-badges--dark:- hash: v1.k794b7964.51fa6006ad07b02e6f11a352d76e9c401efd4445bd42d873081e7e7689aa14e0.okUTzDeF87AijpmaUtUxy65qKVS502E1-Eo1nXh10XE+ hash: v1.k794b7964.a8b8e3a27b5ef1bc81c419f96f32139a485d3dde9d26d58a56b864fcb37d79c2.YX9sfm5dKmXlj2QGuBlw3R9eGUtLEogul2WCO_Ff5Qoscenes-app-inbox-badges--all-badges--light:- hash: v1.k794b7964.cffee6f288a8db013733381d6ece9c3e33145a57c8c1ce4d590b755e50c35b27.ugFqVSEhuPB1cHnuPoWLSnhukpST2KU2k1L4-c1Qct8+ hash: v1.k794b7964.dfccecbe74c47d96287cb584b0d52b758594fc4f9e94bff4aa60a9ffc2bd9432.lCE2F3v69Iv6zj4ZcXn41QKJ1lmm757G6b2UmGT1-UYscenes-app-inbox-cards--agent-run-cards--dark:hash: v1.k794b7964.fcb982b9e94ae098103fc93d6cac35a02c72982f77983ef6aace36f3b71d08ee.kdUHji6m8w2Nb8xAll_JgMCvh56xcuyAoEPDg17Plg0scenes-app-inbox-cards--agent-run-cards--light:@@ -5489,41 +5489,41 @@ snapshots:scenes-app-inbox-cards--skeleton--light:hash: v1.k794b7964.24c19ab5df1e4ccb843b1ad726752e3a98aeadaa08595e66cb4b41aff1a9e9a1.Y3z44tkU4jsAYUyXxfl72fTuZ0MKA6_S6TTNCKt5jSgscenes-app-inbox-detail--pull-request--dark:- hash: v1.k794b7964.abb638b060300d12ddee995e5914fa10d39229558de7a8bf7490e5e2336143b1.i8u20UuA-aUOVPye5eaxeJOkl2LNIqVxqEt5x0thK_Q+ hash: v1.k794b7964.8a719ba5bba724738cf13d7e04cdb527258d18a20d7d2aecca82398f1f1dda22.3BrWr9eZXx4EPXoj0DM19MHiK9e3W1KW3FgoccSbyLIscenes-app-inbox-detail--pull-request--light:- hash: v1.k794b7964.f596ecf775dc2c15a9c9f3d2f880e50d4b0b4b51504089320b295335e2190ed7.lVjDufutx1EJPSC7KOiB5CLpSpe7LLajzKYAqIePht4+ hash: v1.k794b7964.4ee33dac9422ce123f4809501d98db3dbbd29b69e4f40d25e14a05841d81a4bb.4ui7BVAv-AqoQRCZDzszdiw61RWQayxIyWZwQjtm12Ascenes-app-inbox-detail--report--dark:- hash: v1.k794b7964.c41c6eaacd590b83aef8d6fdeac589d2564740e6abc13a63d7cc5e32d523b48c.VSRf6aX5xB84ZVEyp2uHWZxMENFfMHxO43e2PY5dTF0+ hash: v1.k794b7964.bed931ee3ebab86eb24d8ddf462342305953b9b333b0912786ab5cede62ddfa2.JbnHb4LRLAqQOLN8w3uPdaE2YKui6kf0ANwyk2EqDjQscenes-app-inbox-detail--report--light:- hash: v1.k794b7964.1a91db030413d628d124fb5e0b787cab8ef865b74c5e34b93fa2fe5e59f22bc6.gUxHN25uyq6dzesvlJOLEKbFMZMUFw6p7mx83cBmLCc+ hash: v1.k794b7964.5788b584f665ff06fac3727074bab99e3e49eda1e1b4f7f4020fbdf5b56c41a6.I--NHWPeD0hh8wEJF8n8zJn1bKXQrbhzgYvBt7mZFQAscenes-app-inbox-detail--report-minimal--dark:- hash: v1.k794b7964.b62a4b261f03621b3c673572d0625e5d7849adf694fb4423086f74469e043414.YyuYFTT-yAKVwZpFjGu4AlMoRB10iFsklo1-ZZoS8J0+ hash: v1.k794b7964.1ad932768247964d7ba9440b9c9cf17acbd47a82309b3a1bb125d51aac5d7843.he9eJUpJg5IHFDNvIYxVgBwc-52oTsGGj1vKnJOcUlcscenes-app-inbox-detail--report-minimal--light:- hash: v1.k794b7964.208a8797a503c49ce990dbc1d2311076f9d0a79405a11c33ffa3c142c46b8802.VS4_ToMckLQZXPu0QQBpRTBIQvnEdBGYu1lbHH-aDjU+ hash: v1.k794b7964.0d41bcb80f75889f19bb97431a0ea86a2128d00eafd5a07c5f7ac5acc3e7d14e.7a4HLQtAa2T29HhTiXgo4hhzixjc70hJlL6tOGxN5IEscenes-app-inbox-detail--run-failed--dark:- hash: v1.k794b7964.4631a330dcd36a55470a795a7fee35267c833ded9ba3355393391d4fad5995dd.Vou4U7RpSio3B7pZOpOtQ1tjGbWsEtArxWhC7j4p6aw+ hash: v1.k794b7964.2acef5200f1a224e4703a48e86d554af9ad74436c3b797101820c5b7c781136c.92CBgDspT8I31nE2c_EDoDdOdIv5KJo3A1GaPe1UT24scenes-app-inbox-detail--run-failed--light:- hash: v1.k794b7964.ef1a58753fe93c4452304281281bf94c4ca94cc1e22ab43e1e9242777fe9eec3.p1SlnoJWZjIvVS7_ENAGHZzUzX4oowa1uaAKC6J-iSs+ hash: v1.k794b7964.f7b87386c6992664f27ed406bd9914973d9942f359e88108b379956b6f56e893.Buu_XGONwE_XnQy0DzLM1VKPtXDNkCN56uThmsEj6c0scenes-app-inbox-detail--run-in-progress--dark:- hash: v1.k794b7964.afb91fa62aac61d0f826082a8d2ffc10da141995a9caf3eb3cd3161c23733883._j0kYRPHD-17iVLpGt8MCw7AzO7gS9xhLjeSN9faZJk+ hash: v1.k794b7964.f79b25a6fca808926518901392571ca5e16d453cd99a97dc0b7174d18087648f.Zp_xspMLdCzJWxP7B4_TiwwPvLJK5JFlrwANlnves1wscenes-app-inbox-detail--run-in-progress--light:- hash: v1.k794b7964.71415cd63c30734a7853ae071ad1d4d924371ae236f9cc35a3e37bd2c1ee4c24.TL_hBUbUm1sm9y86ihIa_lsTXS1701oJlya4DOo_xE4+ hash: v1.k794b7964.975335749852a054dc196e070a8b91c5eb40a563560fcc7741b6f8e44d11066e.yFm7WNmicK8eHzxdDb-ORXXjv3PHIpzoPbFo8W5c2ccscenes-app-inbox-detail--run-ready--dark:- hash: v1.k794b7964.489e3de0cd98f2dde9a629a3f295dd64917b55f5ee723a6126da336dd36cbddb.mN9an3Ut2ZRcx_ngAFpUobvuNga38KQOuz8i7JNgjxo+ hash: v1.k794b7964.f4d5851d8282a06f95f7cee962402b997bae19978b5c19d19e3c8932a1c47ccd.4wqc2vZ7Tjk9Mgf1MveZOwePBnMdm24VJ3qHgo-ikdMscenes-app-inbox-detail--run-ready--light:- hash: v1.k794b7964.ab7dd7badc02bcaab9fbcfaddb17930eaa8abf9f1936571441296cb9e8cb246f.iZzPaulpiIzqj0r1tcargjZMm5DOxqA3eca-zhEtW84+ hash: v1.k794b7964.2fbb263dadddfb78130f7ce6666d5ef10151ebec9143e7f00ab0285bd3b9a21f.wRvvBPNYIVLvm3HJy8POg4TxUHmaOjEp_67VyRIArWMscenes-app-inbox-scene--empty--dark:- hash: v1.k794b7964.dcea4918fc6eb13da632805e3f984217d42b0d190cc3e2cd78932b13fbaf2864.XyfvI_WWQc5huS6qi4k66rQebEt_KTOQixgRNcKHRZc+ hash: v1.k794b7964.07bbc30ba986f803bfcfebf60c66bced035a3cc92027cc4e68a61a054b5f1a79.AIhrVbfGy3V_Qf0ztzWk0Nnn1xRRcQOVAm-UKvsxRu4scenes-app-inbox-scene--empty--light:- hash: v1.k794b7964.792c574a3d7f61c29963b16cdaaedaed29b6c3e5cad1d8db0dc04b60a9a073b7.1XlxAgtsKl4zDWyyglqhdPApeyTP29yezAiMR75GiRs+ hash: v1.k794b7964.81373ae7fc298f00118487ead6d1428029a544201629904c20f9a99480ece69e.vzR527beBDJ4lfpCtunMDoJPtDCUF0GrVe-qhybPoBwscenes-app-inbox-scene--inbox--dark:hash: v1.k794b7964.eae93d2c506e66eb23f36e19f05bf6f07286d9a895dbad8f970c009fd98f1d53.AqLzv_So4UaxCTEYyb-ZB24M8Z4KF2Zq8PyO-8FDfosscenes-app-inbox-scene--inbox--light:hash: v1.k794b7964.f9b5a6f1ecd482963d9850ced2d07c1ea729d2d63be8679db907709e5a6fde89.kWZ_EUm4zZwm068_9nLGo5dWzvu78oVbcMTHqOHOEcYscenes-app-inbox-scene--self-driving-onboarding--dark:- hash: v1.k794b7964.dcea4918fc6eb13da632805e3f984217d42b0d190cc3e2cd78932b13fbaf2864.vI-KFL7Y13sO7lTuGaMzcdiZy3_SMl-3gBaFvGCrTq8+ hash: v1.k794b7964.07bbc30ba986f803bfcfebf60c66bced035a3cc92027cc4e68a61a054b5f1a79.eytb8nwcGuLgvygTe-3DnU6crJjt5ETtILVPFApVZv4scenes-app-inbox-scene--self-driving-onboarding--light:- hash: v1.k794b7964.f63cb2dbe95deadfc259399fb53119b0ed992b5ad0e7dc07838c4be773b72a65.CUNHNlCtLNlZF1JmEUMUEy1ZyBGIPpjeOnFPz-rg1wY+ hash: v1.k794b7964.81373ae7fc298f00118487ead6d1428029a544201629904c20f9a99480ece69e.SZPaHh2iZfhjafspeG-7DlvjUq9PQdf5esp2MCjMd2wscenes-app-inbox-scene--self-driving-paused--dark:hash: v1.k794b7964.eae93d2c506e66eb23f36e19f05bf6f07286d9a895dbad8f970c009fd98f1d53.7hksyy3ldoFdJY9rpLYMe7FNYuMAi-U1Vlh3OGhv3wYscenes-app-inbox-scene--self-driving-paused--light:diff --git a/frontend/src/scenes/inbox/InboxScene.tsx b/frontend/src/scenes/inbox/InboxScene.tsxindex 312029149f09..2b2c2fe21a39 100644--- a/frontend/src/scenes/inbox/InboxScene.tsx+++ b/frontend/src/scenes/inbox/InboxScene.tsx@@ -86,8 +86,9 @@ function InboxListView(): JSX.Element {return (<div ref={widthRef} className="flex min-h-0 flex-1"><div className="flex flex-col min-h-0 flex-1 min-w-0">- {/* pl-5 (20px) aligns the first tab label with the SceneTitleSection description above. */}- <div className="flex items-end justify-between gap-2 border-b border-primary pl-5 pr-2 shrink-0">+ {/* pl-5 (20px) aligns the first tab label with the SceneTitleSection description above;+ pr-6 matches the report list's px-6 so the scope select shares the list's right edge. */}+ <div className="flex items-end justify-between gap-2 border-b border-primary pl-5 pr-6 shrink-0"><InboxTabBar showConfigTab={!wide} onboarding={onboarding} />{!onboarding && isReportListTab(effectiveTab) && (<div className="pb-1.5">diff --git a/frontend/src/scenes/inbox/components/badges/ForYouBadge.tsx b/frontend/src/scenes/inbox/components/badges/ForYouBadge.tsxdeleted file mode 100644index e0819f19e7c3..000000000000--- a/frontend/src/scenes/inbox/components/badges/ForYouBadge.tsx+++ /dev/null@@ -1,13 +0,0 @@-import { IconEye } from '@posthog/icons'-import { LemonTag, Tooltip } from '@posthog/lemon-ui'--export function ForYouBadge(): JSX.Element {- return (- <Tooltip title="You are a suggested reviewer">- <LemonTag size="small" type="warning" className="gap-1 cursor-help select-none">- <IconEye className="shrink-0" />- For you- </LemonTag>- </Tooltip>- )-}diff --git a/frontend/src/scenes/inbox/components/badges/InboxBadges.stories.tsx b/frontend/src/scenes/inbox/components/badges/InboxBadges.stories.tsxindex 5941b313d6c8..df5338a183e3 100644--- a/frontend/src/scenes/inbox/components/badges/InboxBadges.stories.tsx+++ b/frontend/src/scenes/inbox/components/badges/InboxBadges.stories.tsx@@ -2,7 +2,6 @@ import type { Meta, StoryObj } from '@storybook/react'import { SignalReportActionability, SignalReportPriority, SignalReportStatus } from '../../types'import { AnimatedEllipsis } from './AnimatedEllipsis'-import { ForYouBadge } from './ForYouBadge'import { SignalReportActionabilityBadge } from './SignalReportActionabilityBadge'import { SignalReportPriorityBadge } from './SignalReportPriorityBadge'import { SignalReportStatusBadge } from './SignalReportStatusBadge'@@ -50,9 +49,6 @@ export const AllBadges: Story = {<SignalReportActionabilityBadge key={a} actionability={a} />))}</Row>- <Row label="For you">- <ForYouBadge />- </Row><Row label="Working"><span className="text-sm text-secondary">Investigatingdiff --git a/frontend/src/scenes/inbox/components/detail/AgentRunDetail.tsx b/frontend/src/scenes/inbox/components/detail/AgentRunDetail.tsxindex 7f707b9d3e06..83df9118ee17 100644--- a/frontend/src/scenes/inbox/components/detail/AgentRunDetail.tsx+++ b/frontend/src/scenes/inbox/components/detail/AgentRunDetail.tsx@@ -218,13 +218,13 @@ function TaskLogBody({* open a new tab, carrying the bind via the `bind_task` URL param. Gated to a terminal run — the live* Task log already covers an in-progress run, and taking over a running automation run is out of scope.*/-function OpenTaskButton({ taskId, runStatus }: { taskId: string; runStatus?: TaskRunStatus }): JSX.Element {+export function OpenTaskButton({ taskId, runStatus }: { taskId: string; runStatus?: TaskRunStatus }): JSX.Element {const { openSidePanelMaxWithTaskBind } = useActions(maxGlobalLogic)const isTerminal = isTerminalRunStatus(runStatus)return (<LemonButton- size="xsmall"+ size="small"type="secondary"to={combineUrl(urls.ai(), { [SANDBOX_BIND_TASK_PARAM]: taskId }).url}onClick={(e) => {diff --git a/frontend/src/scenes/inbox/components/detail/ArtefactLogList.tsx b/frontend/src/scenes/inbox/components/detail/ArtefactLogList.tsxindex 350b1f2ae077..c2ba38974893 100644--- a/frontend/src/scenes/inbox/components/detail/ArtefactLogList.tsx+++ b/frontend/src/scenes/inbox/components/detail/ArtefactLogList.tsx@@ -81,6 +81,15 @@ function prettify(value: string): string {return capitalizeFirstLetter(value.replace(/[-_]/g, ' '))}+/** Friendly labels for known dismissal reason codes; unknown values fall back to a humanized form. */+const DISMISS_REASON_LABELS: Record<string, string> = {+ slack_dismiss: 'Dismissed from Slack',+}++function dismissReasonLabel(reason: string): string {+ return DISMISS_REASON_LABELS[reason] ?? prettify(reason)+}+/** A short relevance / context note above a code block. */function RelevanceNote({ note }: { note?: string }): JSX.Element | null {if (!note?.trim()) {@@ -290,7 +299,7 @@ function ArtefactBody({<div className="flex flex-col gap-1">{c.reason ? (<LemonTag size="small" type="muted">- {prettify(c.reason)}+ {dismissReasonLabel(c.reason)}</LemonTag>) : null}{c.note ? <RelevanceNote note={c.note} /> : null}diff --git a/frontend/src/scenes/inbox/components/detail/DetailSection.tsx b/frontend/src/scenes/inbox/components/detail/DetailSection.tsxindex 91f84eedfb24..1c4ff83b00cb 100644--- a/frontend/src/scenes/inbox/components/detail/DetailSection.tsx+++ b/frontend/src/scenes/inbox/components/detail/DetailSection.tsx@@ -1,4 +1,6 @@-import { ReactNode } from 'react'+import { ReactNode, useState } from 'react'++import { IconChevronRight } from '@posthog/icons'interface DetailSectionProps {icon: ReactNode@@ -29,23 +31,57 @@ interface RightColumnSectionProps {title: stringrightSlot?: ReactNodechildren: ReactNode+ /** When set, the header toggles the body open/closed. */+ collapsible?: boolean+ /** Start collapsed (only honoured when `collapsible`). */+ defaultCollapsed?: boolean}/*** Slim caption header used by sections in the detail-view right column (Runs, Reviewers).- * Lighter than `DetailSection` so the side column reads as supporting detail.+ * Lighter than `DetailSection` so the side column reads as supporting detail. Optionally+ * collapsible — the header becomes a toggle while `rightSlot` stays outside it so its own+ * controls remain clickable.*/-export function RightColumnSection({ icon, title, rightSlot, children }: RightColumnSectionProps): JSX.Element {+export function RightColumnSection({+ icon,+ title,+ rightSlot,+ children,+ collapsible = false,+ defaultCollapsed = false,+}: RightColumnSectionProps): JSX.Element {+ const [collapsed, setCollapsed] = useState(defaultCollapsed)+ const open = !collapsible || !collapsed++ const caption = (+ <>+ <span className="flex shrink-0 items-center [&_svg]:size-3">{icon}</span>+ <span className="font-medium text-[0.6875rem] uppercase tracking-wider">{title}</span>+ </>+ )+return (<div className="flex flex-col gap-2">- <div className="flex items-center justify-between gap-2 cursor-default select-none text-tertiary">- <div className="flex items-center gap-2">- <span className="flex shrink-0 items-center [&_svg]:size-3">{icon}</span>- <span className="font-medium text-[0.6875rem] uppercase tracking-wider">{title}</span>- </div>+ <div className="flex items-center justify-between gap-2 select-none text-tertiary">+ {collapsible ? (+ <button+ type="button"+ aria-expanded={open}+ onClick={() => setCollapsed((c) => !c)}+ className="flex items-center gap-2 rounded text-left transition-colors hover:text-secondary"+ >+ <IconChevronRight+ className={`size-3 shrink-0 transition-transform ${open ? 'rotate-90' : ''}`}+ />+ {caption}+ </button>+ ) : (+ <div className="flex items-center gap-2 cursor-default">{caption}</div>+ )}{rightSlot && <div className="shrink-0">{rightSlot}</div>}</div>- <div>{children}</div>+ {open && <div>{children}</div>}</div>)}diff --git a/frontend/src/scenes/inbox/components/detail/ReportActivitySection.tsx b/frontend/src/scenes/inbox/components/detail/ReportActivitySection.tsxindex b96e2593063d..c71330bb98bc 100644--- a/frontend/src/scenes/inbox/components/detail/ReportActivitySection.tsx+++ b/frontend/src/scenes/inbox/components/detail/ReportActivitySection.tsx@@ -29,6 +29,8 @@ export function ReportActivitySection({ report }: { report: SignalReport }): JSX<RightColumnSectionicon={<IconClockRewind />}title="Activity"+ collapsible+ defaultCollapsedrightSlot={<span className="text-[0.6875rem] text-tertiary tabular-nums">{reportArtefacts.length} {reportArtefacts.length === 1 ? 'entry' : 'entries'}diff --git a/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx b/frontend/src/scenes/inbox/components/detail/ReportDetail.tsxindex 586837a582ac..cf9f505f9cfa 100644--- a/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx+++ b/frontend/src/scenes/inbox/components/detail/ReportDetail.tsx@@ -1,13 +1,21 @@import { useValues } from 'kea'import { ReactNode } from 'react'-import { IconArrowLeft, IconCode, IconDocument, IconExternal, IconPullRequest, IconSearch } from '@posthog/icons'+import {+ IconArrowLeft,+ IconCode,+ IconDocument,+ IconEllipsis,+ IconExternal,+ IconPullRequest,+ IconSearch,+} from '@posthog/icons'import { LemonButton, Link, Tooltip } from '@posthog/lemon-ui'import { TZLabel } from 'lib/components/TZLabel'-import { dayjs } from 'lib/dayjs'import { IconLink } from 'lib/lemon-ui/icons'import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'+import { LemonMenu, LemonMenuItem } from 'lib/lemon-ui/LemonMenu'import { copyToClipboard } from 'lib/utils/copyToClipboard'import { addProjectIdIfMissing } from 'lib/utils/kea-router'import { SignalNode } from 'scenes/debug/signals/types'@@ -23,7 +31,6 @@ import {parsePrUrlParts,safeHttpUrl,} from '../../utils/reportPresentation'-import { ForYouBadge } from '../badges/ForYouBadge'import { SignalReportActionabilityBadge } from '../badges/SignalReportActionabilityBadge'import { SignalReportPriorityBadge } from '../badges/SignalReportPriorityBadge'import { SignalReportStatusBadge } from '../badges/SignalReportStatusBadge'@@ -31,7 +38,7 @@ import { hasKnownSourceProduct, knownSourceProductEntries, SourceProductIconRowimport { ConventionalCommitScopeTag } from '../cards/ReportCard'import { RightColumnSection } from './DetailSection'import { ReportActivitySection } from './ReportActivitySection'-import { ReportDetailActions } from './ReportDetailActions'+import { ReportDetailAction, useReportDetailActions } from './ReportDetailActions'import { ReportTasksSection } from './ReportTasksSection'import { SuggestedReviewersSection } from './SuggestedReviewersSection'@@ -58,15 +65,13 @@ export function ReportDetailBadges({actionability={report.actionability}explanation={actionabilityExplanation}/>- {report.is_suggested_reviewer && <ForYouBadge />}</>)}/**- * Single meta line under the title: status/actionability/for-you chips, then dot-separated stats- * (finding count · created [· updated] · source stack). The updated time is only shown when- * it meaningfully differs from created. `evidenceCount` switches to the live signal count once+ * Single meta line under the title: status/actionability chips, then dot-separated stats+ * (finding count · updated · source stack). `evidenceCount` switches to the live signal count once* findings load, so the row reads the same before and after the query resolves.*/function ReportDetailMeta({@@ -90,23 +95,12 @@ function ReportDetailMeta({</span>)}- // Updated is shown alongside Created only when they differ beyond same-moment noise (≥ 1 min apart).- const updatedDiffers =- !!report.updated_at && Math.abs(dayjs(report.updated_at).diff(dayjs(report.created_at), 'minute')) >= 1stats.push(<span className="flex items-center gap-1">- <span>Created</span>- <TZLabel time={report.created_at} />+ <span>Updated</span>+ <TZLabel time={report.updated_at ?? report.created_at} /></span>)- if (updatedDiffers) {- stats.push(- <span className="flex items-center gap-1">- <span>Updated</span>- <TZLabel time={report.updated_at} />- </span>- )- }if (hasSource) {stats.push(<MetaSourceStack sourceProducts={report.source_products} />)}@@ -118,7 +112,6 @@ function ReportDetailMeta({actionability={report.actionability}explanation={actionabilityExplanation}/>- {report.is_suggested_reviewer && <ForYouBadge />}<span className="flex items-center gap-2 flex-wrap min-w-0">{stats.map((node, i) => (<span key={i} className="flex items-center gap-2 min-w-0">@@ -195,7 +188,7 @@ export function ReportDetailSkeleton(): JSX.Element {</div></div>- <div className="grid grid-cols-1 @4xl:grid-cols-[minmax(0,80ch)_minmax(0,1fr)] gap-5">+ <div className="grid grid-cols-1 @5xl:grid-cols-[minmax(0,80ch)_minmax(22rem,1fr)] gap-5"><div className="min-w-0 flex flex-col gap-2.5"><div className="h-4 w-28 rounded bg-fill-highlight-100 animate-pulse" /><div className="h-3 w-full rounded bg-fill-highlight-50 animate-pulse" />@@ -254,6 +247,27 @@ export function InboxDetailFrame({const displayTitle = displayConventionalCommitTitle(report.title, 'Untitled report')const reportPath = urls.inboxReport(tab, report.id)+ // Secondary actions as data so the same set renders inline as buttons on wide layouts and as a+ // standard `LemonMenu` on narrow ones; the primary action stays inline either way.+ const detailActions = useReportDetailActions(report)+ const reportActions: ReportDetailAction[] = [+ {+ key: 'copy-link',+ label: 'Copy link',+ icon: <IconLink />,+ tooltip: 'Copy a link to this report',+ onClick: () =>+ void copyToClipboard(`${window.location.origin}${addProjectIdIfMissing(reportPath)}`, 'report link'),+ },+ ...detailActions,+ ]+ const overflowMenuItems: LemonMenuItem[] = reportActions.map((action) => ({+ label: action.label,+ icon: action.icon,+ disabledReason: action.loading ? 'Working…' : undefined,+ onClick: action.onClick,+ }))+return (<div className="@container w-full max-w-[calc(160ch+5rem)] mx-auto px-6 py-5 text-sm"><div className="flex flex-col gap-3.5 mb-6 pb-5 border-b border-primary">@@ -294,32 +308,45 @@ export function InboxDetailFrame({/></div></div>- <div className="flex items-center flex-wrap gap-2 @2xl:shrink-0">- <LemonButton- type="secondary"- size="small"- icon={<IconLink />}- tooltip="Copy a link to this report"- onClick={() =>- void copyToClipboard(- `${window.location.origin}${addProjectIdIfMissing(reportPath)}`,- 'report link'- )- }- >- Copy link- </LemonButton>- <ReportDetailActions report={report} />+ <div className="flex items-center gap-2 @2xl:shrink-0">{primaryAction}+ {/* Buttons inline on wide layouts; collapse into a standard LemonMenu kebab below @4xl. */}+ <div className="hidden @4xl:flex items-center gap-2">+ {reportActions.map((action) => (+ <LemonButton+ key={action.key}+ type="secondary"+ size="small"+ icon={action.icon}+ loading={action.loading}+ tooltip={action.tooltip}+ onClick={action.onClick}+ >+ {action.label}+ </LemonButton>+ ))}+ </div>+ <LemonMenu items={overflowMenuItems} placement="bottom-end">+ <LemonButton+ type="secondary"+ size="small"+ icon={<IconEllipsis />}+ aria-label="More actions"+ className="@4xl:hidden"+ />+ </LemonMenu></div></div></div>- <div className="grid grid-cols-1 @4xl:grid-cols-[minmax(0,80ch)_minmax(0,1fr)] gap-5">+ <div className="grid grid-cols-1 @5xl:grid-cols-[minmax(0,80ch)_minmax(22rem,1fr)] gap-5"><div className="min-w-0"><RightColumnSection icon={summary.icon} title={summary.title}>{report.summary ? (- <LemonMarkdown className="text-sm text-secondary leading-normal break-words" disableImages>+ <LemonMarkdown+ className="text-sm text-secondary leading-relaxed break-words [&>*+*]:mt-3 [&_li]:my-1 [&_ul]:my-2 [&_ol]:my-2 [&_h1]:mt-5 [&_h2]:mt-5 [&_h3]:mt-4"+ disableImages+ >{report.summary}</LemonMarkdown>) : (@@ -395,6 +422,11 @@ function PullRequestBanner({ prUrl, prRef }: { prUrl: string; prRef: ParsedPrUrl* "Open in GitHub" action surface only when the report has a shipped implementation PR;* otherwise it reads as a plain report. Runs keep their own `AgentRunDetail`.*/+/** Point a PR URL at its diff/files tab, without double-appending if it's already there. */+function prFilesUrl(prUrl: string): string {+ return prUrl.replace(/\/+$/, '').replace(/(\/files)?$/, '/files')+}+export function ReportDetail({ report, tab }: { report: SignalReport; tab: InboxTabKey }): JSX.Element {const prUrl = safeHttpUrl(report.implementation_pr_url)const prRef = prUrl ? parsePrUrlParts(prUrl) : null@@ -411,7 +443,7 @@ export function ReportDetail({ report, tab }: { report: SignalReport; tab: Inboxtype="primary"size="small"sideIcon={<IconExternal />}- to={prUrl}+ to={prFilesUrl(prUrl)}targetBlanktooltip={`${prRef.repoSlug}#${prRef.number}`}>@@ -422,7 +454,7 @@ export function ReportDetail({ report, tab }: { report: SignalReport; tab: Inbox>{hasPr ? (<RightColumnSection icon={<IconCode />} title="Diff">- <PullRequestBanner prUrl={prUrl} prRef={prRef} />+ <PullRequestBanner prUrl={prFilesUrl(prUrl)} prRef={prRef} /></RightColumnSection>) : null}</InboxDetailFrame>diff --git a/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx b/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsxindex 3399e9e82b78..adc9e505cd0d 100644--- a/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx+++ b/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx@@ -1,9 +1,9 @@import { useActions, useValues } from 'kea'import { router } from 'kea-router'-import { useState } from 'react'+import { type MouseEvent, useState } from 'react'import { IconArchive, IconMessage, IconPullRequest, IconUndo } from '@posthog/icons'-import { LemonButton, lemonToast } from '@posthog/lemon-ui'+import { lemonToast } from '@posthog/lemon-ui'import api from 'lib/api'import { urls } from 'scenes/urls'@@ -17,6 +17,20 @@ import { ACTIONABLE_ACTIONABILITY_VALUES, SignalReport, SignalReportStatus } froimport { useReportArchive } from '../cards/useReportArchive'import { openFeedbackReportDialog } from '../shell/FeedbackReportDialog'+/**+ * One detail-pane action, rendered either inline as a `LemonButton` (wide layouts) or as a+ * `LemonMenu` item (the "…" overflow on narrow layouts). Keeping actions as data lets both+ * surfaces share a single source of truth instead of duplicating the button JSX.+ */+export interface ReportDetailAction {+ key: string+ label: string+ icon: JSX.Element+ onClick: (event: MouseEvent) => void+ loading?: boolean+ tooltip?: string+}+/*** Should the Create PR action be offered? Mirrors desktop `canCreateImplementationPr` /* the server-side autostart rules: only when ready & actionable, or blocked on user input.@@ -38,11 +52,11 @@ function canCreateImplementationPr(report: SignalReport): boolean {}/**- * Detail-pane actions: Archive (suppress the report out of the inbox, then return to the list)- * and Create PR (opens an implementation task and navigates to it). Task creation/navigation is- * owned by `inboxTaskKickoffLogic`; archiving reuses the shared `useReportArchive` dialog flow.+ * Detail-pane actions as data: Feedback (always), Archive/Restore, and Create PR. Task+ * creation/navigation is owned by `inboxTaskKickoffLogic`; archiving reuses the shared+ * `useReportArchive` dialog flow. Callers render these inline or inside a menu.*/-export function ReportDetailActions({ report }: { report: SignalReport }): JSX.Element {+export function useReportDetailActions(report: SignalReport): ReportDetailAction[] {const { isCreatingPr } = useValues(inboxTaskKickoffLogic)const { createPrFromReport } = useActions(inboxTaskKickoffLogic)const { reportArchived } = useActions(inboxBulkActionsLogic)@@ -96,79 +110,66 @@ export function ReportDetailActions({ report }: { report: SignalReport }): JSX.E// Feedback is always available – it never changes the report's state, just records what the// user thinks of it (and its PR), so it stays even for resolved/archived reports.- const feedbackButton = (- <LemonButton- type="secondary"- size="small"- icon={<IconMessage />}- tooltip="Tell us how useful this report was"- onClick={() =>- openFeedbackReportDialog({- reportTitle: report.title ?? 'Untitled report',- onConfirm: ({ sentiment, note }) => {- captureInboxReportFeedback({ report, sentiment, note, surface: 'detail_pane' })- lemonToast.success('Thanks for the feedback')- },- })- }- >- Feedback- </LemonButton>- )+ const feedback: ReportDetailAction = {+ key: 'feedback',+ label: 'Feedback',+ icon: <IconMessage />,+ tooltip: 'Tell us how useful this report was',+ onClick: () =>+ openFeedbackReportDialog({+ reportTitle: report.title ?? 'Untitled report',+ onConfirm: ({ sentiment, note }) => {+ captureInboxReportFeedback({ report, sentiment, note, surface: 'detail_pane' })+ lemonToast.success('Thanks for the feedback')+ },+ }),+ }// A resolved report is terminal – its PR already merged, so only feedback applies.if (isResolved) {- return feedbackButton+ return [feedback]}// An already-archived report offers Restore instead of Archive (and no Create PR).if (isArchived) {- return (- <>- {feedbackButton}- <LemonButton- type="secondary"- size="small"- icon={<IconUndo />}- loading={isRestoring}- tooltip="Restore this report to your inbox"- onClick={() => void onRestoreClick()}- >- Restore- </LemonButton>- </>- )+ return [+ feedback,+ {+ key: 'restore',+ label: 'Restore',+ icon: <IconUndo />,+ loading: isRestoring,+ tooltip: 'Restore this report to your inbox',+ onClick: () => void onRestoreClick(),+ },+ ]}- return (- <>- {feedbackButton}- <LemonButton- type="secondary"- size="small"- icon={<IconArchive />}- loading={isArchiving}- tooltip="Archive this report out of your inbox"- onClick={onArchiveClick}- >- Archive- </LemonButton>+ const actions: ReportDetailAction[] = [+ feedback,+ {+ key: 'archive',+ label: 'Archive',+ icon: <IconArchive />,+ loading: isArchiving,+ tooltip: 'Archive this report out of your inbox',+ onClick: onArchiveClick,+ },+ ]++ if (showCreatePr) {+ actions.push({+ key: 'create-pr',+ label: 'Create PR',+ icon: <IconPullRequest />,+ loading: isCreatingPr,+ tooltip: 'Have Self-driving open a pull request for this report',+ onClick: () => {+ captureInboxReportAction({ report, actionType: 'create_pr', surface: 'detail_pane' })+ createPrFromReport(report)+ },+ })+ }- {showCreatePr && (- <LemonButton- type="primary"- size="small"- icon={<IconPullRequest />}- loading={isCreatingPr}- tooltip="Have Self-driving open a pull request for this report"- onClick={() => {- captureInboxReportAction({ report, actionType: 'create_pr', surface: 'detail_pane' })- createPrFromReport(report)- }}- >- Create PR- </LemonButton>- )}- </>- )+ return actions}diff --git a/frontend/src/scenes/inbox/components/detail/ReportTasksSection.tsx b/frontend/src/scenes/inbox/components/detail/ReportTasksSection.tsxindex 174e7f931bf0..f70d66ba7a46 100644--- a/frontend/src/scenes/inbox/components/detail/ReportTasksSection.tsx+++ b/frontend/src/scenes/inbox/components/detail/ReportTasksSection.tsx@@ -1,11 +1,10 @@-import { useValues } from 'kea'+import { useActions, useValues } from 'kea'-import { IconChevronRight, IconTerminal } from '@posthog/icons'-import { Link, Spinner } from '@posthog/lemon-ui'+import { IconChevronDown, IconChevronRight, IconTerminal } from '@posthog/icons'+import { Spinner } from '@posthog/lemon-ui'-import { urls } from 'scenes/urls'--import { Task, TaskRunStatus } from 'products/tasks/frontend/types'+import { isTerminalRunStatus, SandboxRunViewer } from 'products/posthog_ai/frontend/sandbox'+import { TaskRunStatus } from 'products/tasks/frontend/types'import { inboxReportDetailLogic, ReportTaskEntry } from '../../logics/inboxReportDetailLogic'import { SignalReport } from '../../types'@@ -13,9 +12,11 @@ import { RightColumnSection } from './DetailSection'import { TaskRunStatusDot } from './taskRunDisplay'/**- * Renders the report's linked tasks inline (latest status + purpose). Each row opens the- * report's run detail (`AgentRunDetail`), where the task's run log renders inline. The purpose- * label is derived from each task's `task_run` artefact; `repo_selection` runs are filtered out.+ * Renders the report's linked tasks inline (latest status + purpose). Each row expands in place to+ * the task's run transcript via the shared `SandboxRunViewer` — live for an in-progress run, static+ * replay once terminal — mirroring the Code experience instead of navigating away to a separate run+ * page. The purpose label is derived from each task's `task_run` artefact; `repo_selection` runs are+ * filtered out.*/export function ReportTasksSection({ report }: { report: SignalReport }): JSX.Element | null {const { reportTasks, reportTasksLoading } = useValues(inboxReportDetailLogic({ reportId: report.id, report }))@@ -39,31 +40,65 @@ export function ReportTasksSection({ report }: { report: SignalReport }): JSX.El<RightColumnSection icon={<IconTerminal />} title="Runs"><div className="flex flex-col gap-0.5">{reportTasks.map((entry: ReportTaskEntry) => (- <TaskRow key={entry.task.id} entry={entry} reportId={report.id} />+ <TaskRow key={entry.task.id} entry={entry} reportId={report.id} report={report} />))}</div></RightColumnSection>)}-function TaskRow({ entry, reportId }: { entry: ReportTaskEntry; reportId: string }): JSX.Element {+function TaskRow({+ entry,+ reportId,+ report,+}: {+ entry: ReportTaskEntry+ reportId: string+ report: SignalReport+}): JSX.Element {const { task, purposeLabel } = entry+ const { expandedTaskIds } = useValues(inboxReportDetailLogic({ reportId, report }))+ const { toggleExpandedTask } = useActions(inboxReportDetailLogic({ reportId, report }))+const status = task.latest_run?.status ?? TaskRunStatus.NOT_STARTED- // Open this report's run detail (the inbox Runs route); `inboxSceneLogic` handles the cross-tab- // open. The task's run log renders inline there — no need to leave the inbox for the Tasks UI.+ const runId = task.latest_run?.id ?? null+ const replayOnly = isTerminalRunStatus(task.latest_run?.status)+ const expanded = expandedTaskIds.includes(task.id)+return (- <Link- to={urls.inboxReport('runs', reportId)}- className="group flex items-center gap-2 rounded px-1.5 py-1 text-left text-xs no-underline transition-colors hover:bg-fill-highlight-50"- >- <TaskRunStatusDot status={status} />- <span className="shrink-0 text-secondary">{purposeLabel}</span>- <span className="ml-auto truncate text-tertiary">{getTaskTitle(task)}</span>- <IconChevronRight className="shrink-0 text-tertiary opacity-0 transition-opacity group-hover:opacity-100" />- </Link>- )-}+ <div>+ <button+ type="button"+ onClick={() => toggleExpandedTask(task.id)}+ className="group flex w-full items-center gap-2 rounded px-1.5 py-1 text-left text-xs transition-colors hover:bg-fill-highlight-50"+ >+ {expanded ? (+ <IconChevronDown className="shrink-0 text-tertiary" />+ ) : (+ <IconChevronRight className="shrink-0 text-tertiary" />+ )}+ <TaskRunStatusDot status={status} />+ <span className="shrink-0 text-secondary">{purposeLabel}</span>+ </button>-function getTaskTitle(task: Task): string {- return task.title || 'Untitled'+ {expanded ? (+ <div className="mt-1.5 mb-1 ml-1.5">+ {runId ? (+ <div className="h-[420px] overflow-y-auto rounded border border-primary bg-surface-primary">+ <SandboxRunViewer+ taskId={task.id}+ runId={runId}+ replayOnly={replayOnly}+ className="px-3 py-2"+ />+ </div>+ ) : (+ <div className="rounded border border-primary bg-surface-primary px-3 py-2.5 text-xs text-secondary leading-snug">+ This run hasn’t started yet – its agent log will appear here once it does.+ </div>+ )}+ </div>+ ) : null}+ </div>+ )}diff --git a/frontend/src/scenes/inbox/components/detail/SuggestedReviewersSection.tsx b/frontend/src/scenes/inbox/components/detail/SuggestedReviewersSection.tsxindex 6bd625623025..6a706652db02 100644--- a/frontend/src/scenes/inbox/components/detail/SuggestedReviewersSection.tsx+++ b/frontend/src/scenes/inbox/components/detail/SuggestedReviewersSection.tsx@@ -1,7 +1,7 @@import { useActions, useValues } from 'kea'import { useMemo, useState } from 'react'-import { IconCheck, IconPeople, IconPlus, IconX } from '@posthog/icons'+import { IconCheck, IconInfo, IconPeople, IconPlus, IconX } from '@posthog/icons'import { LemonButton, LemonInput, Link, Spinner, Tooltip } from '@posthog/lemon-ui'import { LemonDropdown } from 'lib/lemon-ui/LemonDropdown'@@ -10,6 +10,8 @@ import { PersonDisplay } from 'scenes/persons/PersonDisplay'import { captureInboxReportAction } from '../../inboxAnalytics'import { inboxReportDetailLogic } from '../../logics/inboxReportDetailLogic'import { EnrichedReviewer, SignalReport } from '../../types'++const MAX_VISIBLE_REVIEWERS = 5import { RightColumnSection } from './DetailSection'import {AvailableReviewerOption,@@ -43,6 +45,7 @@ export function SuggestedReviewersSection({ report }: { report: SignalReport }):const [addOpen, setAddOpen] = useState(false)const [query, setQuery] = useState('')+ const [showAllReviewers, setShowAllReviewers] = useState(false)const reviewers = displayReviewersconst baseReviewers = reviewers ?? []@@ -107,6 +110,11 @@ export function SuggestedReviewersSection({ report }: { report: SignalReport }):title="Reviewers"rightSlot={<div className="flex items-center gap-2">+ <Tooltip title="Suggested reviewers are tracked in PostHog. To request a review on GitHub, add them on the pull request directly.">+ <span className="-m-1 flex cursor-help items-center p-1 text-base text-tertiary">+ <IconInfo />+ </span>+ </Tooltip>{isUpdatingReviewers && <Spinner className="size-3" />}<LemonDropdownvisible={addOpen}@@ -190,14 +198,27 @@ export function SuggestedReviewersSection({ report }: { report: SignalReport }):<span className="text-xs text-tertiary">No reviewers assigned. Use "Add" to suggest one.</span>) : (<div className="flex flex-col gap-1.5">- {baseReviewers.map((reviewer: EnrichedReviewer) => (- <ReviewerRow- key={reviewer.user?.uuid ?? reviewer.github_login}- reviewer={reviewer}- disabled={isUpdatingReviewers}- onRemove={() => removeReviewer(reviewer)}- />- ))}+ {(showAllReviewers ? baseReviewers : baseReviewers.slice(0, MAX_VISIBLE_REVIEWERS)).map(+ (reviewer: EnrichedReviewer) => (+ <ReviewerRow+ key={reviewer.user?.uuid ?? reviewer.github_login}+ reviewer={reviewer}+ disabled={isUpdatingReviewers}+ onRemove={() => removeReviewer(reviewer)}+ />+ )+ )}+ {baseReviewers.length > MAX_VISIBLE_REVIEWERS && (+ <LemonButton+ size="xsmall"+ type="tertiary"+ fullWidth+ onClick={() => setShowAllReviewers((show) => !show)}+ className="text-tertiary"+ >+ {showAllReviewers ? 'Show less' : `Show all (${baseReviewers.length})`}+ </LemonButton>+ )}</div>)}</RightColumnSection>@@ -265,15 +286,13 @@ function ReviewerRow({{reviewer.relevant_commits.map((commit, i) => (<span key={commit.sha}>{i > 0 && ', '}- <Tooltip title={commit.reason || undefined}>- <Link- to={commit.url}- target="_blank"- className="font-mono text-tertiary hover:text-primary"- >- {commit.sha.slice(0, 7)}- </Link>- </Tooltip>+ <Link+ to={commit.url}+ target="_blank"+ className="font-mono text-tertiary hover:text-primary"+ >+ {commit.sha.slice(0, 7)}+ </Link></span>))}</span>diff --git a/frontend/src/scenes/inbox/components/shell/InboxSearchFilterBar.tsx b/frontend/src/scenes/inbox/components/shell/InboxSearchFilterBar.tsxindex 3186dd3b3257..812b7911efc4 100644--- a/frontend/src/scenes/inbox/components/shell/InboxSearchFilterBar.tsx+++ b/frontend/src/scenes/inbox/components/shell/InboxSearchFilterBar.tsx@@ -1,19 +1,16 @@import { useActions, useValues } from 'kea'import { useState } from 'react'-import { IconCheck, IconChevronDown, IconFlag, IconRefresh, IconSearch, IconSort, IconTarget } from '@posthog/icons'+import { IconCheck, IconChevronDown, IconRefresh, IconSearch, IconSort, IconTarget } from '@posthog/icons'import { LemonButton, LemonDropdown, LemonInput } from '@posthog/lemon-ui'import {- INBOX_PRIORITY_OPTIONS,INBOX_SORT_OPTIONS,INBOX_SOURCE_OPTIONS,- inboxPriorityFilterLabel,inboxSortOptionKey,inboxSourceFilterLabel,} from '../../filterOptions'import { inboxFiltersLogic } from '../../logics/inboxFiltersLogic'-import { SignalReportPriority } from '../../types'/** A single filter trigger + dropdown overlay, matching desktop's `InboxFilterPopover`. */function FilterPopover({@@ -89,7 +86,7 @@ interface InboxSearchFilterBarProps {}/**- * Search input + Source / Sort / Priority filter popovers + refresh. One-to-one+ * Search input + Source / Sort filter popovers + refresh. One-to-one* port of desktop `InboxSearchFilterBar`. There is no status filter (desktop* dropped it; status is a fixed request constant). Filter state is persisted via* `inboxFiltersLogic`; the central scene reloads on change.@@ -99,8 +96,8 @@ export function InboxSearchFilterBar({onRefresh,refreshing,}: InboxSearchFilterBarProps): JSX.Element {- const { searchQuery, sortField, sortDirection, sourceProductFilter, priorityFilter } = useValues(inboxFiltersLogic)- const { setSearchQuery, setSort, toggleSourceProduct, togglePriority } = useActions(inboxFiltersLogic)+ const { searchQuery, sortField, sortDirection, sourceProductFilter } = useValues(inboxFiltersLogic)+ const { setSearchQuery, setSort, toggleSourceProduct } = useActions(inboxFiltersLogic)const activeSort = INBOX_SORT_OPTIONS.find((o) => o.field === sortField && o.direction === sortDirection)const activeSortKey = inboxSortOptionKey(sortField, sortDirection)@@ -151,29 +148,6 @@ export function InboxSearchFilterBar({))}</FilterPopover>- <FilterPopover- label="Priority"- value={inboxPriorityFilterLabel(priorityFilter)}- icon={<IconFlag />}- active={priorityFilter.length > 0}- >- {INBOX_PRIORITY_OPTIONS.map((option) => (- <FilterItem- key={option.value}- icon={- <span- className="inline-block size-2 shrink-0 rounded-full"- // eslint-disable-next-line react/forbid-dom-props- style={{ backgroundColor: option.accent }}- />- }- label={option.value}- active={priorityFilter.includes(option.value)}- onClick={() => togglePriority(option.value as SignalReportPriority)}- />- ))}- </FilterPopover>-{onRefresh && (<LemonButtontype="secondary"diff --git a/frontend/src/scenes/inbox/components/shell/InboxTabBar.tsx b/frontend/src/scenes/inbox/components/shell/InboxTabBar.tsxindex 74fb389df9c5..e9d1a1679802 100644--- a/frontend/src/scenes/inbox/components/shell/InboxTabBar.tsx+++ b/frontend/src/scenes/inbox/components/shell/InboxTabBar.tsx@@ -10,6 +10,7 @@ import { INBOX_FLAT_TAB_LIST_PARAMS, reportListLogic } from '../../logics/reportimport {INBOX_FLAT_LIST_TAB_KEYS,INBOX_STAFF_ONLY_TAB_KEYS,+ INBOX_TAB_BAR_HIDDEN_KEYS,INBOX_TAB_KEYS,INBOX_TAB_LABEL,InboxFlatListTabKey,@@ -24,6 +25,10 @@ function isStaffOnlyTabKey(tab: InboxTabKey): boolean {return (INBOX_STAFF_ONLY_TAB_KEYS as string[]).includes(tab)}+function isTabBarHiddenKey(tab: InboxTabKey): boolean {+ return (INBOX_TAB_BAR_HIDDEN_KEYS as string[]).includes(tab)+}+/*** Count chip for a flat report tab. Mounts that tab's `reportListLogic` so its `count`* (a cheap `limit=1` request) is available for the badge before the tab is ever opened.@@ -47,10 +52,11 @@ const WELCOME_TAB_KEY = 'welcome'type InboxTabBarKey = InboxTabKey | typeof WELCOME_TAB_KEY/**- * Tab bar: Pull requests / Reports (everyone) + Not actionable / Runs (staff-only, with a- * "Staff" tag). Each report tab shows its own server-computed count. The Configuration tab- * is only shown when `showConfigTab` is set – i.e. when the scene is too narrow for the- * setup rail; on wide viewports the rail replaces it.+ * Tab bar: Pull requests / Reports (everyone) + Not actionable (staff-only, with a "Staff" tag).+ * Each report tab shows its own server-computed count. The Runs tab is deprecated from the bar+ * (its run logs now expand inline in the report detail); its route stays for deep links. The+ * Configuration tab is only shown when `showConfigTab` is set – i.e. when the scene is too narrow+ * for the setup rail; on wide viewports the rail replaces it.** In `onboarding` mode (self-driving not set up, empty inbox) a locked "Welcome" tab is shown and* selected, while the real tabs stay visible but disabled – the user can see what's coming, but the@@ -63,10 +69,10 @@ export function InboxTabBar({showConfigTab?: booleanonboarding?: boolean}): JSX.Element {- const { activeTab, isStaff, runsCount, runsResponse, runsResponseLoading } = useValues(inboxSceneLogic)+ const { activeTab, isStaff } = useValues(inboxSceneLogic)const visibleTabKeys = INBOX_TAB_KEYS.filter(- (key) => (key !== 'config' || showConfigTab) && (!isStaffOnlyTabKey(key) || isStaff)+ (key) => !isTabBarHiddenKey(key) && (key !== 'config' || showConfigTab) && (!isStaffOnlyTabKey(key) || isStaff))const realTabs = visibleTabKeys.map((key) => ({@@ -75,12 +81,6 @@ export function InboxTabBar({<span className="flex items-center gap-1.5"><span>{INBOX_TAB_LABEL[key]}</span>{isFlatListTabKey(key) && <FlatTabCount tabKey={key} />}- {key === 'runs' &&- (runsResponse === null && runsResponseLoading ? (- <LemonSkeleton className="h-3 w-3 rounded" />- ) : (- <span className="text-xs text-muted tabular-nums">{runsCount}</span>- ))}{isStaffOnlyTabKey(key) && (<LemonTag type="completion" size="small">Staffdiff --git a/frontend/src/scenes/inbox/filterOptions.tsx b/frontend/src/scenes/inbox/filterOptions.tsxindex 6bfad265afd8..669aeb6cd1e3 100644--- a/frontend/src/scenes/inbox/filterOptions.tsx+++ b/frontend/src/scenes/inbox/filterOptions.tsx@@ -43,8 +43,8 @@ export const PRIORITY_ACCENT: Record<SignalReportPriority, string> = {}// Port of desktop `@posthog/ui/features/inbox/filterOptions`. Drives the Source /-// Sort / Priority filter popovers. Source-product values match the backend-// `source_product` values; priority values are P0–P4.+// Sort filter popovers. Source-product values match the backend+// `source_product` values.export interface InboxSortOption {label: string@@ -60,10 +60,6 @@ export const INBOX_SORT_OPTIONS: InboxSortOption[] = [{ label: 'Oldest first', field: 'created_at', direction: 'asc', icon: <IconClock /> },]-export const INBOX_PRIORITY_OPTIONS: { value: SignalReportPriority; accent: string }[] = (- ['P0', 'P1', 'P2', 'P3', 'P4'] as SignalReportPriority[]-).map((value) => ({ value, accent: PRIORITY_ACCENT[value] }))-export const INBOX_SOURCE_OPTIONS: { value: string; label: string; icon: JSX.Element }[] = [{ value: 'session_replay', label: 'Session replay', icon: <IconRewindPlay /> },{ value: 'error_tracking', label: 'Error tracking', icon: <IconBug /> },@@ -89,13 +85,3 @@ export function inboxSourceFilterLabel(selected: string[]): string {}return `${selected.length} sources`}--export function inboxPriorityFilterLabel(selected: SignalReportPriority[]): string {- if (selected.length === 0) {- return 'All priorities'- }- if (selected.length <= 2) {- return selected.join(', ')- }- return `${selected.length} priorities`-}diff --git a/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts b/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.tsindex 872e9a88cae0..110c2d42a725 100644--- a/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts+++ b/frontend/src/scenes/inbox/logics/inboxReportDetailLogic.ts@@ -108,6 +108,8 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([searchAvailableReviewers: (query: string) => ({ query }),// Which linked task's run log the detail view shows; null falls back to `primaryTask`.setSelectedTaskId: (taskId: string | null) => ({ taskId }),+ // Inline-expand a linked task's run log within the report detail's Runs section.+ toggleExpandedTask: (taskId: string) => ({ taskId }),}),loaders(({ props, values }) => ({@@ -224,6 +226,16 @@ export const inboxReportDetailLogic = kea<inboxReportDetailLogicType>([setReport: () => null,},],+ // Linked tasks whose run log is expanded inline in the Runs section. Reset when the report+ // changes so a freshly opened report starts with everything collapsed.+ expandedTaskIds: [+ [] as string[],+ {+ toggleExpandedTask: (state, { taskId }) =>+ state.includes(taskId) ? state.filter((id) => id !== taskId) : [...state, taskId],+ setReport: () => [],+ },+ ],}),selectors({diff --git a/frontend/src/scenes/inbox/types.ts b/frontend/src/scenes/inbox/types.tsindex 922fbb89e90d..31c506a2d3ad 100644--- a/frontend/src/scenes/inbox/types.ts+++ b/frontend/src/scenes/inbox/types.ts@@ -141,6 +141,14 @@ export const INBOX_REPORT_TAB_KEYS: InboxTabKey[] = ['pulls', 'reports', 'not-ac*/export const INBOX_STAFF_ONLY_TAB_KEYS: InboxTabKey[] = ['not-actionable', 'runs']+/**+ * Tabs deprecated from the tab bar entirely (route preserved for back-compat / deep links). The+ * per-report run logs now expand inline within the report detail's Runs section, so the standalone+ * project-wide Runs view no longer earns a tab. `urls.inboxReport('runs', …)` and `urls.inbox('runs')`+ * still resolve to `AgentRunDetail` / `RunsTab` for anything that deep-links to them.+ */+export const INBOX_TAB_BAR_HIDDEN_KEYS: InboxTabKey[] = ['runs']+/** The flat report-list tabs that share the keyed reportListLogic + InboxReportList primitive. */export const INBOX_FLAT_LIST_TAB_KEYS = ['pulls', 'reports', 'not-actionable', 'archived'] as constexport type InboxFlatListTabKey = (typeof INBOX_FLAT_LIST_TAB_KEYS)[number]diff --git a/products/signals/backend/management/commands/seed_inbox_data.py b/products/signals/backend/management/commands/seed_inbox_data.pynew file mode 100644index 000000000000..bbc2f549c2a0--- /dev/null+++ b/products/signals/backend/management/commands/seed_inbox_data.py@@ -0,0 +1,371 @@+"""Local dev tool: seed the Signals inbox with a spread of realistic reports + task runs.++Drops several fully-formed `SignalReport`s into the inbox so the UI has something to look at —+each one persisted through the same `_persist_agentic_report_artefacts` path the agentic flow uses+(priority / actionability / reviewers / findings artefacts), then advanced to a terminal state.++Most reports also get a `tasks.Task` + `TaskRun` with a synthetic JSONL transcript written to object+storage, so the inbox's inline run viewer renders a real-looking agent log without running a sandbox.+Tasks/runs are created through the tasks facade (the product is isolated) — never by touching its ORM.++DEBUG only.++ python manage.py seed_inbox_data --team-id 1+ python manage.py seed_inbox_data --team-id 1 --count 12 --clear+ python manage.py seed_inbox_data --team-id 1 --no-runs+"""++import json+import asyncio+from pathlib import Path++from django.conf import settings+from django.core.management.base import BaseCommand, CommandError+from django.db import transaction++from posthog.models import OrganizationMembership, Team++from products.signals.backend.artefact_schemas import (+ SIGNALS_PRODUCT,+ TASK_RUN_TYPE_IMPLEMENTATION,+ Commit,+ NoteArtefact,+ RelevantCommit,+ SuggestedReviewerEntry,+ SuggestedReviewers,+ TaskRunArtefact,+)+from products.signals.backend.models import ArtefactAttribution, SignalReport, SignalReportArtefact+from products.signals.backend.report_generation.research import ReportResearchOutput+from products.signals.backend.report_generation.select_repo import RepoSelectionResult+from products.signals.backend.temporal.agentic.report import _persist_agentic_report_artefacts+from products.tasks.backend.facade import api as tasks_facade++_FIXTURES_DIR = Path(__file__).resolve().parents[2] / "report_generation" / "fixtures"+_DEFAULT_REPOSITORY = "posthog/posthog"++# Terminal states cycled across the seeded reports so the inbox shows more than one status. Kept to+# states reachable from in_progress without extra side effects; READY dominates since it's the+# actionable inbox state users actually triage.+_FINAL_STATES = [+ SignalReport.Status.READY,+ SignalReport.Status.READY,+ SignalReport.Status.PENDING_INPUT,+ SignalReport.Status.READY,+ SignalReport.Status.RESOLVED,+]+++class Command(BaseCommand):+ help = "Seed the Signals inbox with realistic reports and task runs (DEBUG only)."++ def add_arguments(self, parser):+ parser.add_argument("--team-id", type=int, required=True, help="Team to seed reports for")+ parser.add_argument(+ "--user-id",+ type=int,+ default=None,+ help="User to attribute tasks to (default: first member of the team's organization)",+ )+ parser.add_argument(+ "--count",+ type=int,+ default=None,+ help="How many reports to create (default: one per fixture; cycles fixtures when larger)",+ )+ parser.add_argument(+ "--clear",+ action="store_true",+ help="Delete the team's existing signal reports (and their artefacts) before seeding",+ )+ parser.add_argument(+ "--no-runs",+ dest="with_runs",+ action="store_false",+ help="Skip creating task runs + logs (reports and artefacts only)",+ )++ def handle(self, *args, **options):+ if not settings.DEBUG:+ raise CommandError("This command can only be run with DEBUG=True")++ team = self._get_team(options["team_id"])+ user_id = self._resolve_user_id(team, options["user_id"])+ fixtures = self._load_fixtures()+ count = options["count"] or len(fixtures)++ if options["clear"]:+ self._clear_existing(team)++ created = 0+ for index in range(count):+ name, repository, result = fixtures[index % len(fixtures)]+ final_status = _FINAL_STATES[index % len(_FINAL_STATES)]+ report = self._seed_report(team, result, repository, final_status)+ self.stdout.write(f" · {report.status:<13} {result.title[:70]} ({name})")++ self._add_extra_log_artefacts(team.id, str(report.id), repository, index)+ self._add_suggested_reviewers(team.id, str(report.id), repository, index)+ if options["with_runs"]:+ self._seed_task_run(team, user_id, report, repository, index)+ created += 1++ self.stdout.write(self.style.SUCCESS(f"Seeded {created} report(s) for team {team.id} ({team.name})."))++ # ── setup ──────────────────────────────────────────────────────────────────++ def _get_team(self, team_id: int) -> Team:+ try:+ return Team.objects.select_related("organization").get(id=team_id)+ except Team.DoesNotExist:+ raise CommandError(f"Team {team_id} not found")++ def _resolve_user_id(self, team: Team, user_id: int | None) -> int:+ if user_id is not None:+ return user_id+ membership = (+ OrganizationMembership.objects.filter(organization_id=team.organization_id)+ .order_by("joined_at")+ .values_list("user_id", flat=True)+ .first()+ )+ if membership is None:+ raise CommandError(f"Team {team.id}'s organization has no members; pass --user-id explicitly")+ return membership++ def _load_fixtures(self) -> list[tuple[str, str, ReportResearchOutput]]:+ fixtures: list[tuple[str, str, ReportResearchOutput]] = []+ for path in sorted(_FIXTURES_DIR.glob("*.json")):+ try:+ payload = json.loads(path.read_text())+ except json.JSONDecodeError as e:+ self.stdout.write(self.style.WARNING(f"Skipping unparseable fixture {path.name}: {e}"))+ continue+ if not isinstance(payload, dict):+ continue+ result_payload = payload.get("result")+ if result_payload is None:+ continue+ try:+ result = ReportResearchOutput.model_validate(result_payload)+ except Exception as e:+ self.stdout.write(self.style.WARNING(f"Skipping invalid fixture {path.name}: {e}"))+ continue+ repository = payload.get("repository") or _DEFAULT_REPOSITORY+ fixtures.append((path.stem, repository, result))+ if not fixtures:+ raise CommandError(f"No usable report fixtures found in {_FIXTURES_DIR}")+ return fixtures++ def _clear_existing(self, team: Team) -> None:+ deleted, _ = SignalReport.objects.filter(team=team).delete()+ self.stdout.write(self.style.WARNING(f"Deleted {deleted} existing signal report row(s) for team {team.id}"))++ # ── report + artefacts ─────────────────────────────────────────────────────++ def _seed_report(+ self, team: Team, result: ReportResearchOutput, repository: str, final_status: SignalReport.Status+ ) -> SignalReport:+ signal_count = max(len(result.effective_findings()), 1)++ with transaction.atomic():+ report = SignalReport.objects.create(+ team=team,+ status=SignalReport.Status.POTENTIAL,+ signal_count=signal_count,+ total_weight=float(signal_count),+ )+ report.save(update_fields=report.transition_to(SignalReport.Status.CANDIDATE))+ report.save(update_fields=report.transition_to(SignalReport.Status.IN_PROGRESS, signals_at_run_increment=3))++ # The persist path only writes `new_artefacts`; fixtures captured mid-run keep content in+ # `old_artefacts`, so coalesce everything into `new_artefacts` to guarantee the judgments /+ # findings actually land for a seeded report.+ result = result.model_copy(+ update={"new_artefacts": [*result.old_artefacts, *result.new_artefacts], "old_artefacts": []}+ )++ repo_selection = RepoSelectionResult(repository=repository, reason="seed_inbox_data: synthetic seed report")+ asyncio.run(_persist_agentic_report_artefacts(team.id, str(report.id), result, repo_selection))++ self._advance_to_final(report, result, final_status)+ return report++ def _advance_to_final(+ self, report: SignalReport, result: ReportResearchOutput, final_status: SignalReport.Status+ ) -> None:+ with transaction.atomic():+ report.refresh_from_db()+ report.save(+ update_fields=report.transition_to(+ SignalReport.Status.READY, title=result.title, summary=result.summary+ )+ )+ if final_status == SignalReport.Status.READY:+ return+ try:+ report.save(update_fields=report.transition_to(final_status))+ except Exception as e:+ # Keep the report at READY rather than aborting the seed on an unexpected transition.+ self.stdout.write(self.style.WARNING(f" left at READY ({final_status} transition failed: {e})"))++ def _add_extra_log_artefacts(self, team_id: int, report_id: str, repository: str, index: int) -> None:+ SignalReportArtefact.add_log(+ team_id=team_id,+ report_id=report_id,+ content=NoteArtefact(+ note="Seeded by `seed_inbox_data` for local UI development.", author="seed_inbox_data"+ ),+ attribution=ArtefactAttribution.system(),+ )+ SignalReportArtefact.add_log(+ team_id=team_id,+ report_id=report_id,+ content=Commit(+ repository=repository,+ branch=f"signals/seed-fix-{index + 1}",+ commit_sha=f"{(index + 1) * 1111111:07x}",+ message="fix: address the issue surfaced by this report",+ note="Synthetic commit from the inbox seed script.",+ ),+ attribution=ArtefactAttribution.system(),+ )++ def _add_suggested_reviewers(self, team_id: int, report_id: str, repository: str, index: int) -> None:+ # Reviewers are normally derived from finding commit hashes via GitHub, which won't resolve+ # locally — so seed them directly. Counts vary (1..7) so some reports exercise the list-overflow.+ reviewer_count = 1 + (index % 7)+ logins = ["timgl", "marius", "yakkomajuri", "neilkakkar", "macobo", "hazzadous", "pauldambra", "benjackwhite"]+ entries = [+ SuggestedReviewerEntry(+ github_login=logins[i % len(logins)],+ github_name=logins[i % len(logins)].title(),+ relevant_commits=[+ RelevantCommit(+ reason="Authored the most relevant code path for this report.",+ sha=f"{(index + i + 1) * 2468013:07x}",+ url=f"https://github.com/{repository}/commit/{(index + i + 1) * 2468013:07x}",+ )+ ],+ )+ for i in range(reviewer_count)+ ]+ SignalReportArtefact.append_status(+ team_id=team_id,+ report_id=report_id,+ content=SuggestedReviewers(entries),+ attribution=ArtefactAttribution.system(),+ reevaluate_autostart=False,+ )++ # ── task run + logs ────────────────────────────────────────────────────────++ def _seed_task_run(self, team: Team, user_id: int, report: SignalReport, repository: str, index: int) -> None:+ try:+ created = tasks_facade.create_and_run_task(+ team=team,+ title=report.title or "Investigate inbox report",+ description=report.summary or "Synthetic implementation task seeded for the inbox.",+ origin_product=tasks_facade.TaskOriginProduct.SIGNAL_REPORT,+ user_id=user_id,+ repository=repository,+ create_pr=False,+ start_workflow=False,+ signal_report_id=str(report.id),+ internal=False,+ )+ except Exception as e:+ self.stdout.write(self.style.WARNING(f" skipped task run (task creation failed: {e})"))+ return++ run = created.latest_run+ if run is None:+ self.stdout.write(self.style.WARNING(" skipped task run (no run was created)"))+ return++ task_id, run_id = str(created.task_id), str(run.id)+ branch = f"signals/seed-fix-{index + 1}"+ pr_url = f"https://github.com/{repository}/pull/{1000 + index}"++ tasks_facade.append_task_run_log(+ run_id, task_id, team.id, entries=_build_transcript(report.title or "this report", index)+ )+ tasks_facade.update_task_run(+ run_id,+ task_id,+ team.id,+ validated_data={+ "status": "completed",+ "stage": "build",+ "branch": branch,+ "output": {"pr_url": pr_url, "branch": branch},+ },+ )+ SignalReportArtefact.add_log(+ team_id=team.id,+ report_id=str(report.id),+ content=TaskRunArtefact(+ task_id=task_id, run_id=run_id, product=SIGNALS_PRODUCT, type=TASK_RUN_TYPE_IMPLEMENTATION+ ),+ attribution=ArtefactAttribution.from_task(task_id),+ )+++# ── synthetic transcript ───────────────────────────────────────────────────────+++def _agent_message(text: str) -> dict:+ return {+ "notification": {+ "method": "session/update",+ "params": {"update": {"sessionUpdate": "agent_message", "content": {"type": "text", "text": text}}},+ }+ }+++def _user_message(text: str) -> dict:+ return {+ "notification": {+ "method": "session/update",+ "params": {"update": {"sessionUpdate": "user_message", "content": {"type": "text", "text": text}}},+ }+ }+++def _tool_call(title: str) -> dict:+ return {+ "notification": {+ "method": "session/update",+ "params": {"update": {"sessionUpdate": "tool_call", "title": title}},+ }+ }+++def _usage_update(used: int, cost: float) -> dict:+ return {+ "notification": {+ "method": "session/update",+ "params": {"update": {"sessionUpdate": "usage_update", "used": used, "cost": cost}},+ }+ }+++def _end_turn() -> dict:+ return {"notification": {"result": {"stopReason": "end_turn"}}}+++def _build_transcript(report_title: str, index: int) -> list[dict]:+ """A short, realistic agent transcript in the JSONL shape the sandbox viewer parses."""+ tool_titles = ["grep", "read_file", "git blame", "edit_file", "run_tests"]+ return [+ _user_message(f"Investigate and fix: {report_title}"),+ _agent_message("Reading the report and locating the relevant code paths."),+ _tool_call(tool_titles[index % len(tool_titles)]),+ _agent_message("Found the root cause. The issue is a missing guard around the affected branch."),+ _tool_call("edit_file"),+ _agent_message("Applied the fix and added a regression test."),+ _tool_call("run_tests"),+ _usage_update(used=1850 + index * 120, cost=0.0021 + index * 0.0003),+ _agent_message("Tests pass. Opening a pull request with the change."),+ _end_turn(),+ ]