feat(agents): Frontend Methodik-First Layout
CI / detect-changes (push) Successful in 7s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / build-sha-integrity (push) Failing after 4s
CI / validate-canonical-controls (push) Successful in 11s
CI / loc-budget (push) Successful in 14s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Successful in 2m24s
CI / test-go (push) Has been skipped
CI / iace-gt-coverage (push) Has been skipped
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
CI / detect-changes (push) Successful in 7s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / build-sha-integrity (push) Failing after 4s
CI / validate-canonical-controls (push) Successful in 11s
CI / loc-budget (push) Successful in 14s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Successful in 2m24s
CI / test-go (push) Has been skipped
CI / iace-gt-coverage (push) Has been skipped
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
User-Vorgabe: pro Slot transparent zeigen WAS wir tun:
1. Was wurde geprueft (MC-Coverage, collapsible)
2. Speedometer mit Severity-Verteilung
3. LLM-Eskalation-Log (wenn benutzt)
4. Findings sortiert HIGH->LOW, je Card:
- Methodik-Badge (MC / Regex / KB / LLM / Cross)
- Gesetzliche Basis (Norm-Block, violett)
- Befund (Zitat-Block, amber)
- Empfehlung -> 'Pflicht-Massnahme' bei HIGH,
'Best-Practice' bei MEDIUM/LOW, 'LLM-Vorschlag'
bei LLM-Quelle
5. Maszahmen-Plan (gerollupte Recommendations mit
related_finding_ids + Aufwand)
Refactor: ein File AgentTestTab.tsx (519 LOC) -> 7 Files:
_agentTypes.ts (Types + Methodik-Konstanten)
AgentSpeedometer.tsx
AgentMcCoverage.tsx
AgentFindingCard.tsx
AgentRecommendationCard.tsx
AgentSlotCard.tsx
AgentTestTab.tsx (Top-Level, schlank)
Plus Methodik-Info-Erklaerung am Tab-Anfang + Disclaimer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
'use client'
|
||||
|
||||
/**
|
||||
* "Was wurde geprüft" — listet alle MCs eines Agents mit ihrem Status.
|
||||
* Standardmäßig collapsed; zeigt sofort, was Methodik des Agents war.
|
||||
*/
|
||||
|
||||
import React, { useState } from 'react'
|
||||
|
||||
import type { McCoverage } from './_agentTypes'
|
||||
|
||||
const STATUS_COLOR: Record<string, string> = {
|
||||
ok: '#10b981',
|
||||
na: '#94a3b8',
|
||||
skipped: '#cbd5e1',
|
||||
high: '#dc2626',
|
||||
medium: '#f59e0b',
|
||||
low: '#3b82f6',
|
||||
}
|
||||
|
||||
const STATUS_LABEL: Record<string, string> = {
|
||||
ok: 'OK',
|
||||
na: 'n/a',
|
||||
skipped: 'übersprungen',
|
||||
high: 'HIGH',
|
||||
medium: 'MEDIUM',
|
||||
low: 'LOW',
|
||||
}
|
||||
|
||||
export function AgentMcCoverage({ coverage }: { coverage: McCoverage[] }) {
|
||||
const [open, setOpen] = useState(false)
|
||||
if (!coverage?.length) return null
|
||||
return (
|
||||
<div className="border rounded bg-slate-50">
|
||||
<button
|
||||
onClick={() => setOpen(o => !o)}
|
||||
className="w-full text-left px-3 py-2 text-xs font-semibold uppercase text-gray-700 flex justify-between items-center"
|
||||
>
|
||||
<span>Was wurde geprüft? ({coverage.length} MCs)</span>
|
||||
<span className="text-gray-400">{open ? '▾' : '▸'}</span>
|
||||
</button>
|
||||
{open && (
|
||||
<div className="border-t bg-white p-2 space-y-0.5 max-h-60 overflow-y-auto">
|
||||
{coverage.map(c => (
|
||||
<div key={c.mc_id} className="flex items-center gap-2 text-xs">
|
||||
<span
|
||||
className="w-2 h-2 rounded-full inline-block"
|
||||
style={{ background: STATUS_COLOR[c.status] || '#cbd5e1' }}
|
||||
/>
|
||||
<code className="text-gray-500">{c.mc_id}</code>
|
||||
<span className="text-gray-700">
|
||||
{STATUS_LABEL[c.status] || c.status}
|
||||
</span>
|
||||
{c.reason && (
|
||||
<span className="text-gray-400 italic">— {c.reason}</span>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user