Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(inbox): invalidate report list when archiving from detail pane (#65395)

Joshua Snydera7eee37a994a
diff --git a/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx b/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
index 3099c0b78abb..65bd76232d14 100644
--- a/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
+++ b/frontend/src/scenes/inbox/components/detail/ReportDetailActions.tsx
@@ -11,6 +11,7 @@ import { urls } from 'scenes/urls'
import { captureInboxReportAction } from '../../inboxAnalytics'
import { inboxSceneLogic } from '../../inboxSceneLogic'
import { inboxTaskKickoffLogic } from '../../inboxTaskKickoffLogic'
+import { inboxBulkActionsLogic } from '../../logics/inboxBulkActionsLogic'
import { INBOX_FLAT_TAB_LIST_PARAMS, reportListLogic } from '../../logics/reportListLogic'
import { ACTIONABLE_ACTIONABILITY_VALUES, SignalReport, SignalReportStatus } from '../../types'
import { useReportArchive } from '../cards/useReportArchive'
@@ -43,6 +44,7 @@ function canCreateImplementationPr(report: SignalReport): boolean {
export function ReportDetailActions({ report }: { report: SignalReport }): JSX.Element {
const { isCreatingPr } = useValues(inboxTaskKickoffLogic)
const { createPrFromReport } = useActions(inboxTaskKickoffLogic)
+ const { reportArchived } = useActions(inboxBulkActionsLogic)
const { activeTab } = useValues(inboxSceneLogic)
const [isRestoring, setIsRestoring] = useState(false)
@@ -56,8 +58,12 @@ export function ReportDetailActions({ report }: { report: SignalReport }): JSX.E
cardTitle: report.title ?? 'Untitled report',
report,
surface: 'detail_pane',
- // Back to the list once archived – the suppressed report drops out on the list's refetch.
- onArchived: () => router.actions.push(urls.inbox(activeTab)),
+ // Once the suppress persists, broadcast so every mounted list reconciles against the server
+ // (the report leaves Reports/Pull requests and joins Archived), then return to the list.
+ onArchived: () => {
+ reportArchived()
+ router.actions.push(urls.inbox(activeTab))
+ },
})
const onRestoreClick = async (): Promise<void> => {
diff --git a/frontend/src/scenes/inbox/logics/inboxBulkActionsLogic.ts b/frontend/src/scenes/inbox/logics/inboxBulkActionsLogic.ts
index d3795c93dba0..7e2fa8baf136 100644
--- a/frontend/src/scenes/inbox/logics/inboxBulkActionsLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxBulkActionsLogic.ts
@@ -42,6 +42,9 @@ export const inboxBulkActionsLogic = kea<inboxBulkActionsLogicType>([
bulkDismiss: (reason: DismissalReasonValue, note: string) => ({ reason, note }),
bulkDismissSuccess: true,
bulkDismissFailure: true,
+ /** Broadcast that a single report was archived elsewhere (e.g. the detail pane), so every
+ * mounted list reconciles itself. Persisting the change is the caller's responsibility. */
+ reportArchived: true,
}),
reducers({
diff --git a/frontend/src/scenes/inbox/logics/reportListLogic.ts b/frontend/src/scenes/inbox/logics/reportListLogic.ts
index e1aba7b2be97..dfb41259b90c 100644
--- a/frontend/src/scenes/inbox/logics/reportListLogic.ts
+++ b/frontend/src/scenes/inbox/logics/reportListLogic.ts
@@ -234,6 +234,9 @@ export const reportListLogic = kea<reportListLogicType>([
},
// Bulk archive happens in the singleton; refresh this tab once it lands.
[inboxBulkActionsLogic.actionTypes.bulkDismissSuccess]: () => actions.refresh(),
+ // A single report archived elsewhere (e.g. the detail pane) – reconcile this tab against
+ // the server so the report leaves Reports/Pull requests and joins Archived, counts included.
+ [inboxBulkActionsLogic.actionTypes.reportArchived]: () => actions.refresh(),
})),
events(({ actions }) => ({