// Floating panel listing current validation issues — shown next to the // status bar. Click an issue to focus its anchored element across the rail // + diagram (via setFocusBlockId). Lets the user verify the validator is // actually firing on the broken-fixture demos. "use client"; import { useState } from "react"; import type { ValidationIssue } from "../../lib/sysml/validate"; interface IssuesPanelProps { issues: ValidationIssue[]; onSelectAnchor?: (id: string) => void; } const SEV_GLYPH: Record = { error: "●", warning: "▲", soft: "·", }; export function IssuesPanel({ issues, onSelectAnchor }: IssuesPanelProps) { const [collapsed, setCollapsed] = useState(false); const grouped = { error: issues.filter(i => i.severity === "error"), warning: issues.filter(i => i.severity === "warning"), soft: issues.filter(i => i.severity === "soft"), }; if (issues.length === 0) { return (
); } return (
{!collapsed && ( )}
); }