From 03443590a2e74a4e673646078ede5d77b2c1e04e Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 8 Jul 2026 13:38:22 +1000 Subject: [PATCH] fix(kb-ui): SensitivityBadge tolerates an unset/unknown level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A kb.list row can arrive without a sensitivity (a claim/note, or older data); SENSITIVITY[level] was then undefined and reading .tone crashed the whole object list. Fall back to a neutral badge — never defaulting an unknown value to "Open", which would misstate exposure. (Surfaced building the standalone webapp against a real corpus.) Co-Authored-By: Claude Opus 4.8 (1M context) --- src/_internal.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/_internal.tsx b/src/_internal.tsx index 3da26c1..e6af34a 100644 --- a/src/_internal.tsx +++ b/src/_internal.tsx @@ -117,7 +117,16 @@ const SENSITIVITY: Record = ({ level, className }) => { - const s = SENSITIVITY[level]; + // A row can arrive without a sensitivity (e.g. a claim/note, or older data); + // fall back to a neutral badge rather than crash — and never default an + // unknown value to "Open", which would misstate its exposure. + const s = + SENSITIVITY[level] ?? { + label: level ?? "—", + tone: "bg-muted text-muted-foreground", + icon: null, + title: "Sensitivity not set.", + }; return ( {s.label}