:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(error-tracking): show linked inbox reports on the issue page (#64772)
Michael Matloka14e72815361f
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 21d26d62b8eb..eb48c617559f 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -5890,6 +5890,10 @@ snapshots:hash: v1.k794b7964.effa172f53e0be752b64baf59ec6eb6d8d1394084844090bc09e7ef90a7bad06.Ez9jT5d8PoIOaqzCrvVXd1-PgMzu_wVuE69ziQkNYEAscenes-app-errortracking--group-page--light:hash: v1.k794b7964.ec5dcd889de8bf9fff7fe365a739272b442202e9e16287424f1fbbcfb9ba66f5.73VkDZwxaOr8lS6XVTl-77-nkJnWYud2zj9tfDIH0QA+ scenes-app-errortracking--group-page-with-self-driving--dark:+ hash: v1.k794b7964.95abde46e14e06256c141eb15aac3c3db588f720db2c7515461a71bcd16f571d.r6tURZmk4glz5LGEfYDPNVqo6NC0SNya16D8kNGnY7A+ scenes-app-errortracking--group-page-with-self-driving--light:+ hash: v1.k794b7964.6f40e8d5a1f3730b7842b30e4471b9cbd6123de32ed5edb9197a0bcc78f72bc2.Wg52Oi9DhUX2bPxOyYR5DJynIvhUxhldJveDE2-HmF0scenes-app-errortracking--list-page--dark:hash: v1.k794b7964.f474d0d6caf49e7b9a4cfd469546ab9de031039030fb9da704293bc40d87e69a.WxsvGwytEdwdnq8_Ywy_dgGBBYoSYCX9hX72AB42bgsscenes-app-errortracking--list-page--light:@@ -5902,6 +5906,18 @@ snapshots:hash: v1.k794b7964.75e6c2741dfe10d612b5ebfba86bd7f9f0a8fc0836ee33ba4b324b18db3f4248.6pl5Tn_T-S9dXtYACltccR4oPl2X_lOfEyg0GXH5Hpcscenes-app-errortracking--list-page-with-source-maps-banner--light:hash: v1.k794b7964.f10e31beaea75632de5d0fb3611c527d9e1c523c347bc3091d18c542fdf81743.W31jW6d-fZfXWZB7sJkDPgRcx2L4-j1CQxqWEX4PtIg+ scenes-app-errortracking-linkedreports--fix-proposed--dark:+ hash: v1.k794b7964.1b50022f8fafb4684dacd255b966bd2969f79e84d5c7c7daeb68291772a1e36d.9uyjrwufsjMCFx9c7cjsoIyabB3A4ZBnPSVUouM0RZE+ scenes-app-errortracking-linkedreports--fix-proposed--light:+ hash: v1.k794b7964.55ab1b408ab7d4610f66f2bb35d13dfabcf5188d4281f52f2a051b40392fb7b9.9jUiUdXP-J66RW2MssU_oFrMfC-C4TK3ereJqyATDLw+ scenes-app-errortracking-linkedreports--narrow-pane--dark:+ hash: v1.k794b7964.d7527da21c5cb2847a7b40caa0767ff77c136491254ce50d3ce781ea0d3a3a9c.RQX9dwgdc9l1Xb8cETpKphmQTd3u0dBP5UKYfbWwe7E+ scenes-app-errortracking-linkedreports--narrow-pane--light:+ hash: v1.k794b7964.6b648e58ee1ccea37ad71a538748a2fdb29b2dbf23f92f88c25c36b1e685a3bd.BaQlVB4KrfxkDGdwlfht7SFDOHNQ40PHeuEa8Ssp50U+ scenes-app-errortracking-linkedreports--several-reports-across-states--dark:+ hash: v1.k794b7964.71fdce87c3009faea6dd25e6ac817d5790ffed494cb15d66a7043b4ebe90cb60.rYWzblIjD-Ceyh15tkUkDm10Pu7exKRUm9n9TsB9B0Q+ scenes-app-errortracking-linkedreports--several-reports-across-states--light:+ hash: v1.k794b7964.fe2161a3bb0e898689ef58a342d071c353ded71ac270a62998ea566055359e7a.AnoCs1sNoTY6J1yl24yuZPh_1Jkjugz-jnYxHgY8ZyUscenes-app-events--event-explorer--dark:hash: v1.k794b7964.37b0783b0099a978beace09a9e97c9c24b4efd25eab561f7873494c40912f607.lhExCd9bHbFLYiVjEsoqKRUpnpYEv4pf0TAllwFc8jUscenes-app-events--event-explorer--light:@@ -7083,7 +7099,7 @@ snapshots:scenes-app-settings-authentication-domains--no-domains--light:hash: v1.k794b7964.37755257eeeb09bcb190a4623e6554e356ffcc6b4e61086b8d2427a3796af34b.eJhnmp6Mqw_TfNQhRHgzZylOtfr8VMwxaRjOdzUHuiIscenes-app-settings-authentication-domains--one-unverified-domain--dark:- hash: v1.k794b7964.d2354aea8e40abfcfeb18691d15e48abc24724460dbc0118185c750d3f8ce6d1.Gcj1tCTTgepeyP-Ep4JIhieodM8RlFeAjTQGNkP2UeQ+ hash: v1.k794b7964.11e795b95ee29357fe93fe8ccb852883b312788d135f6c7103d013e156023a2c.MFrqXPXOcgjF_cecrqvo7ezvtKG9cI9EuD72ZpIlQpQscenes-app-settings-authentication-domains--one-unverified-domain--light:hash: v1.k794b7964.826b954e1c03e3156d0c10598975c3fd43583672372c163fa08264506f929cd7.C22X_4g68JpmDtmjwe33M24AQZ4CTTIwW2cMZPL0JCoscenes-app-settings-environment--settings-environment-access-control--dark:diff --git a/frontend/src/lib/signals/SignalReportFixOrStatus.tsx b/frontend/src/lib/signals/SignalReportFixOrStatus.tsxnew file mode 100644index 000000000000..89efa137575d--- /dev/null+++ b/frontend/src/lib/signals/SignalReportFixOrStatus.tsx@@ -0,0 +1,51 @@+import { Tooltip } from '@posthog/lemon-ui'++import type { SignalReportApi } from 'products/signals/frontend/generated/api.schemas'+import {+ STATUS_LABELS,+ STATUS_TOOLTIPS,+} from 'products/signals/frontend/inbox/components/badges/SignalReportStatusBadge'+import type { SignalReportStatus } from 'products/signals/frontend/inbox/types'+import { parsePrUrlParts, safeHttpUrl } from 'products/signals/frontend/inbox/utils/reportPresentation'++import { derivePrState, type PrBadgeState } from './prState'+import { PrBadge } from './SignalReportPrBadge'++/** The inbox's own labels are written to stand alone in a badge, so this surface phrases the same+ * states as a sentence a teammate can act on. The state derivation stays shared. */+const FIX_LABEL: Record<PrBadgeState, string> = {+ open: 'Fix proposed',+ merged: 'Fix merged',+ closed: 'Fix closed',+}++/**+ * Whether it shipped, which is what someone looking at the thing a report came from most needs. A+ * pull request says that better than the report's own status, so the status is the fallback rather+ * than a second badge: either there's no PR, or its URL doesn't parse as one.+ *+ * `PrBadge` brings the link, state colour, and the external-link and accessibility handling the inbox+ * already got right.+ */+export function SignalReportFixOrStatus({ report }: { report: SignalReportApi }): JSX.Element {+ // The URL comes from an agent's raw task-run output and isn't scheme-validated server-side.+ const prUrl = safeHttpUrl(report.implementation_pr_url)+ const prNumber = prUrl ? parsePrUrlParts(prUrl)?.number : undefined+ if (prUrl && prNumber) {+ const state = derivePrState(report.status, report.implementation_pr_merged)+ return (+ <div className="flex items-center gap-1.5">+ <span className="text-xs font-semibold">{FIX_LABEL[state]}</span>+ <PrBadge prNumber={prNumber} prUrl={prUrl} state={state} />+ </div>+ )+ }+ const statusKey = report.status as SignalReportStatus+ const label = STATUS_LABELS[statusKey] ?? report.status+ // The inbox badge always explains itself on hover, falling back to the label; match that.+ return (+ <Tooltip title={STATUS_TOOLTIPS[statusKey] ?? label}>+ <span className="text-xs text-muted-alt">{label}</span>+ </Tooltip>+ )+}diff --git a/products/conversations/frontend/scenes/ticket/ThreadReports.tsx b/products/conversations/frontend/scenes/ticket/ThreadReports.tsxindex f1c1f4424655..983b1a08cf1e 100644--- a/products/conversations/frontend/scenes/ticket/ThreadReports.tsx+++ b/products/conversations/frontend/scenes/ticket/ThreadReports.tsx@@ -2,66 +2,19 @@ import { Link, Tooltip } from '@posthog/lemon-ui'import { Logomark } from 'lib/brand'import { TZLabel } from 'lib/components/TZLabel'-import { derivePrState, type PrBadgeState } from 'lib/signals/prState'-import { PrBadge } from 'lib/signals/SignalReportPrBadge'+import { SignalReportFixOrStatus } from 'lib/signals/SignalReportFixOrStatus'import { capitalizeFirstLetter } from 'lib/utils/strings'import { urls } from 'scenes/urls'import type { SignalReportApi } from 'products/signals/frontend/generated/api.schemas'-import {- STATUS_LABELS,- STATUS_TOOLTIPS,-} from 'products/signals/frontend/inbox/components/badges/SignalReportStatusBadge'-import type { SignalReportStatus } from 'products/signals/frontend/inbox/types'import {deriveHeadline,displayConventionalCommitTitle,- parsePrUrlParts,- safeHttpUrl,} from 'products/signals/frontend/inbox/utils/reportPresentation'import type { TimelineExtra } from '../../components/Chat/MessageList'import { TeamOnlyBadge } from '../../components/Chat/TeamOnlyBadge'-/** The inbox's own labels are written to stand alone in a badge, so this surface phrases the same- * states as a sentence a teammate can act on. The state derivation stays shared. */-const FIX_LABEL: Record<PrBadgeState, string> = {- open: 'Fix proposed',- merged: 'Fix merged',- closed: 'Fix closed',-}--/**- * Whether it shipped, which is what a teammate answering the customer most needs. A pull request says- * that better than the report's own status, so the status is the fallback rather than a second badge:- * either there's no PR, or its URL doesn't parse as one.- *- * `PrBadge` brings the link, state colour, and the external-link and accessibility handling the inbox- * already got right.- */-function FixOrStatus({ report }: { report: SignalReportApi }): JSX.Element {- // The URL comes from an agent's raw task-run output and isn't scheme-validated server-side.- const prUrl = safeHttpUrl(report.implementation_pr_url)- const prNumber = prUrl ? parsePrUrlParts(prUrl)?.number : undefined- if (prUrl && prNumber) {- const state = derivePrState(report.status, report.implementation_pr_merged)- return (- <div className="flex items-center gap-1.5">- <span className="text-xs font-semibold">{FIX_LABEL[state]}</span>- <PrBadge prNumber={prNumber} prUrl={prUrl} state={state} />- </div>- )- }- const statusKey = report.status as SignalReportStatus- const label = STATUS_LABELS[statusKey] ?? report.status- // The inbox badge always explains itself on hover, falling back to the label; match that.- return (- <Tooltip title={STATUS_TOOLTIPS[statusKey] ?? label}>- <span className="text-xs text-muted-alt">{label}</span>- </Tooltip>- )-}-/*** One report, as an entry in the ticket thread.*@@ -120,7 +73,7 @@ export function ThreadReportEntry({ report }: { report: SignalReportApi }): JSX.{headline && <p className="mt-0.5 mb-0 text-xs text-muted leading-snug">{headline}</p>}</Link><div className="shrink-0">- <FixOrStatus report={report} />+ <SignalReportFixOrStatus report={report} /></div></div></div>diff --git a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.tsindex e075b525c8e1..cb934194881e 100644--- a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts+++ b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts@@ -54,6 +54,7 @@ import {} from 'products/conversations/frontend/generated/api'import { signalsReportsList } from 'products/signals/frontend/generated/api'import type { SignalReportApi } from 'products/signals/frontend/generated/api.schemas'+import { SignalSourceProductApi } from 'products/signals/frontend/generated/api.schemas'import type { FeatureFlagsSet } from '../../../../../frontend/src/lib/logic/featureFlagLogic'import type { TeamPublicType, TeamType } from '../../../../../frontend/src/types'@@ -668,10 +669,12 @@ export const supportTicketSceneLogic = kea<supportTicketSceneLogicType>([try {const response = await signalsReportsList(getCurrentTeamId().toString(), {source_id: ticketUuid,- source_product: 'conversations',+ source_product: SignalSourceProductApi.Conversations,+ // A teammate answering a customer needs to know an investigation was+ // dismissed just as much as that one is running.include_all_statuses: true,})- return response.results || []+ return response.results} catch (error) {// Supplementary context: a signals or ClickHouse hiccup must not break the ticket.console.error('Failed to load linked reports:', error)diff --git a/products/error_tracking/frontend/ErrorTracking.stories.tsx b/products/error_tracking/frontend/ErrorTracking.stories.tsxindex 69baf4c68865..ad4d9b1a22ea 100644--- a/products/error_tracking/frontend/ErrorTracking.stories.tsx+++ b/products/error_tracking/frontend/ErrorTracking.stories.tsx@@ -149,6 +149,8 @@ const meta: Meta = {},],'/api/environments/:team_id/error_tracking/spike_events': [200, { results: [] }],+ // Empty keeps this story's snapshot unchanged; the populated section has its own story.+ '/api/projects/:team_id/signals/reports/': [200, { next: null, results: [] }],'/api/environments/:team_id/session_recordings/:id/capture_diagnostics/': [200,{ properties: { $has_recording: true, $recording_status: 'active' } },@@ -244,3 +246,45 @@ export const GroupPage: Story = {name: 'Issue scene',parameters: { pageUrl: urls.errorTrackingIssue(ISSUE_ID) },}++// Self-driving investigated this issue, so its section renders in the right pane above the exception+// card. This is the only coverage of the placement: the section's own story fabricates a pane around+// it, so it cannot show that the two header strips line up, that the section paints the background the+// pane leaves unpainted, or that a single border separates the two.+export const GroupPageWithSelfDriving: Story = {+ name: 'Issue scene with self-driving',+ parameters: { pageUrl: urls.errorTrackingIssue(ISSUE_ID) },+ decorators: [+ mswDecorator({+ get: {+ '/api/projects/:team_id/signals/reports/': () => [+ 200,+ {+ next: null,+ results: [+ {+ id: '019f9582-93e7-77c1-8912-4f541d70cb13',+ status: 'ready',+ title: 'fix(replay): guard against a missing snapshot index',+ summary:+ 'The player throws when a recording ends on a snapshot the index never received.',+ implementation_pr_url: 'https://github.com/PostHog/posthog/pull/64772',+ implementation_pr_merged: false,+ updated_at: '2024-07-08T21:00:00Z',+ },+ {+ id: '019f954a-8ed0-7a18-a198-3ffed1a2def0',+ status: 'resolved',+ title: 'fix(replay): stop dropping events after a tab regains focus',+ summary: 'Events queued while the tab was hidden are discarded when it regains focus.',+ implementation_pr_url: 'https://github.com/PostHog/posthog/pull/64773',+ implementation_pr_merged: true,+ updated_at: '2024-07-08T15:00:00Z',+ },+ ],+ },+ ],+ },+ }),+ ],+}diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsxindex 6755f3014958..51b3c7e9efba 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene.tsx@@ -57,6 +57,7 @@ import {errorTrackingIssueSceneLogic,} from './errorTrackingIssueSceneLogic'import { IssueEventsPanel } from './IssueEventsPanel'+import { LinkedReports } from './LinkedReports'import { ErrorTrackingIssueScenePanel } from './ScenePanel'import { IssueAssigneeSelect } from './ScenePanel/IssueAssigneeSelect'@@ -261,7 +262,9 @@ const RightHandColumn = ({return (<divclassName={clsx(- 'flex flex-col flex-1 gap-1 min-h-0',+ // No gap between the pane's sections: each one ends in a border, and a gap would show+ // the page behind the pane as a band next to that border.+ 'flex flex-col flex-1 min-h-0',isMobile ? 'absolute inset-0 z-20 bg-surface-primary' : 'min-w-[375px]')}>@@ -277,6 +280,7 @@ const RightHandColumn = ({</div>)}<PostHogSDKIssueBanner event={selectedEvent} />+ <LinkedReports /><div className="flex-1 min-h-0 flex flex-col"><ExceptionCardissueId={issue?.id ?? 'no-issue'}diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/LinkedReports.stories.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/LinkedReports.stories.tsxnew file mode 100644index 000000000000..581d9c05b5e3--- /dev/null+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/LinkedReports.stories.tsx@@ -0,0 +1,86 @@+import type { Meta, StoryObj } from '@storybook/react'++import type { SignalReportApi } from 'products/signals/frontend/generated/api.schemas'++import { LinkedReportsSection } from './LinkedReports'++// The right pane's self-driving section, above the exception card. Whether a fix exists is what a+// person triaging needs, so the states worth a snapshot are a proposed fix, a merged fix, and a report+// with no pull request to point at yet.++const meta: Meta<typeof LinkedReportsSection> = {+ title: 'Scenes-App/ErrorTracking/LinkedReports',+ component: LinkedReportsSection,+ parameters: { layout: 'padded', viewMode: 'story', mockDate: '2026-08-10' },+}+export default meta++type Story = StoryObj<typeof LinkedReportsSection>++function makeReport(overrides: Partial<SignalReportApi> = {}): SignalReportApi {+ return {+ id: '019f9582-93e7-77c1-8912-4f541d70cb13',+ status: 'ready',+ title: 'fix(replay): guard against a missing snapshot index',+ summary:+ 'The player throws when a recording ends on a snapshot the index never received.\n\n## Problem\n\nThe index is built once per load.',+ implementation_pr_url: 'https://github.com/PostHog/posthog/pull/64772',+ implementation_pr_merged: false,+ updated_at: '2026-08-09T21:00:00Z',+ ...overrides,+ } as SignalReportApi+}++/**+ * A width harness only. The section in its real pane, next to the exception card, is covered by the+ * `Scenes-App/ErrorTracking` story "Issue scene with self-driving".+ */+function Pane({ children }: { children: React.ReactNode }): JSX.Element {+ return <div className="w-[700px]">{children}</div>+}++export const FixProposed: Story = {+ render: () => (+ <Pane>+ <LinkedReportsSection reports={[makeReport()]} />+ </Pane>+ ),+}++export const SeveralReportsAcrossStates: Story = {+ render: () => (+ <Pane>+ <LinkedReportsSection+ reports={[+ makeReport(),+ makeReport({+ id: '019f954a-8ed0-7a18-a198-3ffed1a2def0',+ status: 'resolved',+ title: 'fix(replay): stop dropping events after a tab regains focus',+ summary: 'Events queued while the tab was hidden are discarded when it regains focus.',+ implementation_pr_url: 'https://github.com/PostHog/posthog/pull/64773',+ implementation_pr_merged: true,+ updated_at: '2026-08-09T18:30:00Z',+ }),+ makeReport({+ id: '019f9569-5d45-780a-8b63-ecd0dc71148e',+ status: 'in_progress',+ title: null,+ summary: 'Needs a product call on whether the player should re-key on recording change.',+ implementation_pr_url: null,+ updated_at: '2026-08-09T12:00:00Z',+ }),+ ]}+ />+ </Pane>+ ),+}++/** The narrowest the pane gets, where the title and the fix state compete for width. */+export const NarrowPane: Story = {+ render: () => (+ <div className="w-[375px]">+ <LinkedReportsSection reports={[makeReport()]} />+ </div>+ ),+}diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/LinkedReports.tsx b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/LinkedReports.tsxnew file mode 100644index 000000000000..848e1e1ed324--- /dev/null+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/LinkedReports.tsx@@ -0,0 +1,87 @@+import { useValues } from 'kea'++import { IconLogomark } from '@posthog/icons'+import { Link, Tooltip } from '@posthog/lemon-ui'++import { TZLabel } from 'lib/components/TZLabel'+import { SignalReportFixOrStatus } from 'lib/signals/SignalReportFixOrStatus'+import { capitalizeFirstLetter } from 'lib/utils/strings'+import { urls } from 'scenes/urls'++import type { SignalReportApi } from 'products/signals/frontend/generated/api.schemas'+import {+ deriveHeadline,+ displayConventionalCommitTitle,+} from 'products/signals/frontend/inbox/utils/reportPresentation'++import { errorTrackingIssueSceneLogic } from './errorTrackingIssueSceneLogic'++/**+ * One report, as a row of the right pane.+ *+ * The link takes the whole left column so the row reads as one target, and the fix state stays a+ * sibling of it: an anchor cannot contain another, and a click on the pull request has to open the+ * pull request.+ */+function LinkedReportRow({ report }: { report: SignalReportApi }): JSX.Element {+ const headline = deriveHeadline(report.summary)+ return (+ <div className="flex items-start justify-between gap-2 px-2 py-1.5 border-b transition-colors hover:bg-surface-secondary">+ <Link+ to={urls.inboxReport('reports', report.id)}+ className="block min-w-0 flex-1 text-inherit no-underline hover:text-inherit"+ >+ <div className="text-sm font-semibold leading-snug">+ {capitalizeFirstLetter(displayConventionalCommitTitle(report.title, 'Untitled report'))}+ </div>+ {/* When the report was last worked on matters as much as what it says, and the two fit on+ one line at this width. */}+ <p className="mt-0.5 mb-0 text-xs text-muted leading-snug">+ <TZLabel time={report.updated_at} />+ {headline ? ` · ${headline}` : ''}+ </p>+ </Link>+ <div className="shrink-0">+ <SignalReportFixOrStatus report={report} />+ </div>+ </div>+ )+}++/**+ * Reports the inbox grouped this issue's signals into, most recently updated first.+ *+ * This is a section of the right pane, not a card sitting on top of one, so it wears the pane's own+ * chrome: the same 2rem header strip the exception card below it uses, square corners, no outer border,+ * and rows that run the full width. The name takes the AI colour, which is how the app marks the work+ * its own software did.+ */+export function LinkedReportsSection({ reports }: { reports: SignalReportApi[] }): JSX.Element | null {+ if (reports.length === 0) {+ return null+ }+ return (+ // The pane paints no background of its own on desktop, so this section paints the same one the+ // exception card below it paints. Without it the rows show the page behind the pane.+ <div className="shrink-0 flex flex-col bg-surface-primary">+ <div className="flex justify-between h-[2rem] items-center w-full px-2 border-b shrink-0">+ <div className="flex items-center gap-1 text-lg h-full">+ <IconLogomark />+ <span className="text-sm text-ai">Self-driving</span>+ </div>+ <Tooltip title="A PostHog agent that investigates errors against your codebase. Not a teammate.">+ <span className="text-xs text-muted-alt">PostHog agent</span>+ </Tooltip>+ </div>+ {reports.map((report) => (+ <LinkedReportRow key={report.id} report={report} />+ ))}+ </div>+ )+}++/** Renders nothing when the inbox never investigated this issue, which is the common case. */+export function LinkedReports(): JSX.Element | null {+ const { linkedReports } = useValues(errorTrackingIssueSceneLogic)+ return <LinkedReportsSection reports={linkedReports} />+}diff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.test.ts b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.test.tsindex 90d526414257..04d3672fbb15 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.test.ts+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.test.ts@@ -19,6 +19,8 @@ describe('errorTrackingIssueSceneLogic', () => {get: {'/api/environments/:team_id/error_tracking/issues/:id/': {},'/api/environments/:team_id/error_tracking/issues/:id/fingerprints/': [],+ // Fails by default, so every test in this file also proves the panel degrades quietly.+ '/api/projects/:team_id/signals/reports/': () => [500, { detail: 'ClickHouse is unhappy' }],},post: {'/api/environments/:team_id/query/': { results: [] },@@ -42,6 +44,11 @@ describe('errorTrackingIssueSceneLogic', () => {expect(logic.values.eventsQueryKey).toBe(initialKey)})+ it('leaves linked reports empty and does not fail when the signals lookup errors', async () => {+ // Letting the loader reject would toast an error on every issue page during a signals outage.+ await expectLogic(logic).toDispatchActions(['loadLinkedReportsSuccess']).toMatchValues({ linkedReports: [] })+ })+it('changes the events query key when the search query changes', () => {const initialKey = logic.values.eventsQueryKeydiff --git a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.tsindex 58a04072abee..e55b98372d0e 100644--- a/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts+++ b/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/errorTrackingIssueSceneLogic.ts@@ -26,6 +26,7 @@ import {} from 'lib/components/Errors/types'import { SetupTaskId, globalSetupLogic } from 'lib/components/ProductSetup'import { Dayjs, dayjs } from 'lib/dayjs'+import { getCurrentTeamId } from 'lib/utils/getAppContext'import { objectsEqual } from 'lib/utils/objects'import { MaxContextInput, createMaxContextHelpers } from 'scenes/max/maxTypes'import { Scene } from 'scenes/sceneTypes'@@ -41,6 +42,10 @@ import {} from '~/queries/schema/schema-general'import { ActivityScope, Breadcrumb, IntegrationType, UniversalFiltersGroup } from '~/types'+import { signalsReportsList } from 'products/signals/frontend/generated/api'+import type { SignalReportApi } from 'products/signals/frontend/generated/api.schemas'+import { SignalSourceProductApi } from 'products/signals/frontend/generated/api.schemas'+import type {ErrorTrackingExternalReference,ErrorTrackingIssueAssignee,@@ -74,6 +79,10 @@ export type ErrorTrackingIssueStatus = ErrorTrackingIssue['status']export const ERROR_TRACKING_ISSUE_SCENE_LOGIC_KEY = 'ErrorTrackingIssueScene'+/** An issue realistically groups into one or two reports. This only stops the endpoint's 100-report+ * default page from serializing far more than the panel will ever show. */+const LINKED_REPORTS_LIMIT = 10+// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface errorTrackingIssueSceneLogicValues {category: ErrorTrackingIssueSceneCategory // errorTrackingIssueSceneConfigurationLogic@@ -95,6 +104,8 @@ export interface errorTrackingIssueSceneLogicValues {issueId: stringissueLoading: booleanlastSeen: Dayjs | null+ linkedReports: SignalReportApi[]+ linkedReportsLoading: booleanlistDateRange: DateRange | nullmaxContext: MaxContextInput[]mobileDetailOpen: boolean@@ -254,6 +265,21 @@ export interface errorTrackingIssueSceneLogicActions {value: true}}+ loadLinkedReports: () => any+ loadLinkedReportsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadLinkedReportsSuccess: (+ linkedReports: SignalReportApi[],+ payload?: any+ ) => {+ linkedReports: SignalReportApi[]+ payload?: any+ }loadSpikeEvents: () => anyloadSpikeEventsFailure: (error: string,@@ -726,6 +752,31 @@ export const errorTrackingIssueSceneLogic = kea<errorTrackingIssueSceneLogicTypeloadIssueFingerprints: async () => await api.errorTracking.fingerprints.list(props.id),},],+ linkedReports: [+ [] as SignalReportApi[],+ {+ // Error tracking tags its signals with the issue id as `source_id`, so this filter+ // walks the link from the issue back to the reports its signals fed.+ loadLinkedReports: async (): Promise<SignalReportApi[]> => {+ try {+ const response = await signalsReportsList(getCurrentTeamId().toString(), {+ source_id: props.id,+ source_product: SignalSourceProductApi.ErrorTracking,+ // The endpoint's default ordering leads with the viewer's own review+ // queue, which is an inbox concern rather than this pane's.+ ordering: '-updated_at',+ limit: LINKED_REPORTS_LIMIT,+ })+ return response.results+ } catch (error) {+ // Supplementary context, so it degrades quietly: kea-loaders toasts a failed+ // `load*` action, and a signals outage must not do that on every issue page.+ console.error('Failed to load linked reports:', error)+ return []+ }+ },+ },+ ],spikeEvents: [[] as ErrorTrackingSpikeEvent[],{@@ -911,6 +962,7 @@ export const errorTrackingIssueSceneLogic = kea<errorTrackingIssueSceneLogicTypeactions.loadSummary()actions.loadIssueFingerprints()actions.loadSpikeEvents()+ actions.loadLinkedReports()globalSetupLogic.findMounted()?.actions.markTaskAsCompleted(SetupTaskId.ViewFirstError)},})),