From d05d8ef3029b76444ae0ff4b1cdee06af2ab908f Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Tue, 11 Aug 2026 14:33:40 +0200 Subject: [PATCH] web: annotations card collapsed by default with verdict summary header The verdict comes at the end of a diagnosis, so the card must not take space from the details/analysis work above it. Clickable chevron header per section convention; count + verdict pills stay visible collapsed. Co-Authored-By: Claude Fable 5 --- .../components/SessionAnnotationsCard.tsx | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/src/Web/autopilot-monitor-web/app/sessions/components/SessionAnnotationsCard.tsx b/src/Web/autopilot-monitor-web/app/sessions/components/SessionAnnotationsCard.tsx index 728e58e2..93921432 100644 --- a/src/Web/autopilot-monitor-web/app/sessions/components/SessionAnnotationsCard.tsx +++ b/src/Web/autopilot-monitor-web/app/sessions/components/SessionAnnotationsCard.tsx @@ -65,6 +65,10 @@ export default function SessionAnnotationsCard({ const [annotations, setAnnotations] = useState>>({}); const [loaded, setLoaded] = useState(false); const [edit, setEdit] = useState>>({}); + // Collapsed by default: the verdict comes at the END of a diagnosis — the card must + // not take space away from the details/analysis work above it. The header summary + // (count + verdict pills) still shows at a glance whether a verdict exists. + const [expanded, setExpanded] = useState(false); const lanes = visibleLanes(user); @@ -152,12 +156,49 @@ export default function SessionAnnotationsCard({ } }; + const annotatedLanes = lanes.filter((lane) => hasContent(annotations[lane])); + return (
-
-

Annotations

+
setExpanded(!expanded)} + className="flex items-start justify-between gap-2 w-full text-left cursor-pointer" + > +
+ + + +

Annotations

+ {annotatedLanes.length > 0 && ( + <> + + ({annotatedLanes.length} {annotatedLanes.length === 1 ? "annotation" : "annotations"}) + +
+ {annotatedLanes.map((lane) => { + const verdict = annotations[lane]?.verdict; + return verdict != null ? ( + + {VERDICT_LABELS[verdict as AnnotationVerdict] ?? verdict} + + ) : null; + })} +
+ + )} +
+ + +
-

+ + {expanded && ( + <> +

Human assessment of this enrollment's analysis — confirmed root causes and corrections feed rule quality.

@@ -274,6 +315,8 @@ export default function SessionAnnotationsCard({

No annotations for this session.

)}
+ + )}
); }