From 107acafa4db35767c43dbdde47503655dd1f4363 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sun, 7 Dec 2025 04:16:10 +0000
Subject: [PATCH 1/5] Initial plan
From 046462d08736d0ebadb0f5e4025c9ba8da12d06a Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sun, 7 Dec 2025 04:22:12 +0000
Subject: [PATCH 2/5] Add Visualization button to CaseDetail page header
Co-authored-by: teoat <68715844+teoat@users.noreply.github.com>
---
frontend/src/pages/CaseDetail.tsx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/frontend/src/pages/CaseDetail.tsx b/frontend/src/pages/CaseDetail.tsx
index f2fd376..cc1f364 100644
--- a/frontend/src/pages/CaseDetail.tsx
+++ b/frontend/src/pages/CaseDetail.tsx
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { useParams, useNavigate } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query';
-import { ArrowLeft, Share2, MoreHorizontal, Shield, Clock, FileText, Activity, Brain, MessageSquare } from 'lucide-react';
+import { ArrowLeft, Share2, MoreHorizontal, Shield, Clock, FileText, Activity, Brain, MessageSquare, BarChart3 } from 'lucide-react';
import { apiRequest } from '../lib/api';
import { EvidenceLibrary } from '../components/cases/EvidenceLibrary';
import { RiskTrendWidget } from '../components/dashboard/RiskTrendWidget';
@@ -114,6 +114,14 @@ interface PredictiveResponse {
+
- {/* KPI Cards */}
-
-
-
- Total Inflow
-
+ {/* KPI Summary Section */}
+
+
+
+ 📊 KPI Summary
+
+
+
+
+
+
+ Total Inflow
+
+
+
+ ${(data?.total_inflow || 0).toLocaleString()}
+
+
All incoming transactions
+
+
+
+
+ Total Outflow
+
+
+
+ ${(data?.total_outflow || 0).toLocaleString()}
+
+
All outgoing transactions
+
+
+
+
+ Net Cashflow
+
+
+
= 0 ? 'text-blue-600 dark:text-blue-400' : 'text-red-600 dark:text-red-400'}`}>
+ ${Math.abs(data?.net_cashflow || 0).toLocaleString()}
+
+
+ {(data?.net_cashflow || 0) >= 0 ? 'Surplus' : 'Deficit'}
+
+
+
+
+
+
+ {data?.suspect_transactions || 0}
+
+
Flagged transactions
+
+
+
+
+
+ {/* Main Content Grid - 2x2 Layout as per spec */}
+
+ {/* Cashflow Balance Section */}
+
+
+
+
+ 💸 Cashflow Balance
+
-
- ${(data?.total_inflow || 0).toLocaleString()}
-
- All incoming transactions
+ {data && }
-
-
- Total Outflow
-
+ {/* Milestone Tracker Section */}
+
+
+
+
+ 🏁 Milestone Tracker
+
-
- ${(data?.total_outflow || 0).toLocaleString()}
-
- All outgoing transactions
+ setSelectedMilestone(milestone)}
+ />
-
-
- Net Cashflow
-
+ {/* Fraud Detection Section */}
+
+
+
+
+ 🕵️♂️ Fraud Detection
+
- = 0 ? 'text-blue-600 dark:text-blue-400' : 'text-red-600 dark:text-red-400'}`}>
- ${Math.abs(data?.net_cashflow || 0).toLocaleString()}
-
-
- {(data?.net_cashflow || 0) >= 0 ? 'Surplus' : 'Deficit'}
-
+
-
-
- Suspect Items
-
+ {/* Network & Flow Section */}
+
+
+
+
+ 📊 Network & Flow
+
-
- {data?.suspect_transactions || 0}
-
- Flagged transactions
+
- {/* Tab Navigation */}
-
- {tabs.map((tab) => {
- const Icon = tab.icon;
- return (
- setView(tab.id)}
- className={`flex items-center gap-2 px-4 py-3 border-b-2 transition-colors ${
- view === tab.id
- ? 'border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400'
- : 'border-transparent text-slate-500 hover:text-slate-700 dark:hover:text-slate-300'
- }`}
- >
-
- {tab.label}
-
- );
- })}
-
-
- {/* Content Area */}
- setSelectedMilestone(null)}
+ title="Manage Milestone Phase"
>
- {view === 'cashflow' && data && (
-
- )}
-
- {view === 'milestones' && (
- <>
-
-
-
-
- Financial Milestones
-
-
-
- setSelectedMilestone(milestone)}
- />
-
-
-
- {/* Milestone Action Modal */}
- setSelectedMilestone(null)}
- title="Manage Milestone Phase"
- >
- {selectedMilestone && (
- {
- refetch();
- setSelectedMilestone(null);
- }}
- />
- )}
-
- >
- )}
-
- {view === 'fraud' && (
-
- )}
-
- {view === 'graphs' && (
- {
+ refetch();
+ setSelectedMilestone(null);
+ }}
/>
)}
-
+
);