From 8849c396b5bf08cdb1c24994d199845d42a49353 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Thu, 7 May 2026 13:16:04 +0200 Subject: [PATCH] fix: Show L2 detail checks always visible (no extra click needed) L2 checks were hidden behind a second click on L1 items. Now they render inline below their L1 parent, always visible when the document card is expanded. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../sdk/agent/_components/ChecklistView.tsx | 106 +++++++----------- 1 file changed, 41 insertions(+), 65 deletions(-) diff --git a/admin-compliance/app/sdk/agent/_components/ChecklistView.tsx b/admin-compliance/app/sdk/agent/_components/ChecklistView.tsx index 538c5f0..be0d765 100644 --- a/admin-compliance/app/sdk/agent/_components/ChecklistView.tsx +++ b/admin-compliance/app/sdk/agent/_components/ChecklistView.tsx @@ -79,21 +79,11 @@ function L2Summary({ children }: { children: CheckItem[] }) { export function ChecklistView({ results }: { results: DocResult[] }) { const [expanded, setExpanded] = useState(null) - const [expandedL1, setExpandedL1] = useState>(new Set()) if (!results || results.length === 0) return null const totalOk = results.filter(r => r.completeness_pct === 100).length - const toggleL1 = (id: string) => { - setExpandedL1(prev => { - const next = new Set(prev) - if (next.has(id)) next.delete(id) - else next.add(id) - return next - }) - } - return (
@@ -172,64 +162,50 @@ export function ChecklistView({ results }: { results: DocResult[] }) {

{r.error}

) : (
- {grouped.map((g) => { - const hasChildren = g.children.length > 0 - const isL1Exp = expandedL1.has(g.check.id) - - return ( -
- {/* L1 check */} -
toggleL1(g.check.id) : undefined} - > - -
-
- {g.check.label} - {hasChildren && {g.children}} - {hasChildren && ( - - - - )} + {grouped.map((g) => ( +
+ {/* L1 check */} +
+ +
+
+ {g.check.label} + {g.children.length > 0 && {g.children}} +
+ {g.check.passed && g.check.matched_text && g.children.length === 0 && ( +
+ "...{g.check.matched_text}..."
- {g.check.passed && g.check.matched_text && !hasChildren && ( -
- "...{g.check.matched_text}..." -
- )} -
+ )}
- - {/* L2 children */} - {hasChildren && isL1Exp && ( -
- {g.children.map((ch) => ( -
- -
-
- {ch.label} - {ch.skipped && ' (uebersprungen)'} -
- {ch.passed && ch.matched_text && ( -
- "...{ch.matched_text}..." -
- )} -
-
- ))} -
- )}
- ) - })} + + {/* L2 children — always visible */} + {g.children.length > 0 && ( +
+ {g.children.map((ch) => ( +
+ +
+
+ {ch.label} + {ch.skipped && ' (uebersprungen)'} +
+ {ch.passed && ch.matched_text && ( +
+ "...{ch.matched_text}..." +
+ )} +
+
+ ))} +
+ )} +
+ ))} {r.word_count > 0 && (
{r.word_count} Woerter analysiert