: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(desktop): mobile show collapsed scout confirmations on a report (#102858)
Tom Owersc83b7201e72b
diff --git a/products/desktop/apps/mobile/src/app/inbox/[...id].tsx b/products/desktop/apps/mobile/src/app/inbox/[...id].tsxindex 03f517325fdd..b979b98e3e5e 100644--- a/products/desktop/apps/mobile/src/app/inbox/[...id].tsx+++ b/products/desktop/apps/mobile/src/app/inbox/[...id].tsx@@ -591,7 +591,11 @@ export default function ReportDetailScreen() {)}{/* Activity log */}- <ReportActivity reportId={report.id} artefacts={artefacts} />+ <ReportActivity+ reportId={report.id}+ artefacts={artefacts}+ collapsedNoteCount={report.collapsed_note_count}+ />{/* Usefulness feedback */}<ReportFeedbackFooter report={report} />diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.test.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.test.tsxnew file mode 100644index 000000000000..14bbc4b49375--- /dev/null+++ b/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.test.tsx@@ -0,0 +1,78 @@+import type { AnySignalReportArtefact } from "@posthog/shared/domain-types";+import { createElement } from "react";+import { act, create } from "react-test-renderer";+import { describe, expect, it, vi } from "vitest";++vi.mock("./ArtefactCommit", () => ({ ArtefactCommit: () => null }));+vi.mock("./ArtefactTaskRun", () => ({ ArtefactTaskRun: () => null }));++import { ReportActivity } from "./ReportActivity";++const commit: AnySignalReportArtefact = {+ id: "a1",+ type: "commit",+ created_at: "2026-01-01T00:00:00Z",+ content: {+ repository: "posthog/posthog",+ branch: "main",+ commit_sha: "abcdef1234567890",+ message: "fix",+ },+};++function render(props: {+ artefacts?: AnySignalReportArtefact[];+ collapsedNoteCount?: number;+}) {+ let renderer: ReturnType<typeof create> | null = null;+ act(() => {+ renderer = create(+ createElement(ReportActivity, {+ reportId: "r1",+ artefacts: props.artefacts ?? [],+ collapsedNoteCount: props.collapsedNoteCount,+ }),+ );+ });+ if (!renderer) throw new Error("Renderer not created");+ return renderer as ReturnType<typeof create>;+}++function visibleText(renderer: ReturnType<typeof create>): string {+ const strings: string[] = [];+ const walk = (node: unknown): void => {+ if (typeof node === "string") strings.push(node);+ else if (Array.isArray(node)) for (const child of node) walk(child);+ else if (node && typeof node === "object" && "children" in node) {+ walk((node as { children: unknown }).children);+ }+ };+ walk(renderer.toJSON());+ return strings.join("");+}++describe("ReportActivity", () => {+ it("renders nothing when there are no artefacts and no confirmations", () => {+ expect(render({}).toJSON()).toBeNull();+ });++ it("renders the artefact count without a confirmation suffix", () => {+ const output = visibleText(render({ artefacts: [commit] }));+ expect(output).toContain("Activity");+ expect(output).toContain("(1)");+ expect(output).not.toContain("confirmation");+ expect(output).not.toContain("Corroborated");+ });++ it.each([+ [1, "1 confirmation", "Corroborated 1 more time by a scout"],+ [3, "3 confirmations", "Corroborated 3 more times by a scout"],+ ] as const)(+ "shows collapsed confirmations with the right singular or plural (%s)",+ (count, headerSuffix, line) => {+ const output = visibleText(render({ collapsedNoteCount: count }));+ expect(output).toContain(`(0) · ${headerSuffix}`);+ expect(output).toContain(`${line}, with nothing new to add.`);+ },+ );+});diff --git a/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.tsx b/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.tsxindex 27d40725e285..30cf1f0888d2 100644--- a/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.tsx+++ b/products/desktop/apps/mobile/src/features/inbox/components/ReportActivity.tsx@@ -52,9 +52,11 @@ function ArtefactRow({export function ReportActivity({reportId,artefacts,+ collapsedNoteCount = 0,}: {reportId: string;artefacts: AnySignalReportArtefact[];+ collapsedNoteCount?: number;}) {const themeColors = useThemeColors();const activity = useMemo(@@ -62,7 +64,7 @@ export function ReportActivity({[artefacts],);- if (activity.length === 0) return null;+ if (activity.length === 0 && collapsedNoteCount === 0) return null;return (<View className="mb-4">@@ -70,8 +72,18 @@ export function ReportActivity({<ClockCounterClockwise size={14} color={themeColors.gray[12]} /><Text className="font-semibold text-[14px] text-gray-12">Activity ({activity.length})+ {collapsedNoteCount > 0+ ? ` · ${collapsedNoteCount} ${collapsedNoteCount === 1 ? "confirmation" : "confirmations"}`+ : ""}</Text></View>+ {collapsedNoteCount > 0 ? (+ <Text className="mb-2 text-[12px] text-gray-10">+ Corroborated {collapsedNoteCount} more{" "}+ {collapsedNoteCount === 1 ? "time" : "times"} by a scout, with nothing+ new to add.+ </Text>+ ) : null}<View className="gap-2">{activity.map((artefact) => (<ArtefactRowdiff --git a/products/desktop/apps/mobile/src/test/setup.ts b/products/desktop/apps/mobile/src/test/setup.tsindex bff97520a7e0..5e322d9f399f 100644--- a/products/desktop/apps/mobile/src/test/setup.ts+++ b/products/desktop/apps/mobile/src/test/setup.ts@@ -87,6 +87,7 @@ vi.mock("phosphor-react-native", async () => {CircleIcon: icon("CircleIcon"),CircleNotch: icon("CircleNotch"),Clock: icon("Clock"),+ ClockCounterClockwise: icon("ClockCounterClockwise"),CloudArrowDown: icon("CloudArrowDown"),Code: icon("Code"),Copy: icon("Copy"),