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 a banner when inbox filters are active (#64811)

Michael Matloka29822b358a3c
diff --git a/frontend/src/scenes/inbox/components/InboxReportList.tsx b/frontend/src/scenes/inbox/components/InboxReportList.tsx
index 47e301e18f0d..f151467259c4 100644
--- a/frontend/src/scenes/inbox/components/InboxReportList.tsx
+++ b/frontend/src/scenes/inbox/components/InboxReportList.tsx
@@ -1,6 +1,9 @@
import { BindLogic, useActions, useValues } from 'kea'
import { ComponentType, JSX, useEffect, useRef } from 'react'
+import { LemonBanner } from '@posthog/lemon-ui'
+
+import { inboxFiltersLogic } from '../logics/inboxFiltersLogic'
import { reportListLogic, ReportListLogicProps } from '../logics/reportListLogic'
import { InboxFlatListTabKey, SignalReport } from '../types'
import { DismissalReasonValue } from '../utils/dismissalReasons'
@@ -36,6 +39,22 @@ export function InboxReportList(props: InboxReportListProps): JSX.Element {
)
}
+/** Sleek reminder that the list is filtered, with a one-click reset. Renders nothing when no filter is active. */
+function ActiveFiltersBanner(): JSX.Element | null {
+ const { hasActiveFilters } = useValues(inboxFiltersLogic)
+ const { clearFilters } = useActions(inboxFiltersLogic)
+
+ if (!hasActiveFilters) {
+ return null
+ }
+
+ return (
+ <LemonBanner type="info" action={{ children: 'Clear', onClick: () => clearFilters() }}>
+ Filters are applied – some reports may be hidden.
+ </LemonBanner>
+ )
+}
+
function InboxReportListInner({ tabKey, Card, emptyState }: InboxReportListProps): JSX.Element {
const { reports, count, hasMore, reportsResponseLoading, isLoaded } = useValues(reportListLogic)
const { ensureLoaded, loadMore, archiveReport, refresh } = useActions(reportListLogic)
@@ -76,6 +95,7 @@ function InboxReportListInner({ tabKey, Card, emptyState }: InboxReportListProps
return (
<div className="@container mx-auto max-w-4xl flex flex-col gap-4 px-6 py-4">
<InboxSearchFilterBar onRefresh={() => refresh()} refreshing={reportsResponseLoading} />
+ <ActiveFiltersBanner />
<InboxBulkSelectionBar />
{showSkeleton ? (
diff --git a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
index ac371d8b49c4..505c05903627 100644
--- a/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
+++ b/frontend/src/scenes/inbox/logics/inboxFiltersLogic.ts
@@ -1,4 +1,4 @@
-import { actions, afterMount, kea, listeners, path, reducers } from 'kea'
+import { actions, afterMount, kea, listeners, path, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
@@ -148,6 +148,16 @@ export const inboxFiltersLogic = kea<inboxFiltersLogicType>([
],
}),
+ selectors({
+ // Whether any list-narrowing filter is active. Scope and sort are excluded: they don't hide
+ // reports the way search/source/priority do, and `clearFilters` leaves them untouched.
+ hasActiveFilters: [
+ (s) => [s.searchQuery, s.sourceProductFilter, s.priorityFilter],
+ (searchQuery, sourceProductFilter, priorityFilter): boolean =>
+ searchQuery.trim().length > 0 || sourceProductFilter.length > 0 || priorityFilter.length > 0,
+ ],
+ }),
+
afterMount(({ actions }) => {
actions.loadAvailableReviewers()
}),