From c79bb086d31c0fbfb892dba673367a704827f3d8 Mon Sep 17 00:00:00 2001 From: Igor Wilian Faoro Date: Tue, 22 Sep 2026 15:58:58 -0300 Subject: [PATCH 1/2] fix(admin): clarify overview activity scope --- src/components/admin/tabs/OverviewTab.tsx | 23 +++++++++++++++----- tests/components/admin/OverviewTab.test.tsx | 24 ++++++++++++++++++++- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/components/admin/tabs/OverviewTab.tsx b/src/components/admin/tabs/OverviewTab.tsx index ab956e3bd..91ce9161d 100644 --- a/src/components/admin/tabs/OverviewTab.tsx +++ b/src/components/admin/tabs/OverviewTab.tsx @@ -1,6 +1,7 @@ "use client"; import { appFetch, withBasePath } from "@/lib/config/base-path"; +import { adminSectionPath } from "@/lib/admin-sections"; import { useEffect, useMemo, useState, useCallback } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; @@ -999,12 +1000,24 @@ function AnalyticsSection({ {/* Recent Activity Feed */}
-

- - Recent Activity -

+
+

+ + Recent Activity +

+ + Audit +
{activityFeed.length === 0 ? ( -
No recent activity.
+
+ No application-recorded events in this preview. +
) : (
diff --git a/tests/components/admin/OverviewTab.test.tsx b/tests/components/admin/OverviewTab.test.tsx index 1afba0f8a..af0a59dc6 100644 --- a/tests/components/admin/OverviewTab.test.tsx +++ b/tests/components/admin/OverviewTab.test.tsx @@ -75,6 +75,7 @@ import React from "react"; import { mockGlobalFetch, restoreGlobalFetch } from "../../helpers/mock-fetch"; import { OverviewTab, DB_TYPES_PREVIEW } from "@/components/admin/tabs/OverviewTab"; +import { adminSectionPath } from "@/lib/admin-sections"; import { EXTERNAL_DATABASE_TYPES } from "@/lib/db/compatibility"; import { getDBConfig } from "@/lib/db-ui-config"; @@ -393,7 +394,7 @@ describe("OverviewTab", () => { await act(async () => { renderResult = render(); }); - const { queryByText } = renderResult!; + const { queryByText, queryByTestId } = renderResult!; await waitFor(() => { // Audit events are mapped into the feed alongside query history @@ -403,6 +404,27 @@ describe("OverviewTab", () => { expect(queryByText("5m ago")).not.toBeNull(); expect(queryByText("5h ago")).not.toBeNull(); expect(queryByText("3d ago")).not.toBeNull(); + const auditLink = queryByTestId("overview-audit-link"); + expect(auditLink).not.toBeNull(); + expect(auditLink?.getAttribute("href")).toBe(adminSectionPath("audit")); + }); + }); + + test("Recent Activity uses an honest empty state and still links to Audit", async () => { + mockGetHistory.mockImplementation(() => []); + + let renderResult: ReturnType; + await act(async () => { + renderResult = render(); + }); + const { queryByText, queryByTestId } = renderResult!; + + await waitFor(() => { + const auditLink = queryByTestId("overview-audit-link"); + expect(auditLink).not.toBeNull(); + expect(auditLink?.getAttribute("href")).toBe(adminSectionPath("audit")); + expect(queryByText("No application-recorded events in this preview.")).not.toBeNull(); + expect(queryByText("No recent activity.")).toBeNull(); }); }); From 553bf59431f87bef96907fb60ab6cdcae4a842c0 Mon Sep 17 00:00:00 2001 From: Igor Wilian Faoro Date: Wed, 23 Sep 2026 09:40:02 -0300 Subject: [PATCH 2/2] fix(admin): clarify recent activity empty state --- src/components/admin/tabs/OverviewTab.tsx | 9 +++++++-- tests/components/admin/OverviewTab.test.tsx | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/admin/tabs/OverviewTab.tsx b/src/components/admin/tabs/OverviewTab.tsx index 91ce9161d..3b2ea255a 100644 --- a/src/components/admin/tabs/OverviewTab.tsx +++ b/src/components/admin/tabs/OverviewTab.tsx @@ -1005,6 +1005,8 @@ function AnalyticsSection({ Recent Activity + {/* Unconditional: the preview cannot show proxy-recorded boundary denials, so the + Audit tab's scope disclosure must stay one click away in every feed state. */}
{activityFeed.length === 0 ? ( -
- No application-recorded events in this preview. +
+ No recent activity here. The Audit tab explains what this feed does not capture.
) : (
diff --git a/tests/components/admin/OverviewTab.test.tsx b/tests/components/admin/OverviewTab.test.tsx index af0a59dc6..d4d430771 100644 --- a/tests/components/admin/OverviewTab.test.tsx +++ b/tests/components/admin/OverviewTab.test.tsx @@ -423,7 +423,10 @@ describe("OverviewTab", () => { const auditLink = queryByTestId("overview-audit-link"); expect(auditLink).not.toBeNull(); expect(auditLink?.getAttribute("href")).toBe(adminSectionPath("audit")); - expect(queryByText("No application-recorded events in this preview.")).not.toBeNull(); + expect(queryByTestId("overview-recent-activity-empty")).not.toBeNull(); + expect( + queryByText("No recent activity here. The Audit tab explains what this feed does not capture."), + ).not.toBeNull(); expect(queryByText("No recent activity.")).toBeNull(); }); });