Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(web): status messages match the output block, warning uses the soft yellow set (#18319)

Trang Nguyen0f94c4a281a6
diff --git a/web/src/components/ui/PrettyJsonView.tsx b/web/src/components/ui/PrettyJsonView.tsx
index b4f66e0449..155d74562b 100644
--- a/web/src/components/ui/PrettyJsonView.tsx
+++ b/web/src/components/ui/PrettyJsonView.tsx
@@ -97,18 +97,19 @@ const PRETTY_JSON_VIEW_TONE_CLASSES: Record<
cell: "border-dark-red/20 dark:border-dark-red/15",
},
warning: {
- container: "border-dark-yellow/40 bg-light-yellow/80",
- row: "hover:bg-light-yellow/80",
- cell: "border-dark-yellow/20",
+ container:
+ "border-yellow-100 bg-yellow-50 text-yellow-900 dark:border-dark-yellow/20 dark:bg-light-yellow/35 dark:text-yellow-300",
+ row: "hover:bg-light-yellow/50 dark:hover:bg-light-yellow/35",
+ cell: "border-dark-yellow/20 dark:border-dark-yellow/15",
},
muted: {
- container: "border-muted-foreground/15 bg-muted/30 text-muted-foreground",
- row: "hover:bg-muted/30",
- cell: "border-muted-foreground/15",
+ container: "border-transparent bg-surface-output text-foreground-secondary",
+ row: "hover:bg-muted",
+ cell: "border-border",
},
neutral: {
- container: "bg-card",
- row: "hover:bg-card",
+ container: "border-transparent bg-surface-output text-foreground-secondary",
+ row: "hover:bg-muted",
cell: "border-border",
},
};
diff --git a/web/src/features/traces/components/IOPreview/IOPreviewJSON.tsx b/web/src/features/traces/components/IOPreview/IOPreviewJSON.tsx
index bbc64b225b..7ff077beb5 100644
--- a/web/src/features/traces/components/IOPreview/IOPreviewJSON.tsx
+++ b/web/src/features/traces/components/IOPreview/IOPreviewJSON.tsx
@@ -48,15 +48,17 @@ import {
// `needsVirtualization` note below.
const VIRTUALIZATION_THRESHOLD = JSON_VIEW_RENDER_ROW_LIMIT;
-const STATUS_MESSAGE_BACKGROUND_COLORS: Record<
- ObservationStatusMessage["level"],
- string
-> = {
- ERROR: "var(--light-red)",
- WARNING: "var(--light-yellow)",
- DEBUG: "hsl(var(--muted) / 0.3)",
- DEFAULT: "hsl(var(--card))",
-};
+// Light values are Tailwind red-50 / yellow-50, matching StatusMessageSection.
+function statusMessageBackgroundColor(
+ level: ObservationStatusMessage["level"],
+ isDark: boolean,
+) {
+ if (level === "ERROR")
+ return isDark ? "var(--light-red)" : "oklch(97.1% 0.013 17.38)";
+ if (level === "WARNING")
+ return isDark ? "var(--light-yellow)" : "oklch(98.7% 0.026 102.212)";
+ return "hsl(var(--surface-output))";
+}
/**
* Decode a field's \uXXXX escapes, but only when it fits under the decoder's
@@ -499,7 +501,7 @@ function IOPreviewJSONInner({
key: "status-message",
title: statusPresentation.title,
data: parseStructuredStatusMessage(status.message) ?? status.message,
- backgroundColor: STATUS_MESSAGE_BACKGROUND_COLORS[status.level],
+ backgroundColor: statusMessageBackgroundColor(status.level, isDark),
minHeight: "4px",
});
}
@@ -586,6 +588,7 @@ function IOPreviewJSONInner({
}
return result;
}, [
+ isDark,
showInput,
showOutput,
status,
diff --git a/web/src/features/traces/components/IOPreview/components/StatusMessageSection.tsx b/web/src/features/traces/components/IOPreview/components/StatusMessageSection.tsx
index 134a491890..dc34bfeffa 100644
--- a/web/src/features/traces/components/IOPreview/components/StatusMessageSection.tsx
+++ b/web/src/features/traces/components/IOPreview/components/StatusMessageSection.tsx
@@ -15,9 +15,10 @@ const STATUS_MESSAGE_CLASS_NAMES: Record<
> = {
ERROR:
"border-red-100 bg-red-50 text-red-900 dark:border-dark-red/20 dark:bg-light-red/35 dark:text-red-300",
- WARNING: "border-dark-yellow/40 bg-light-yellow/80",
- DEBUG: "border-muted-foreground/15 bg-muted/30 text-muted-foreground",
- DEFAULT: "bg-card",
+ WARNING:
+ "border-yellow-100 bg-yellow-50 text-yellow-900 dark:border-dark-yellow/20 dark:bg-light-yellow/35 dark:text-yellow-300",
+ DEBUG: "bg-surface-output text-foreground-secondary",
+ DEFAULT: "bg-surface-output text-foreground-secondary",
};
export function StatusMessageSection({
@@ -54,7 +55,8 @@ export function StatusMessageSection({
/>
<div
className={cn(
- "ph-no-capture rounded-sm border p-3 text-base wrap-break-word whitespace-pre-wrap",
+ "ph-no-capture rounded-md px-3 py-2 text-base wrap-break-word whitespace-pre-wrap",
+ (status.level === "ERROR" || status.level === "WARNING") && "border",
STATUS_MESSAGE_CLASS_NAMES[status.level],
)}
>