feat(dashboards): hover tooltips on all metric cards
New MetricTooltip component — a small ⓘ icon showing an executive- friendly explanation panel on hover (CSS, no JS, instant). DashboardPage: tooltips on all 6 coverage summary cards (Total Techniques, Validated, Partial, In Progress, Not Covered, Not Evaluated), Coverage Evolution chart, Test Pipeline funnel, Team Activity and Validation Rate section headers. ExecutiveDashboardPage: tooltips on all 4 sub-scores (Coverage, Detection, Critical, Response), Score Trend, Top Threat Actors, 4 KPIs (MTTD, MTTR, Detection Efficacy, Validation Throughput), Coverage by Tactic, Critical Gaps table, and all 6 team metrics (Red/Blue Tests Done, Avg Time, Rejection). Each tooltip explains what the metric measures, what a good/bad value looks like, and what action to take — written for non- technical executives.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { ReactNode } from "react";
|
||||
import MetricTooltip from "./MetricTooltip";
|
||||
|
||||
interface CoverageSummaryCardProps {
|
||||
title: string;
|
||||
@@ -7,6 +8,8 @@ interface CoverageSummaryCardProps {
|
||||
icon: ReactNode;
|
||||
colorClass: string;
|
||||
bgClass: string;
|
||||
/** Optional tooltip explaining this metric to non-technical users */
|
||||
tooltip?: { description: string; context?: string };
|
||||
}
|
||||
|
||||
export default function CoverageSummaryCard({
|
||||
@@ -16,6 +19,7 @@ export default function CoverageSummaryCard({
|
||||
icon,
|
||||
colorClass,
|
||||
bgClass,
|
||||
tooltip,
|
||||
}: CoverageSummaryCardProps) {
|
||||
const percentage = total && total > 0 ? ((value / total) * 100).toFixed(1) : null;
|
||||
|
||||
@@ -23,7 +27,16 @@ export default function CoverageSummaryCard({
|
||||
<div className={`rounded-xl border border-gray-800 ${bgClass} p-5`}>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-gray-400">{title}</p>
|
||||
<p className="text-sm font-medium text-gray-400 flex items-center">
|
||||
{title}
|
||||
{tooltip && (
|
||||
<MetricTooltip
|
||||
title={title}
|
||||
description={tooltip.description}
|
||||
context={tooltip.context}
|
||||
/>
|
||||
)}
|
||||
</p>
|
||||
<p className={`mt-1 text-3xl font-bold ${colorClass}`}>{value}</p>
|
||||
{percentage !== null && (
|
||||
<p className="mt-1 text-xs text-gray-500">{percentage}% of total</p>
|
||||
|
||||
Reference in New Issue
Block a user