feat(status-badge): CSS hover tooltip — replaces native title attribute
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
title= attribute tooltip is browser-native, tiny, and often invisible. New StatusBadge component uses a Tailwind group-hover absolute panel that appears immediately on hover with: - Clear heading per status - 'Meaning' and 'Action' lines - Arrow pointing to the badge - 200ms fade-in transition Used in TechniquesPage (list table) and TechniqueDetailPage (header).
This commit is contained in:
@@ -27,14 +27,7 @@ import { useAuth } from "../context/AuthContext";
|
||||
import TestFromTemplateForm from "../components/TestFromTemplateForm";
|
||||
import type { TechniqueStatus, TestState, TestResult } from "../types/models";
|
||||
|
||||
const STATUS_TOOLTIPS: Record<TechniqueStatus, string> = {
|
||||
validated: "✅ Validated — ≥2 tests executed and detected by Blue Team. Technique is covered.",
|
||||
partial: "🟡 Partial — Some tests done but not all detected, only 1 validated test, or some tests still pending. More testing needed.",
|
||||
in_progress: "🔵 In Progress — Tests exist but none validated yet (draft, executing, or under review).",
|
||||
not_covered: "🔴 Not Covered — Tests were run but Blue Team did not detect the attack. Coverage gap.",
|
||||
not_evaluated: "⚫ Not Evaluated — No tests created for this technique yet.",
|
||||
review_required:"🟠 Review Required — Technique was recently updated or new intel/rules detected. Needs review.",
|
||||
};
|
||||
import StatusBadge from "../components/StatusBadge";
|
||||
|
||||
const statusBadgeColors: Record<TechniqueStatus, string> = {
|
||||
validated: "bg-green-900/50 text-green-400 border-green-500/30",
|
||||
@@ -251,14 +244,7 @@ export default function TechniqueDetailPage() {
|
||||
<div>
|
||||
<div className="flex items-center gap-3">
|
||||
<h1 className="text-2xl font-bold text-white">{technique.mitre_id}</h1>
|
||||
<span
|
||||
className={`inline-flex rounded-full border px-2.5 py-0.5 text-xs font-medium cursor-help ${
|
||||
statusBadgeColors[technique.status_global]
|
||||
}`}
|
||||
title={STATUS_TOOLTIPS[technique.status_global]}
|
||||
>
|
||||
{technique.status_global.replace(/_/g, " ")}
|
||||
</span>
|
||||
<StatusBadge status={technique.status_global as TechniqueStatus} />
|
||||
{technique.review_required && (
|
||||
<span className="inline-flex items-center gap-1 rounded-full border border-orange-500/30 bg-orange-900/50 px-2.5 py-0.5 text-xs font-medium text-orange-400">
|
||||
<AlertTriangle className="h-3 w-3" />
|
||||
|
||||
Reference in New Issue
Block a user