From a72300475b375fe0f15938d394efd630bf74675a Mon Sep 17 00:00:00 2001 From: Jordan Ramos Date: Thu, 14 May 2026 15:29:20 -0600 Subject: [PATCH] =?UTF-8?q?Clean=20up=20metric=20breakdown=20panel=20?= =?UTF-8?q?=E2=80=94=20compact=20grid,=20top=208=20with=20show-all=20toggl?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced the large flex-wrap button cards with a tight CSS grid of compact cells (130px min). Each cell shows metric ID, current %, and NC count only. Category text and target removed to reduce noise. Capped to top 8 metrics by default with a 'Show all N' toggle for the rest. Removes visual clutter while keeping the data accessible. --- .../src/components/pages/CCPMetricsPage.js | 72 +++++++++---------- 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/frontend/src/components/pages/CCPMetricsPage.js b/frontend/src/components/pages/CCPMetricsPage.js index dd630a0..f0de15f 100644 --- a/frontend/src/components/pages/CCPMetricsPage.js +++ b/frontend/src/components/pages/CCPMetricsPage.js @@ -100,55 +100,55 @@ function StatsBar({ stats, onNonCompliantClick, ncExpanded }) { // --------------------------------------------------------------------------- // Metric Breakdown Panel (shown when Non-Compliant is clicked) // --------------------------------------------------------------------------- -function MetricBreakdownPanel({ metrics, onSelectMetric }) { +function MetricBreakdownPanel({ metrics }) { + const [showAll, setShowAll] = useState(false); + if (!metrics || metrics.length === 0) return null; // Only show metrics with non_compliant > 0 const ncMetrics = metrics.filter(m => m.non_compliant > 0); if (ncMetrics.length === 0) return null; + const TOP_COUNT = 8; + const displayMetrics = showAll ? ncMetrics : ncMetrics.slice(0, TOP_COUNT); + const hasMore = ncMetrics.length > TOP_COUNT; + return (
-
- Non-Compliant by Metric +
+
+ Non-Compliant by Metric +
+ {hasMore && ( + + )}
-
- {ncMetrics.map(m => { +
+ {displayMetrics.map(m => { const pct = m.total > 0 ? (m.compliant / m.total) : 0; const target = Number(m.target || 0); const color = pct >= target ? '#10B981' : pct >= target * 0.85 ? '#F59E0B' : '#EF4444'; return ( - +
{m.non_compliant.toLocaleString()}
+
); })}
@@ -801,7 +801,6 @@ function DataManagementPanel({ onClose, onDataChanged }) {

Manage Data

{/* ⚠️ CONVENTION: Use lucide-react icon instead of raw Unicode character */} - {/* ⚠️ CONVENTION: Use lucide-react icon instead of raw Unicode character */}
@@ -1052,14 +1051,7 @@ export default function CCPMetricsPage() { {/* Metric breakdown (revealed when Non-Compliant is clicked) */} {showMetricBreakdown && ( - { - // Find the first vertical that has this metric with non-compliant > 0 - // and navigate to it - setShowMetricBreakdown(false); - }} - /> + )} {/* Charts row */}