: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
chore(desktop): remove the universally enabled reports inbox flag (#108321)
posthog[bot]55a26de474cf
diff --git a/products/desktop/packages/core/src/inbox/reportMembership.ts b/products/desktop/packages/core/src/inbox/reportMembership.tsindex 750c3a70a67c..bf48678e001c 100644--- a/products/desktop/packages/core/src/inbox/reportMembership.ts+++ b/products/desktop/packages/core/src/inbox/reportMembership.ts@@ -103,37 +103,7 @@ export function countInboxScopeReports(export type InboxTabKey = "pulls" | "reports" | "runs" | "dismissed";-export const INBOX_TAB_KEYS: InboxTabKey[] = [- "pulls",- "reports",- "runs",- "dismissed",-];--export const INBOX_TAB_LABEL: Record<InboxTabKey, string> = {- pulls: "Pull requests",- reports: "Reports",- runs: "Runs",- dismissed: "Archive",-};--/**- * Canonical inbox tab list routes. Use these constants instead of hard-coding- * `/inbox/pulls` etc., so renames stay in one place.- *- * Detail routes (`/inbox/<tab>/$reportId`) stay as TanStack Router- * literals at call sites – TanStack's typed-link API needs them as literal- * strings to infer params.- */-export const INBOX_TAB_LIST_ROUTE: Record<- InboxTabKey,- `/inbox/${InboxTabKey}`-> = {- pulls: "/inbox/pulls",- reports: "/inbox/reports",- runs: "/inbox/runs",- dismissed: "/inbox/dismissed",-};+const INBOX_TAB_KEYS: InboxTabKey[] = ["pulls", "reports", "runs", "dismissed"];const INBOX_DETAIL_PATH_RE = new RegExp(`^/inbox/(${INBOX_TAB_KEYS.join("|")})/[^/]+$`,@@ -143,22 +113,6 @@ export function isInboxDetailPath(pathname: string): boolean {return INBOX_DETAIL_PATH_RE.test(pathname);}-/** Which tab a list pathname belongs to; anything unrecognised reads as Pulls. */-export function inboxTabFromPath(pathname: string): InboxTabKey {- if (pathname.startsWith(INBOX_TAB_LIST_ROUTE.reports)) return "reports";- if (pathname.startsWith(INBOX_TAB_LIST_ROUTE.runs)) return "runs";- if (pathname.startsWith(INBOX_TAB_LIST_ROUTE.dismissed)) return "dismissed";- return "pulls";-}--/**- * Whether the reviewer-scope control means anything on this tab: Runs is- * unscoped and the Archive is a terminal list, so neither filters by reviewer.- */-export function inboxScopeApplies(tab: InboxTabKey): boolean {- return tab !== "runs" && tab !== "dismissed";-}-/*** PR tab membership: Responder shipped a draft PR and it is `ready` for review.* PRs that have already been merged/closed (`resolved`) or are still runningdiff --git a/products/desktop/packages/shared/src/feature-flag-keys.json b/products/desktop/packages/shared/src/feature-flag-keys.jsonindex a4de55cd902f..74d2f456118d 100644--- a/products/desktop/packages/shared/src/feature-flag-keys.json+++ b/products/desktop/packages/shared/src/feature-flag-keys.json@@ -25,7 +25,6 @@"ONBOARDING_TEST_TOOLS_FLAG": "posthog-desktop-onboarding-test-tools","PI_HARNESS_FLAG": "pi-harness","PROJECT_BLUEBIRD_FLAG": "project-bluebird",- "REPORTS_INBOX_FLAG": "posthog-desktop-reports-inbox","SAVED_SEARCHES_RAIL_FLAG": "posthog-desktop-saved-searches-rail","SELF_DRIVING_SETUP_TASK_FLAG": "posthog-code-self-driving-setup-task","SETTINGS_BACKUP_FLAG": "posthog-desktop-settings-backup",diff --git a/products/desktop/packages/shared/src/flags.ts b/products/desktop/packages/shared/src/flags.tsindex 01fcc12d7ee4..e0476543643b 100644--- a/products/desktop/packages/shared/src/flags.ts+++ b/products/desktop/packages/shared/src/flags.ts@@ -72,13 +72,6 @@ export const SIGNALS_PR_REFUNDS_FLAG = featureFlagKeys.SIGNALS_PR_REFUNDS_FLAG;*/export const CHANNEL_REPORTS_FLAG = featureFlagKeys.CHANNEL_REPORTS_FLAG;-/**- * The global reports inbox: one sectioned, keyboard-triageable page for every- * report, reclaiming the inbox nav slot from the channel-reports takeover.- * The per-space sidebar list stays the working set beside it.- */-export const REPORTS_INBOX_FLAG = featureFlagKeys.REPORTS_INBOX_FLAG;-/*** One-report-at-a-time keyboard triage inside the reports inbox. On by* default in dev builds for iteration (see useTriageFocusEnabled); off indiff --git a/products/desktop/packages/ui/src/features/canvas/components/ActivityIncludeMenuSection.tsx b/products/desktop/packages/ui/src/features/canvas/components/ActivityIncludeMenuSection.tsxindex e6b95f1919fc..ed1ae78e3466 100644--- a/products/desktop/packages/ui/src/features/canvas/components/ActivityIncludeMenuSection.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/ActivityIncludeMenuSection.tsx@@ -10,7 +10,6 @@ import {hasActiveActivityMenuFilters,useActivityFilterStore,} from "@posthog/ui/features/canvas/stores/activityFilterStore";-import { useReportsInboxEnabled } from "@posthog/ui/features/feature-flags/useReportsInboxEnabled";import {INBOX_PRIORITY_MENU_OPTIONS,INBOX_SORT_MENU_OPTIONS,@@ -41,7 +40,6 @@ const REPORT_OPTIONS: readonly FilterOption<InboxPrFilter>[] = [];export function ActivityIncludeMenuSection(): ReactElement {- const reportsInboxEnabled = useReportsInboxEnabled();const authIdentity = useAuthStateValue(getAuthIdentity);const mentionsEnabled = useActivityFilterStore((state) => state.mentionsEnabled,@@ -90,7 +88,7 @@ export function ActivityIncludeMenuSection(): ReactElement {const filtersActive = useActivityFilterStore((state) =>hasActiveActivityMenuFilters(state, authIdentity),);- const inboxAvailable = reportsInboxEnabled && authIdentity !== null;+ const inboxAvailable = authIdentity !== null;const sourceOptions = useInboxSourceFilterOptions(sourceProductFilter, {enabled: inboxAvailable && inboxEnabled,});diff --git a/products/desktop/packages/ui/src/features/canvas/components/NavRail.tsx b/products/desktop/packages/ui/src/features/canvas/components/NavRail.tsxindex 4504d7e36d28..8920407159fb 100644--- a/products/desktop/packages/ui/src/features/canvas/components/NavRail.tsx+++ b/products/desktop/packages/ui/src/features/canvas/components/NavRail.tsx@@ -59,7 +59,6 @@ import {import { useCommandCenterActiveCount } from "@posthog/ui/features/command-center/useCommandCenterActiveCount";import { useContextLayerFlag } from "@posthog/ui/features/feature-flags/useContextLayerFlag";import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";-import { useInboxAvailable } from "@posthog/ui/features/feature-flags/useInboxAvailable";import { useInboxDecisionCount } from "@posthog/ui/features/inbox/hooks/useInboxDecisionCount";import { openSettings } from "@posthog/ui/features/settings/hooks/useOpenSettings";import { NavRailTile } from "@posthog/ui/features/sidebar/components/NavRailTile";@@ -282,7 +281,6 @@ function NavRailImpl() {const homeEnabled = useFeatureFlag(DESKTOP_HOME_FLAG);const loopsEnabled = useFeatureFlag(LOOPS_FLAG);const contextEnabled = useContextLayerFlag();- const inboxAvailable = useInboxAvailable();const tabsEnabled = useSpacesTabs();const openBrowserTab = useOpenBrowserTab();const mentionsEnabled = useActivityFilterStore(@@ -296,7 +294,7 @@ function NavRailImpl() {const toggleWorkActivity = useWorkActivityStore((state) => state.toggle);const railFlags = {home: homeEnabled,- inbox: inboxAvailable,+ inbox: true,loops: loopsEnabled,context: contextEnabled,savedSearches: savedSearchesRailEnabled && hasSavedSearches,diff --git a/products/desktop/packages/ui/src/features/canvas/hooks/useInboxActivityPreview.test.tsx b/products/desktop/packages/ui/src/features/canvas/hooks/useInboxActivityPreview.test.tsxindex f04bcd43d5af..546a3f72a751 100644--- a/products/desktop/packages/ui/src/features/canvas/hooks/useInboxActivityPreview.test.tsx+++ b/products/desktop/packages/ui/src/features/canvas/hooks/useInboxActivityPreview.test.tsx@@ -2,7 +2,6 @@ import { renderHook } from "@testing-library/react";import { beforeEach, describe, expect, it, vi } from "vitest";const mocks = vi.hoisted(() => ({- reportsInboxEnabled: true,currentUser: {data: { uuid: "user-1" } as { uuid: string } | undefined,isLoading: false,@@ -25,9 +24,6 @@ vi.mock("@posthog/ui/features/auth/useCurrentUser", () => ({vi.mock("@posthog/ui/features/inbox/hooks/useInboxReports", () => ({useInboxReports: mocks.useInboxReports,}));-vi.mock("@posthog/ui/features/feature-flags/useReportsInboxEnabled", () => ({- useReportsInboxEnabled: () => mocks.reportsInboxEnabled,-}));import { useActivityFilterStore } from "@posthog/ui/features/canvas/stores/activityFilterStore";import { useInboxActivityPreview } from "./useInboxActivityPreview";@@ -35,7 +31,6 @@ import { useInboxActivityPreview } from "./useInboxActivityPreview";describe("useInboxActivityPreview", () => {beforeEach(() => {vi.clearAllMocks();- mocks.reportsInboxEnabled = true;mocks.currentUser = {data: { uuid: "user-1" },isLoading: false,@@ -104,34 +99,20 @@ describe("useInboxActivityPreview", () => {);});- it.each([- [- "the project rollout is off",- () => {- mocks.reportsInboxEnabled = false;- },- ],- [- "the project has not opted in",- () => useActivityFilterStore.setState({ inboxEnabledByAuthIdentity: {} }),- ],- ])(- "hides cached reports and disables the query when %s",- (_name, disable) => {- disable();+ it("hides cached reports and disables the query when the project has not opted in", () => {+ useActivityFilterStore.setState({ inboxEnabledByAuthIdentity: {} });- const { result } = renderHook(() => useInboxActivityPreview());+ const { result } = renderHook(() => useInboxActivityPreview());- expect(result.current).toEqual({- reports: [],- totalCount: 0,- isLoading: false,- isIncluded: false,- });- expect(mocks.useInboxReports).toHaveBeenCalledWith(- expect.anything(),- expect.objectContaining({ enabled: false }),- );- },- );+ expect(result.current).toEqual({+ reports: [],+ totalCount: 0,+ isLoading: false,+ isIncluded: false,+ });+ expect(mocks.useInboxReports).toHaveBeenCalledWith(+ expect.anything(),+ expect.objectContaining({ enabled: false }),+ );+ });});diff --git a/products/desktop/packages/ui/src/features/canvas/hooks/useInboxActivityPreview.ts b/products/desktop/packages/ui/src/features/canvas/hooks/useInboxActivityPreview.tsindex 3e4f9cd2e6d7..d9adf0381adb 100644--- a/products/desktop/packages/ui/src/features/canvas/hooks/useInboxActivityPreview.ts+++ b/products/desktop/packages/ui/src/features/canvas/hooks/useInboxActivityPreview.ts@@ -11,7 +11,6 @@ import { useOptionalAuthenticatedClient } from "@posthog/ui/features/auth/authClimport { useAuthStateValue } from "@posthog/ui/features/auth/store";import { useCurrentUser } from "@posthog/ui/features/auth/useCurrentUser";import { useActivityFilterStore } from "@posthog/ui/features/canvas/stores/activityFilterStore";-import { useReportsInboxEnabled } from "@posthog/ui/features/feature-flags/useReportsInboxEnabled";import { useInboxReports } from "@posthog/ui/features/inbox/hooks/useInboxReports";const INBOX_ACTIVITY_PREVIEW_LIMIT = 3;@@ -26,7 +25,6 @@ interface InboxActivityPreview {}export function useInboxActivityPreview(): InboxActivityPreview {- const reportsInboxEnabled = useReportsInboxEnabled();const authIdentity = useAuthStateValue(getAuthIdentity);const inboxEnabled = useActivityFilterStore((state) =>authIdentity@@ -45,7 +43,7 @@ export function useInboxActivityPreview(): InboxActivityPreview {const priorityFilter = useActivityFilterStore((state) => state.inboxPriorityFilter,);- const isIncluded = reportsInboxEnabled && inboxEnabled;+ const isIncluded = inboxEnabled;const needsReviewer = isIncluded && inboxScope === INBOX_SCOPE_FOR_YOU;const client = useOptionalAuthenticatedClient();const { data: currentUser, isLoading: isReviewerLoading } = useCurrentUser({diff --git a/products/desktop/packages/ui/src/features/command/CommandMenu.tsx b/products/desktop/packages/ui/src/features/command/CommandMenu.tsxindex a98f6d22fbe9..eb50e396387d 100644--- a/products/desktop/packages/ui/src/features/command/CommandMenu.tsx+++ b/products/desktop/packages/ui/src/features/command/CommandMenu.tsx@@ -108,7 +108,6 @@ import { useFileSearchContext } from "@posthog/ui/features/command/useFileSearchimport { useSearchRows } from "@posthog/ui/features/command/useSearchRows";import { useTaskSearch } from "@posthog/ui/features/command/useTaskSearch";import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";-import { useInboxAvailable } from "@posthog/ui/features/feature-flags/useInboxAvailable";import { useFeedbackStore } from "@posthog/ui/features/feedback/feedbackStore";import { useFolders } from "@posthog/ui/features/folders/useFolders";import { useProvisioningStore } from "@posthog/ui/features/provisioning/store";@@ -267,7 +266,6 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {import.meta.env.DEV,);const loopsEnabled = useFeatureFlag(LOOPS_FLAG);- const inboxAvailable = useInboxAvailable();const { channels } = useChannels({ enabled: bluebirdEnabled });const openBrowserTab = useOpenBrowserTab();const { theme, setTheme } = useThemeStore();@@ -432,27 +430,20 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {shortcut: SHORTCUTS.SETTINGS,onRun: () => openSettingsDialog(),},- ...(inboxAvailable- ? [- {- id: "inbox",- label: "Self-driving",- keywords: "reports pull requests agents notifications",- icon: (- <EnvelopeSimpleIcon- size={12}- className="text-muted-foreground"- />- ),- action: "open-inbox",- shortcut: SHORTCUTS.INBOX,- onRun: () => {- closeSettingsDialog();- navigateToInbox();- },- } satisfies Command,- ]- : []),+ {+ id: "inbox",+ label: "Self-driving",+ keywords: "reports pull requests agents notifications",+ icon: (+ <EnvelopeSimpleIcon size={12} className="text-muted-foreground" />+ ),+ action: "open-inbox",+ shortcut: SHORTCUTS.INBOX,+ onRun: () => {+ closeSettingsDialog();+ navigateToInbox();+ },+ },{id: "archived",label: "Archived",@@ -761,7 +752,6 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {canSearchFiles,openFilePicker,loopsEnabled,- inboxAvailable,bluebirdEnabled,spacesLayout,]);diff --git a/products/desktop/packages/ui/src/features/command/KeyboardShortcutsSheet.tsx b/products/desktop/packages/ui/src/features/command/KeyboardShortcutsSheet.tsxindex 0c9aff39e2e5..e95780c08540 100644--- a/products/desktop/packages/ui/src/features/command/KeyboardShortcutsSheet.tsx+++ b/products/desktop/packages/ui/src/features/command/KeyboardShortcutsSheet.tsx@@ -5,7 +5,6 @@ import {getShortcutsByCategory,type ShortcutCategory,} from "@posthog/ui/features/command/keyboard-shortcuts";-import { useInboxAvailable } from "@posthog/ui/features/feature-flags/useInboxAvailable";import { Box, Dialog, Flex, Text } from "@radix-ui/themes";import { useMemo, useState } from "react";import { useHotkeys } from "react-hotkeys-hook";@@ -114,14 +113,9 @@ export function KeyboardShortcutsList() {// Several keys change owner with the layout, so the sheet has to know which// one is on rather than listing keys nothing handles.const channelsLayout = useChannelsLayout();- const inboxAvailable = useInboxAvailable();const shortcutsByCategory = useMemo(- () =>- getShortcutsByCategory({- channelsLayout,- inboxEnabled: inboxAvailable,- }),- [channelsLayout, inboxAvailable],+ () => getShortcutsByCategory({ channelsLayout }),+ [channelsLayout],);const categoryOrder: ShortcutCategory[] = [diff --git a/products/desktop/packages/ui/src/features/command/keyboard-shortcuts.ts b/products/desktop/packages/ui/src/features/command/keyboard-shortcuts.tsindex eb2c899ab051..cb9eea3333e2 100644--- a/products/desktop/packages/ui/src/features/command/keyboard-shortcuts.ts+++ b/products/desktop/packages/ui/src/features/command/keyboard-shortcuts.ts@@ -375,11 +375,8 @@ export const CATEGORY_LABELS: Record<ShortcutCategory, string> = {export function getShortcutsByCategory({channelsLayout = false,- inboxEnabled = true,}: {channelsLayout?: boolean;- /** Off when channel reports replace the inbox and nothing handles its key. */- inboxEnabled?: boolean;} = {}): Record<ShortcutCategory, KeyboardShortcut[]> {const grouped: Record<ShortcutCategory, KeyboardShortcut[]> = {general: [],@@ -392,7 +389,6 @@ export function getShortcutsByCategory({: "no-channels-layout";for (const shortcut of KEYBOARD_SHORTCUTS) {if (shortcut.availability && shortcut.availability !== wanted) continue;- if (!inboxEnabled && shortcut.id === "inbox") continue;grouped[shortcut.category].push(shortcut);}return grouped;diff --git a/products/desktop/packages/ui/src/features/feature-flags/useInboxAvailable.test.tsx b/products/desktop/packages/ui/src/features/feature-flags/useInboxAvailable.test.tsxdeleted file mode 100644index 7ecb02780901..000000000000--- a/products/desktop/packages/ui/src/features/feature-flags/useInboxAvailable.test.tsx+++ /dev/null@@ -1,40 +0,0 @@-import { renderHook } from "@testing-library/react";-import { beforeEach, describe, expect, it, vi } from "vitest";-import { useInboxAvailable } from "./useInboxAvailable";--const flags = vi.hoisted(() => ({- channelReportsEnabled: false,- reportsInboxEnabled: false,-}));--vi.mock("./useChannelReportsEnabled", () => ({- useChannelReportsEnabled: () => flags.channelReportsEnabled,-}));--vi.mock("./useReportsInboxEnabled", () => ({- useReportsInboxEnabled: () => flags.reportsInboxEnabled,-}));--describe("useInboxAvailable", () => {- beforeEach(() => {- flags.channelReportsEnabled = false;- flags.reportsInboxEnabled = false;- });-- it.each([- { channelReports: false, reportsInbox: false, available: true },- { channelReports: false, reportsInbox: true, available: true },- { channelReports: true, reportsInbox: false, available: false },- { channelReports: true, reportsInbox: true, available: true },- ])(- "is $available when channel reports are $channelReports and the reports inbox is $reportsInbox",- ({ channelReports, reportsInbox, available }) => {- flags.channelReportsEnabled = channelReports;- flags.reportsInboxEnabled = reportsInbox;-- const { result } = renderHook(() => useInboxAvailable());-- expect(result.current).toBe(available);- },- );-});diff --git a/products/desktop/packages/ui/src/features/feature-flags/useInboxAvailable.ts b/products/desktop/packages/ui/src/features/feature-flags/useInboxAvailable.tsdeleted file mode 100644index b0a848609c79..000000000000--- a/products/desktop/packages/ui/src/features/feature-flags/useInboxAvailable.ts+++ /dev/null@@ -1,13 +0,0 @@-import { useChannelReportsEnabled } from "@posthog/ui/features/feature-flags/useChannelReportsEnabled";-import { useReportsInboxEnabled } from "@posthog/ui/features/feature-flags/useReportsInboxEnabled";--function isInboxAvailable(- channelReportsEnabled: boolean,- reportsInboxEnabled: boolean,-): boolean {- return !channelReportsEnabled || reportsInboxEnabled;-}--export function useInboxAvailable(): boolean {- return isInboxAvailable(useChannelReportsEnabled(), useReportsInboxEnabled());-}diff --git a/products/desktop/packages/ui/src/features/feature-flags/useReportsInboxEnabled.ts b/products/desktop/packages/ui/src/features/feature-flags/useReportsInboxEnabled.tsdeleted file mode 100644index 90976a3c3749..000000000000--- a/products/desktop/packages/ui/src/features/feature-flags/useReportsInboxEnabled.ts+++ /dev/null@@ -1,11 +0,0 @@-import { REPORTS_INBOX_FLAG } from "@posthog/shared";-import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";--/**- * Whether the global reports inbox owns the inbox nav slot. One hook so the- * page takeover and the nav entries flip together. Defaults on in dev builds,- * same as channel reports.- */-export function useReportsInboxEnabled(): boolean {- return useFeatureFlag(REPORTS_INBOX_FLAG, import.meta.env.DEV);-}diff --git a/products/desktop/packages/ui/src/features/inbox/AGENTS.md b/products/desktop/packages/ui/src/features/inbox/AGENTS.mdindex c6a51fe9619a..4cded6b40827 100644--- a/products/desktop/packages/ui/src/features/inbox/AGENTS.md+++ b/products/desktop/packages/ui/src/features/inbox/AGENTS.md@@ -87,7 +87,7 @@ Do not add frontend-only controls that imply a backend capability. If the UI exp## Routes and Shell-`InboxView` is the layout shell for `/inbox/*`. It owns the page header, tab bar, reviewer scope control, and nested route outlet. Route files live in `apps/code/src/renderer/routes/inbox/`.+`InboxView` is the layout shell for `/inbox/*`. On a triage route it renders `InboxTriagePane` in both layouts. On other list routes it renders `InboxHomePane` under the spaces layout and the sectioned `ReportsInboxView` page otherwise. Detail routes render through the nested route outlet. Route files live in `apps/code/src/renderer/routes/inbox/`.Under the spaces layout Self-driving is a rail destination that owns the columnbeside the rail (`railPaneHasSidebar`, `railPane.ts`). `InboxPane` draws the@@ -145,7 +145,7 @@ and the page can never disagree about what is in the inbox. React Query dedupesthe requests, but paging is a side effect, so only one caller may drive it: thesidebar pages, `InboxHomePane` passes `autoPage: false`.-The tab components are intentionally simple:+The tab list components are legacy. `InboxView` never renders the outlet on a list route (see Routes and Shell above), so no current route shows them. Do not extend them; they stay only until a follow-up removes them:- `PullRequestsTab` partitions scoped reports with `isPullRequestReport`.- `ReportsTab` partitions with `isReportTabReport`.diff --git a/products/desktop/packages/ui/src/features/inbox/components/InboxPageHeader.tsx b/products/desktop/packages/ui/src/features/inbox/components/InboxPageHeader.tsxdeleted file mode 100644index 25b9e47aedbb..000000000000--- a/products/desktop/packages/ui/src/features/inbox/components/InboxPageHeader.tsx+++ /dev/null@@ -1,107 +0,0 @@-import { RobotIcon } from "@phosphor-icons/react";-import {- type InboxTabCounts,- inboxScopeApplies,- inboxTabFromPath,-} from "@posthog/core/inbox/reportMembership";-import { Button } from "@posthog/quill";-import { useBluebirdFlag } from "@posthog/ui/features/feature-flags/useBluebirdFlag";-import { InboxScopeSelect } from "@posthog/ui/features/inbox/components/InboxScopeSelect";-import {- InboxTabBar,- InboxTabs,-} from "@posthog/ui/features/inbox/components/InboxTabBar";-import {- PageHeader,- PageHeaderActions,- PageHeaderDescription,- PageHeaderFilters,- PageHeaderHeading,- PageHeaderNav,- PageHeaderTitle,- PageHeaderTitleRow,-} from "@posthog/ui/primitives/PageHeader";-import { settingsSourceHref } from "@posthog/ui/router/reportNavigation";-import { Link, useRouterState } from "@tanstack/react-router";--interface InboxPageHeaderProps {- counts: InboxTabCounts;-}--/**- * Responder configuration lives in Settings, not in the inbox. The header- * carries this always-visible way there so the config surface stays one click- * away from the work it powers.- */-function ConfigureAgentsButton() {- return (- <Button- variant="primary"- size="sm"- render={- <Link- to="/settings/$category"- params={{ category: "agents" }}- search={{ from: settingsSourceHref() }}- />- }- className="shrink-0"- >- <RobotIcon size={14} />- Configure agents- </Button>- );-}--export function InboxPageHeader({ counts }: InboxPageHeaderProps) {- // The shared page header ships behind bluebird; everyone else keeps the- // header this page has always had. Delete the legacy branch when the flag- // graduates.- const bluebird = useBluebirdFlag();- const pathname = useRouterState({ select: (s) => s.location.pathname });-- if (!bluebird) return <LegacyInboxPageHeader counts={counts} />;-- return (- <PageHeader>- <PageHeaderHeading>- <PageHeaderTitleRow>- <PageHeaderTitle>Self-driving</PageHeaderTitle>- <PageHeaderActions>- <ConfigureAgentsButton />- </PageHeaderActions>- </PageHeaderTitleRow>- <PageHeaderDescription>- Work done by your agents – pull requests, reports, and live runs.- </PageHeaderDescription>- </PageHeaderHeading>- <PageHeaderNav>- <InboxTabs counts={counts} />- {inboxScopeApplies(inboxTabFromPath(pathname)) && (- <PageHeaderFilters>- <InboxScopeSelect />- </PageHeaderFilters>- )}- </PageHeaderNav>- </PageHeader>- );-}--function LegacyInboxPageHeader({ counts }: InboxPageHeaderProps) {- return (- <div className="flex shrink-0 flex-col gap-3 border-(--gray-5) border-b px-6 pt-5 pb-0">- <div className="flex items-start justify-between gap-3">- <div className="flex cursor-default select-none flex-col gap-0.5">- <span className="font-bold text-[22px] text-gray-12 leading-tight tracking-tight">- Self-driving- </span>- <span className="max-w-3xl text-[12.5px] text-gray-11 leading-snug">- Work done by your agents – pull requests, reports, and live runs.- </span>- </div>- <ConfigureAgentsButton />- </div>- <InboxTabBar counts={counts} />- </div>- );-}diff --git a/products/desktop/packages/ui/src/features/inbox/components/InboxTabBar.tsx b/products/desktop/packages/ui/src/features/inbox/components/InboxTabBar.tsxdeleted file mode 100644index bfda3e29c0a8..000000000000--- a/products/desktop/packages/ui/src/features/inbox/components/InboxTabBar.tsx+++ /dev/null@@ -1,78 +0,0 @@-import {- INBOX_TAB_KEYS,- INBOX_TAB_LABEL,- INBOX_TAB_LIST_ROUTE,- type InboxTabCounts,- type InboxTabKey,- inboxScopeApplies,- inboxTabFromPath,-} from "@posthog/core/inbox/reportMembership";-import { Tabs, TabsList, TabsTrigger } from "@posthog/quill";-import { InboxScopeSelect } from "@posthog/ui/features/inbox/components/InboxScopeSelect";-import { useNavigate, useRouterState } from "@tanstack/react-router";--interface InboxTabBarProps {- counts: InboxTabCounts;-}--/** The legacy header's row: tabs with the reviewer-scope select alongside. */-export function InboxTabBar({ counts }: InboxTabBarProps) {- const pathname = useRouterState({ select: (s) => s.location.pathname });- const activeKey = inboxTabFromPath(pathname);-- return (- <div className="flex min-w-0 items-center justify-between gap-2">- <InboxTabs counts={counts} />- {inboxScopeApplies(activeKey) && <InboxScopeSelect />}- </div>- );-}--/** Just the tab strip — the header slots its own filters beside it. */-export function InboxTabs({ counts }: InboxTabBarProps) {- const navigate = useNavigate();- const pathname = useRouterState({ select: (s) => s.location.pathname });- const activeKey = inboxTabFromPath(pathname);-- // quill's TabsList is `inline-flex w-fit` with no wrap or scroll of its own,- // so at narrow widths the strip needs a scroll container or it overflows the- // header row.- return (- <Tabs- value={activeKey}- className="min-w-0 overflow-x-auto"- onValueChange={(value: string) => {- const key = value as InboxTabKey;- navigate({ to: INBOX_TAB_LIST_ROUTE[key] });- }}- >- <TabsList- variant="line"- className="h-auto gap-0.5 [&_.quill-tabs__indicator]:transition-[transform,width]! [&_.quill-tabs__indicator]:duration-100! [&_.quill-tabs__indicator]:ease-out!"- >- {INBOX_TAB_KEYS.map((key) => {- const isActive = key === activeKey;- return (- <TabsTrigger key={key} value={key} className="gap-1.5 px-2.5 py-2">- <span className="font-medium text-[13px]">- {INBOX_TAB_LABEL[key]}- </span>- {/* Runs and the open-ended Archive don't get a running total — it adds no signal. */}- {key !== "runs" && key !== "dismissed" && counts[key] > 0 && (- <span- className={- isActive- ? "text-[12px] text-gray-11 tabular-nums"- : "text-[12px] text-gray-10 tabular-nums"- }- >- {counts[key]}- </span>- )}- </TabsTrigger>- );- })}- </TabsList>- </Tabs>- );-}diff --git a/products/desktop/packages/ui/src/features/inbox/components/InboxView.tsx b/products/desktop/packages/ui/src/features/inbox/components/InboxView.tsxindex 87999a71cf42..16094083c373 100644--- a/products/desktop/packages/ui/src/features/inbox/components/InboxView.tsx+++ b/products/desktop/packages/ui/src/features/inbox/components/InboxView.tsx@@ -1,18 +1,13 @@import { EnvelopeSimpleIcon } from "@phosphor-icons/react";import { isInboxDetailPath } from "@posthog/core/inbox/reportMembership";import { useChannelsLayout } from "@posthog/ui/features/canvas/hooks/useChannelsLayout";-import { useInboxAvailable } from "@posthog/ui/features/feature-flags/useInboxAvailable";-import { useReportsInboxEnabled } from "@posthog/ui/features/feature-flags/useReportsInboxEnabled";import { InboxHomePane } from "@posthog/ui/features/inbox/components/InboxHomePane";-import { InboxPageHeader } from "@posthog/ui/features/inbox/components/InboxPageHeader";import { InboxTriagePane } from "@posthog/ui/features/inbox/components/InboxTriagePane";import { ReportsInboxView } from "@posthog/ui/features/inbox/components/ReportsInboxView";-import { useInboxAllReports } from "@posthog/ui/features/inbox/hooks/useInboxAllReports";import { resetReportOpenTrackerHistory } from "@posthog/ui/features/inbox/hooks/useReportOpenTracker";-import { useTrackInboxViewed } from "@posthog/ui/features/inbox/hooks/useTrackInboxViewed";import { isInboxTriagePath } from "@posthog/ui/features/inbox/triageRoute";import { useSetHeaderContent } from "@posthog/ui/hooks/useSetHeaderContent";-import { Navigate, Outlet, useRouterState } from "@tanstack/react-router";+import { Outlet, useRouterState } from "@tanstack/react-router";import { useEffect, useMemo } from "react";/**@@ -45,43 +40,22 @@ export function InboxView() {const pathname = useRouterState({ select: (s) => s.location.pathname });const isDetailView = isInboxDetailPath(pathname);- const inboxAvailable = useInboxAvailable();- // The global reports inbox replaces the pipeline tabs with one sectioned,- // keyboard-triageable page, and reclaims the inbox slot from the spaces- // redirect below. Detail routes keep their own bodies.- const reportsInboxEnabled = useReportsInboxEnabled();const spacesLayout = useChannelsLayout();// Beside the rail's list the pane names nothing the column has not said.- const paneOwnsTitle = spacesLayout && reportsInboxEnabled && !isDetailView;+ const paneOwnsTitle = spacesLayout && !isDetailView;useSetHeaderContent(paneOwnsTitle ? null : headerContent);- const listEnabled = !isDetailView && inboxAvailable;- const legacyListEnabled = listEnabled && !reportsInboxEnabled;- const { counts } = useInboxAllReports({- enabled: legacyListEnabled,- withReportsCount: true,- });-- useTrackInboxViewed({ enabled: legacyListEnabled });-- if (reportsInboxEnabled && !isDetailView) {+ // The reports inbox is one sectioned, keyboard-triageable page. Detail+ // routes keep their own bodies.+ if (!isDetailView) {if (isInboxTriagePath(pathname)) return <InboxTriagePane />;// The view owns its height so its page header stays pinned while the// sections scroll — the same shape ActivityView has.return spacesLayout ? <InboxHomePane /> : <ReportsInboxView />;}- // With channel reports on, spaces replace the inbox as the home for reports.- // List tabs reached through stale history or bookmarks land on the spaces- // index; detail URLs keep working (deep links and old history still carry- // them, and the in-space route can't be derived from a bare report URL here).- if (!inboxAvailable && !isDetailView) {- return <Navigate replace to="/website" />;- }-return (<div className="flex h-full min-h-0 flex-col">- {!isDetailView && <InboxPageHeader counts={counts} />}<div className="min-h-0 flex-1 overflow-auto"><Outlet /></div>diff --git a/products/desktop/packages/ui/src/features/inbox/hooks/useTrackInboxViewed.test.tsx b/products/desktop/packages/ui/src/features/inbox/hooks/useTrackInboxViewed.test.tsxdeleted file mode 100644index 216aa3d7f502..000000000000--- a/products/desktop/packages/ui/src/features/inbox/hooks/useTrackInboxViewed.test.tsx+++ /dev/null@@ -1,151 +0,0 @@-import { INBOX_SCOPE_ENTIRE_PROJECT } from "@posthog/core/inbox/reportMembership";-import type {- SignalReport,- SignalReportsQueryParams,- SignalReportsResponse,-} from "@posthog/shared/domain-types";-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";-import { renderHook, waitFor } from "@testing-library/react";-import type { ReactNode } from "react";-import { beforeEach, describe, expect, it, vi } from "vitest";--const PIPELINE_TOTAL = 240;-const PULL_REQUEST_TOTAL = 40;-const REPORT_TAB_TOTAL = 75;--const mockGetSignalReports = vi.hoisted(() => vi.fn());-const mockTrack = vi.hoisted(() => vi.fn());--vi.mock("@posthog/ui/features/auth/authClient", () => ({- useOptionalAuthenticatedClient: () => ({- getSignalReports: mockGetSignalReports,- }),-}));--vi.mock("@posthog/ui/features/auth/useCurrentUser", () => ({- AUTH_SCOPED_QUERY_META: {},- useCurrentUser: () => ({ data: { uuid: "user-1" } }),-}));--vi.mock("@posthog/ui/shell/analytics", () => ({ track: mockTrack }));--vi.mock("@posthog/ui/features/inbox/stores/inboxReviewerScopeStore", () => ({- useInboxReviewerScopeStore: (- selector: (state: { scope: string }) => unknown,- ) => selector({ scope: INBOX_SCOPE_ENTIRE_PROJECT }),-}));--vi.mock("@posthog/ui/features/inbox/stores/inboxSignalsFilterStore", () => ({- useInboxSignalsFilterStore: (selector: (state: unknown) => unknown) =>- selector({- searchQuery: "",- sortField: "priority",- sortDirection: "desc",- sourceProductFilter: [],- priorityFilter: [],- }),-}));--import { useInboxAllReports } from "./useInboxAllReports";-import { useTrackInboxViewed } from "./useTrackInboxViewed";--function readyReport(index: number): SignalReport {- return {- id: `report-${index}`,- title: `Report ${index}`,- summary: null,- status: "ready",- total_weight: 1,- signal_count: 1,- created_at: "2024-01-01T00:00:00Z",- updated_at: "2024-01-01T00:00:00Z",- artefact_count: 0,- implementation_pr_url: null,- };-}--function fakeServer(params?: SignalReportsQueryParams): SignalReportsResponse {- if (params?.has_implementation_pr === true) {- return { count: PULL_REQUEST_TOTAL, results: [] };- }- if (params?.has_implementation_pr === false) {- return { count: REPORT_TAB_TOTAL, results: [] };- }- return {- count: PIPELINE_TOTAL,- results: Array.from({ length: 100 }, (_, i) => readyReport(i)),- };-}--/**- * Renders the tracker with a probe alongside it, so tests can await the list's- * load state. The probe deliberately omits `withReportsCount`: opting in here- * would enable the count query itself, and the tracker would then read it from- * the cache even when the tracker never asked for it.- */-function renderTracker() {- const queryClient = new QueryClient({- defaultOptions: { queries: { retry: false } },- });- const wrapper = ({ children }: { children: ReactNode }) => (- <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>- );- return renderHook(- () => {- useTrackInboxViewed();- return useInboxAllReports();- },- { wrapper },- );-}--function trackedProperties(): Record<string, unknown> {- return mockTrack.mock.calls[0][1] as Record<string, unknown>;-}--describe("useTrackInboxViewed", () => {- beforeEach(() => {- vi.clearAllMocks();- mockGetSignalReports.mockImplementation(async (params) =>- fakeServer(params),- );- });-- it("records the tab counts the badges show", async () => {- renderTracker();-- await waitFor(() => expect(mockTrack).toHaveBeenCalledTimes(1));- expect(trackedProperties()).toMatchObject({- pulls_tab_count: PULL_REQUEST_TOTAL,- reports_tab_count: REPORT_TAB_TOTAL,- });- });-- it("holds the one-shot event until the count requests land", async () => {- let releaseReportsCount: (response: SignalReportsResponse) => void =- () => {};- const pendingReportsCount = new Promise<SignalReportsResponse>(- (resolve) => {- releaseReportsCount = resolve;- },- );- mockGetSignalReports.mockImplementation((params) =>- params?.has_implementation_pr === false- ? pendingReportsCount- : Promise.resolve(fakeServer(params)),- );-- const { result } = renderTracker();-- // The list resolving first is the whole point: the event must not fire on it.- await waitFor(() => expect(result.current.isSuccess).toBe(true));- expect(mockTrack).not.toHaveBeenCalled();-- releaseReportsCount({ count: REPORT_TAB_TOTAL, results: [] });-- await waitFor(() => expect(mockTrack).toHaveBeenCalledTimes(1));- expect(trackedProperties()).toMatchObject({- reports_tab_count: REPORT_TAB_TOTAL,- });- });-});diff --git a/products/desktop/packages/ui/src/features/inbox/hooks/useTrackInboxViewed.ts b/products/desktop/packages/ui/src/features/inbox/hooks/useTrackInboxViewed.tsdeleted file mode 100644index 40d0461fd08e..000000000000--- a/products/desktop/packages/ui/src/features/inbox/hooks/useTrackInboxViewed.ts+++ /dev/null@@ -1,74 +0,0 @@-import { buildInboxViewedProperties } from "@posthog/core/inbox/engagement";-import { inboxReviewerScopeValue } from "@posthog/core/inbox/reportMembership";-import { ANALYTICS_EVENTS } from "@posthog/shared/analytics-events";-import { useInboxAllReports } from "@posthog/ui/features/inbox/hooks/useInboxAllReports";-import { track } from "@posthog/ui/shell/analytics";-import { useEffect, useRef } from "react";--/**- * Fires `INBOX_VIEWED` once per inbox visit, after the report list settles,- * with the counts the user sees on load (tab badges, total, ready, and the- * priority/actionability breakdown of the visible reports).- *- * Mounted from `InboxView` for the legacy tabbed inbox, so it fires once per- * visit and survives tab switches. The sectioned reports inbox tracks from its- * existing list and count data to avoid mounting these legacy queries.- */-export function useTrackInboxViewed(options?: { enabled?: boolean }): void {- const enabled = options?.enabled ?? true;- const {- scopedReports,- totalCount,- counts,- scope,- isSuccess,- countsReady,- sourceProductFilter,- priorityFilter,- searchQuery,- // The badge counts come from their own requests, so opt in here too or the- // event records a zero the user never saw.- } = useInboxAllReports({ enabled, withReportsCount: true });-- const firedRef = useRef(false);- useEffect(() => {- if (!enabled || firedRef.current) return;- // Gate on a successful load, not just `!isLoading`: an errored initial- // request also leaves `isLoading` false with an empty list, and `firedRef`- // would then lock in a bogus empty-inbox view that a later refetch can't fix.- if (!isSuccess) return;- // The event carries the tab badges and fires once, so a list that settles- // ahead of the count requests would lock in counts of zero.- if (!countsReady) return;- firedRef.current = true;- track(- ANALYTICS_EVENTS.INBOX_VIEWED,- buildInboxViewedProperties({- visibleReports: scopedReports,- totalCount,- tabCounts: counts,- filters: {- surface: "desktop",- sourceProductFilter,- priorityFilter,- searchQuery,- scope: inboxReviewerScopeValue(scope),- // The legacy tabbed inbox has no report-state filter control.- reportStateFilter: [],- defaultReportStateFilter: [],- },- }),- );- }, [- isSuccess,- countsReady,- scopedReports,- totalCount,- counts,- scope,- sourceProductFilter,- priorityFilter,- searchQuery,- enabled,- ]);-}diff --git a/products/desktop/packages/ui/src/features/sidebar/components/SidebarNavSection.test.tsx b/products/desktop/packages/ui/src/features/sidebar/components/SidebarNavSection.test.tsxindex 375b4362c0c4..eb1b8424e245 100644--- a/products/desktop/packages/ui/src/features/sidebar/components/SidebarNavSection.test.tsx+++ b/products/desktop/packages/ui/src/features/sidebar/components/SidebarNavSection.test.tsx@@ -41,24 +41,16 @@ vi.mock("@posthog/ui/router/useAppView", () => ({useAppView,useReportSourceNavType: () => null,}));-// Channel reports defaults off here so the Inbox item renders; the flag-on-// test flips it via `channelReportsFlag`.+// Channel reports defaults off here; the flag-on test flips it via+// `channelReportsFlag`.let channelReportsFlag = false;-let reportsInboxFlag = false;vi.mock("@posthog/ui/features/feature-flags/useFeatureFlag", () => ({useFeatureFlag: (flag: string) =>- flag === "posthog-desktop-channel-reports"- ? channelReportsFlag- : flag === "posthog-desktop-reports-inbox"- ? reportsInboxFlag- : true,+ flag === "posthog-desktop-channel-reports" ? channelReportsFlag : true,}));vi.mock("@posthog/ui/features/feature-flags/useChannelReportsEnabled", () => ({useChannelReportsEnabled: () => channelReportsFlag,}));-vi.mock("@posthog/ui/features/feature-flags/useReportsInboxEnabled", () => ({- useReportsInboxEnabled: () => reportsInboxFlag,-}));// These tests pin the legacy layout (flag off), where the "Enable channels"// toggle row is present.vi.mock("@posthog/ui/features/canvas/hooks/useChannelsLayout", () => ({@@ -195,21 +187,8 @@ describe("SidebarNavSection", () => {expect(openBrowserTab).not.toHaveBeenCalled();});- it("removes the Inbox item when channel reports replace the inbox", () => {- channelReportsFlag = true;- try {- renderNav();- expect(- screen.queryByRole("button", { name: /Self-driving/ }),- ).not.toBeInTheDocument();- } finally {- channelReportsFlag = false;- }- });-- it("keeps the Inbox item when the reports inbox reclaims the slot", () => {+ it("keeps the Inbox item when channel reports are on", () => {channelReportsFlag = true;- reportsInboxFlag = true;try {renderNav();expect(@@ -217,7 +196,6 @@ describe("SidebarNavSection", () => {).toBeInTheDocument();} finally {channelReportsFlag = false;- reportsInboxFlag = false;}});diff --git a/products/desktop/packages/ui/src/features/sidebar/components/SidebarNavSection.tsx b/products/desktop/packages/ui/src/features/sidebar/components/SidebarNavSection.tsxindex e8d905d72f65..1d267eabef16 100644--- a/products/desktop/packages/ui/src/features/sidebar/components/SidebarNavSection.tsx+++ b/products/desktop/packages/ui/src/features/sidebar/components/SidebarNavSection.tsx@@ -8,7 +8,6 @@ import { useActivityFilterStore } from "@posthog/ui/features/canvas/stores/activimport { useCommandCenterActiveCount } from "@posthog/ui/features/command-center/useCommandCenterActiveCount";import { useContextLayerFlag } from "@posthog/ui/features/feature-flags/useContextLayerFlag";import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";-import { useInboxAvailable } from "@posthog/ui/features/feature-flags/useInboxAvailable";import { useInboxDecisionCount } from "@posthog/ui/features/inbox/hooks/useInboxDecisionCount";import { openSettings } from "@posthog/ui/features/settings/hooks/useOpenSettings";import {@@ -76,12 +75,10 @@ export function SidebarNavSection({PROJECT_BLUEBIRD_FLAG,import.meta.env.DEV,);- const inboxAvailable = useInboxAvailable();const mentionsEnabled = useActivityFilterStore((state) => state.mentionsEnabled,);- const inboxVisible = inboxAvailable;- const inboxDecisionCount = useInboxDecisionCount({ enabled: inboxVisible });+ const inboxDecisionCount = useInboxDecisionCount();const contextEnabled = useContextLayerFlag();const inSpaces = useRouterState({select: (state) => state.location.pathname.startsWith("/spaces"),@@ -142,9 +139,7 @@ export function SidebarNavSection({};const navItemAvailable: Record<NavItemId, boolean> = {- // The global reports inbox reclaims the slot from the channel-reports- // takeover; without it, spaces own reports and the entry goes away.- inbox: inboxAvailable,+ inbox: true,"command-center": true,contexts: contextEnabled,activity: bluebirdEnabled,diff --git a/products/desktop/packages/ui/src/shell/GlobalEventHandlers.tsx b/products/desktop/packages/ui/src/shell/GlobalEventHandlers.tsxindex 0c5918df0b55..d149d3cd6695 100644--- a/products/desktop/packages/ui/src/shell/GlobalEventHandlers.tsx+++ b/products/desktop/packages/ui/src/shell/GlobalEventHandlers.tsx@@ -18,7 +18,6 @@ import {SHORTCUTS,} from "@posthog/ui/features/command/keyboard-shortcuts";import { useFeatureFlag } from "@posthog/ui/features/feature-flags/useFeatureFlag";-import { useInboxAvailable } from "@posthog/ui/features/feature-flags/useInboxAvailable";import { useFeedbackStore } from "@posthog/ui/features/feedback/feedbackStore";import { useFolders } from "@posthog/ui/features/folders/useFolders";import { toggleRightPanel } from "@posthog/ui/features/navigation/rightPanelSide";@@ -98,7 +97,6 @@ function useGlobalEventHandlers({);const channelsEnabled =useSidebarStore((s) => s.channelsEnabled) && bluebirdEnabled;- const inboxAvailable = useInboxAvailable();const channelsLayout = useChannelsLayout();const spacesTabs = useSpacesTabs();const browserTabStripMounted = channelsLayout ? spacesTabs : true;@@ -242,10 +240,7 @@ function useGlobalEventHandlers({onToggleShortcutsSheet,GLOBAL_HOTKEY_OPTIONS,);- useHotkeys(SHORTCUTS.INBOX, navigateToInbox, {- ...GLOBAL_HOTKEY_OPTIONS,- enabled: inboxAvailable,- });+ useHotkeys(SHORTCUTS.INBOX, navigateToInbox, GLOBAL_HOTKEY_OPTIONS);useHotkeys(SHORTCUTS.COMMAND_CENTER,navigateToCommandCenter,