From 2c73f97450ba737291633f137e509b238910bb39 Mon Sep 17 00:00:00 2001 From: Bhavesh Mandalapu Date: Sun, 26 Apr 2026 15:04:02 -0500 Subject: [PATCH 1/3] verified claims population --- app/executive-overview/page.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/executive-overview/page.tsx b/app/executive-overview/page.tsx index 20c22a8..4f8c053 100644 --- a/app/executive-overview/page.tsx +++ b/app/executive-overview/page.tsx @@ -276,8 +276,6 @@ export default function ExecutiveOverviewPage() { if (error) return
Failed to load: {error}
; if (!data) return
Loading...
; - const verifiedClaimsCount = allClaims.filter((claim) => isVerifiedClaimStatus(claim.status)).length; - const meta = data.overview_metrics_meta; const overviewMetrics: OverviewMetricCard[] = [ { @@ -297,7 +295,7 @@ export default function ExecutiveOverviewPage() { { key: "verified_claims", title: "Verified Claims", - value: verifiedClaimsCount, + value: data.verified_claims, subLabel: `${meta.verified_claims.accuracy_pct}% ${meta.verified_claims.accuracy_label}`, icon: "claims", }, From b3ca2c8f9c84b091390fb7f69e6fce8d07294da6 Mon Sep 17 00:00:00 2001 From: Bhavesh Mandalapu Date: Sun, 26 Apr 2026 15:10:05 -0500 Subject: [PATCH 2/3] Executive overview page sentiment graph --- app/executive-overview/page.tsx | 63 +++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/app/executive-overview/page.tsx b/app/executive-overview/page.tsx index 4f8c053..56761de 100644 --- a/app/executive-overview/page.tsx +++ b/app/executive-overview/page.tsx @@ -5,6 +5,8 @@ import Link from "next/link"; import { AreaChart, Area, + BarChart, + Bar, XAxis, YAxis, Tooltip, @@ -16,6 +18,7 @@ import { useTheme } from "@/components/layout/ThemeContext"; import { apiFetch } from "@/lib/api"; import type { ExecutiveOverviewResponse, TopicClustersResponse, TopicCluster } from "@/lib/types/executive-overview"; import type { ClaimListResponse, ClaimItem } from "@/lib/types/claim"; +import type { SentimentShiftResponse } from "@/lib/types/sentiment"; type TopicTrend = Record; @@ -235,10 +238,12 @@ function BubbleChart({ clusters }: { clusters: TopicCluster[] }) { } export default function ExecutiveOverviewPage() { + const { isDark } = useTheme(); const [data, setData] = useState(null); const [clusters, setClusters] = useState([]); const [claims, setClaims] = useState([]); const [allClaims, setAllClaims] = useState([]); + const [sentiment, setSentiment] = useState(null); const [error, setError] = useState(null); const [claimStatusFilter, setClaimStatusFilter] = useState<"all" | "verified" | "unverifiable">("all"); const [claimsLoading, setClaimsLoading] = useState(true); @@ -248,11 +253,13 @@ export default function ExecutiveOverviewPage() { apiFetch("/overview/executive"), apiFetch("/overview/topic-clusters"), apiFetch("/claims"), + apiFetch("/overview/sentiment-shift", { range: "30d" }), ]) - .then(([execData, clusterData, allClaimData]) => { + .then(([execData, clusterData, allClaimData, sentimentData]) => { setData(execData); setClusters(clusterData.clusters); setAllClaims(allClaimData.data); + setSentiment(sentimentData); }) .catch((err) => setError(err instanceof Error ? err.message : String(err))); }, []); @@ -454,12 +461,56 @@ export default function ExecutiveOverviewPage() { -
+

Sentiment Analysis

-

Health domain overview

-
-

Sentiment analysis endpoint coming soon.

-

See docs/MISSING_APIS.md for details.

+

Last 30 days · health domain

+ {sentiment && ( +
+ + + {sentiment.totals.positive} positive + + + + {sentiment.totals.neutral} neutral + + + + {sentiment.totals.negative} negative + +
+ )} +
+ {!sentiment ? ( +
+ Loading… +
+ ) : sentiment.buckets.length === 0 ? ( +
+ No sentiment data available. +
+ ) : ( + + + + + + + + + + + + + )}
From 3e47e0d2f277ed922fead54a36f31d2982b00500 Mon Sep 17 00:00:00 2001 From: Bhavesh Mandalapu Date: Sun, 26 Apr 2026 15:15:00 -0500 Subject: [PATCH 3/3] linting --- app/executive-overview/page.tsx | 9 +-------- app/trend-analytics/page.tsx | 9 +++------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/executive-overview/page.tsx b/app/executive-overview/page.tsx index 56761de..194f1f7 100644 --- a/app/executive-overview/page.tsx +++ b/app/executive-overview/page.tsx @@ -53,10 +53,6 @@ function formatClaimStatus(status: string) { return status.replace(/_/g, " "); } -function isVerifiedClaimStatus(status: string) { - const normalized = status.trim().toLowerCase(); - return normalized === "verified" || normalized === "verified_true"; -} type MetricKey = | "total_videos_scoped" @@ -242,7 +238,6 @@ export default function ExecutiveOverviewPage() { const [data, setData] = useState(null); const [clusters, setClusters] = useState([]); const [claims, setClaims] = useState([]); - const [allClaims, setAllClaims] = useState([]); const [sentiment, setSentiment] = useState(null); const [error, setError] = useState(null); const [claimStatusFilter, setClaimStatusFilter] = useState<"all" | "verified" | "unverifiable">("all"); @@ -252,13 +247,11 @@ export default function ExecutiveOverviewPage() { Promise.all([ apiFetch("/overview/executive"), apiFetch("/overview/topic-clusters"), - apiFetch("/claims"), apiFetch("/overview/sentiment-shift", { range: "30d" }), ]) - .then(([execData, clusterData, allClaimData, sentimentData]) => { + .then(([execData, clusterData, sentimentData]) => { setData(execData); setClusters(clusterData.clusters); - setAllClaims(allClaimData.data); setSentiment(sentimentData); }) .catch((err) => setError(err instanceof Error ? err.message : String(err))); diff --git a/app/trend-analytics/page.tsx b/app/trend-analytics/page.tsx index 3c41e06..d5a7799 100644 --- a/app/trend-analytics/page.tsx +++ b/app/trend-analytics/page.tsx @@ -41,7 +41,6 @@ export default function TrendAnalyticsPage() { const [error, setError] = useState(null); const [range, setRange] = useState("6m"); const [sentimentData, setSentimentData] = useState(null); - const [sentimentLoading, setSentimentLoading] = useState(false); useEffect(() => { Promise.all([ @@ -57,11 +56,9 @@ export default function TrendAnalyticsPage() { }, []); useEffect(() => { - setSentimentLoading(true); apiFetch("/overview/sentiment-shift", { range }) .then((data) => setSentimentData(data)) - .catch(() => setSentimentData(null)) - .finally(() => setSentimentLoading(false)); + .catch(() => setSentimentData(null)); }, [range]); const filteredTrends = useMemo(() => { @@ -178,11 +175,11 @@ export default function TrendAnalyticsPage() {
)}
- {sentimentLoading ? ( + {!sentimentData ? (
Loading…
- ) : sentimentData && sentimentData.buckets.length > 0 ? ( + ) : sentimentData.buckets.length > 0 ? (