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.

feat(signals): surface resolved reports in the inbox Archive tab (#65040)

Andrew Maguirec5362f47f668
diff --git a/frontend/src/scenes/inbox/components/cards/ReportCard.tsx b/frontend/src/scenes/inbox/components/cards/ReportCard.tsx
index 3230a4c6eb06..efdabdb4cdfd 100644
--- a/frontend/src/scenes/inbox/components/cards/ReportCard.tsx
+++ b/frontend/src/scenes/inbox/components/cards/ReportCard.tsx
@@ -140,6 +140,9 @@ export function ReportCard({
onRestore?: () => void
}): JSX.Element {
const isArchived = tabKey === 'archived'
+ // Resolved reports are terminal (their implementation PR merged) – shown for reference in the
+ // Archive tab but with no row action: they can't be restored or re-archived.
+ const isResolved = report.status === SignalReportStatus.RESOLVED
const prUrl = safeHttpUrl(report.implementation_pr_url)
const prUrlParts = prUrl ? parsePrUrlParts(prUrl) : null
const hasPr = prUrlParts != null
@@ -162,7 +165,12 @@ export function ReportCard({
})
// On the Archive tab, surface why it was dismissed (reason tag + note tooltip) when we have it.
- const dismissalLabel = isArchived ? dismissalReasonLabel(report.dismissal_reason) : null
+ // Key off the report still being suppressed, not the tab: a report that was dismissed, restored,
+ // then resolved keeps its old dismissal artefact, and showing that tag would mislabel finished work.
+ const dismissalLabel =
+ isArchived && report.status === SignalReportStatus.SUPPRESSED
+ ? dismissalReasonLabel(report.dismissal_reason)
+ : null
// PR cards show repo · source; reports show source · status · actionability.
const showMeta = hasPr
@@ -247,49 +255,52 @@ export function ReportCard({
</div>
</Link>
- <div className="flex items-center justify-end gap-2.5 shrink-0 @lg:self-stretch @lg:border-l @lg:border-primary @lg:pl-3">
- {isArchived ? (
- <LemonButton
- type="secondary"
- size="small"
- icon={<IconUndo />}
- tooltip="Restore this report to the inbox"
- aria-label="Restore this report to the inbox"
- onClick={(event) => {
- event.preventDefault()
- event.stopPropagation()
- onRestore?.()
- }}
- >
- Restore
- </LemonButton>
- ) : (
- <>
+ {/* Terminal resolved reports carry no row action – skip the action column (and its divider). */}
+ {!isResolved && (
+ <div className="flex items-center justify-end gap-2.5 shrink-0 @lg:self-stretch @lg:border-l @lg:border-primary @lg:pl-3">
+ {isArchived ? (
<LemonButton
type="secondary"
size="small"
- icon={<IconArchive />}
- tooltip="Archive this report"
- aria-label="Archive this report"
- loading={isArchiving}
- onClick={onArchiveClick}
- >
- Archive
- </LemonButton>
- <LemonButton
- type="primary"
- size="small"
+ icon={<IconUndo />}
+ tooltip="Restore this report to the inbox"
+ aria-label="Restore this report to the inbox"
onClick={(event) => {
event.preventDefault()
event.stopPropagation()
- router.actions.push(detailUrl)
+ onRestore?.()
}}
>
- Review
+ Restore
</LemonButton>
- </>
- )}
- </div>
+ ) : (
+ <>
+ <LemonButton
+ type="secondary"
+ size="small"
+ icon={<IconArchive />}
+ tooltip="Archive this report"
+ aria-label="Archive this report"
+ loading={isArchiving}
+ onClick={onArchiveClick}
+ >
+ Archive
+ </LemonButton>
+ <LemonButton
+ type="primary"
+ size="small"
+ onClick={(event) => {
+ event.preventDefault()
+ event.stopPropagation()
+ router.actions.push(detailUrl)
+ }}
+ >
+ Review
+ </LemonButton>
+ </>
+ )}
+ </div>
+ )}
</div>
)
}
diff --git a/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx b/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
index cd0a2db35be0..3099c0b78abb 100644
--- a/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
@@ -48,6 +48,8 @@ export function ReportDetailActions({ report }: { report: SignalReport }): JSX.E
const showCreatePr = canCreateImplementationPr(report)
const isArchived = report.status === SignalReportStatus.SUPPRESSED
+ // Resolved reports are terminal (their implementation PR merged) – nothing to archive, restore, or kick off.
+ const isResolved = report.status === SignalReportStatus.RESOLVED
const { isArchiving, onArchiveClick } = useReportArchive({
reportId: report.id,
@@ -85,6 +87,11 @@ export function ReportDetailActions({ report }: { report: SignalReport }): JSX.E
}
}
+ // A resolved report is terminal – its PR already merged, so no detail actions apply.
+ if (isResolved) {
+ return <></>
+ }
+
// An already-archived report offers Restore instead of Archive (and no Create PR).
if (isArchived) {
return (
diff --git a/frontend/src/scenes/inbox/components/tabs/ArchivedTab.tsx b/frontend/src/scenes/inbox/components/tabs/ArchivedTab.tsx
index b306aa1076f2..81ebf38e8858 100644
--- a/frontend/src/scenes/inbox/components/tabs/ArchivedTab.tsx
+++ b/frontend/src/scenes/inbox/components/tabs/ArchivedTab.tsx
@@ -5,9 +5,9 @@ import { ReportCard } from '../cards/ReportCard'
import { InboxReportList } from '../InboxReportList'
/**
- * Reports the user dismissed (status `suppressed`). Same flat-list primitive as the other
- * report tabs – only the filter differs. Each card offers a Restore action that re-promotes
- * the report back into the inbox.
+ * Terminal reports: ones the user dismissed (status `suppressed`, restorable via a Restore action)
+ * and ones resolved by a merged implementation PR (status `resolved`, shown for reference only).
+ * Same flat-list primitive as the other report tabs – only the filter differs.
*/
export function ArchivedTab(): JSX.Element {
return (
@@ -18,7 +18,8 @@ export function ArchivedTab(): JSX.Element {
emptyState={{
icon: <IconArchive className="text-2xl" />,
title: 'Nothing archived',
- description: 'Reports you archive land here, where you can review them or restore them to the inbox.',
+ description:
+ 'Reports you archive land here, where you can restore them to the inbox. Resolved reports also appear here for reference.',
}}
/>
)
diff --git a/frontend/src/scenes/inbox/logics/reportListLogic.ts b/frontend/src/scenes/inbox/logics/reportListLogic.ts
index ebbf026d9648..e1aba7b2be97 100644
--- a/frontend/src/scenes/inbox/logics/reportListLogic.ts
+++ b/frontend/src/scenes/inbox/logics/reportListLogic.ts
@@ -36,8 +36,9 @@ export const INBOX_FLAT_TAB_LIST_PARAMS: Record<InboxFlatListTabKey, ReportListP
actionability: ACTIONABLE_ACTIONABILITY_VALUES.join(','),
},
'not-actionable': { actionability: 'not_actionable' },
- // Archived = reports the user dismissed (suppressed). Restorable back into the inbox.
- archived: { status: 'suppressed' },
+ // Archive = terminal reports: ones the user dismissed (suppressed, restorable) and ones
+ // resolved by a merged implementation PR (terminal, not restorable).
+ archived: { status: 'suppressed,resolved' },
}
function teammateUuidFromScope(scope: string): string | undefined {
@@ -222,6 +223,10 @@ export const reportListLogic = kea<reportListLogicType>([
// Fire only after the restore persists, matching ReportDetailActions' fallback path.
captureInboxReportAction({ report, actionType: 'restore', surface: 'list_row' })
lemonToast.success('Report restored to inbox')
+ // Restore maps through restore_target_status server-side, so a report suppressed while
+ // resolved returns to `resolved` and still belongs in this tab. Reconcile against the
+ // server rather than trusting the optimistic removal, which over-drops those rows.
+ actions.refresh()
} catch (error: any) {
lemonToast.error(error?.detail || error?.message || 'Failed to restore report')
actions.refresh()