Skip to content

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

fix(web): preserve casing of prompt version labels in UI (#15185)

Caleb20c6c17bce06
diff --git a/web/src/components/TruncatedLabels.tsx b/web/src/components/TruncatedLabels.tsx
index 3193a63c8e..73392b12cb 100644
--- a/web/src/components/TruncatedLabels.tsx
+++ b/web/src/components/TruncatedLabels.tsx
@@ -66,6 +66,7 @@ export function TruncatedLabels({
key={label}
className={cn("break-all sm:break-normal", badgeClassName)}
isLive={label === PRODUCTION_LABEL}
+ preserveCase
/>
),
)}
@@ -104,6 +105,7 @@ export function TruncatedLabels({
badgeClassName,
)}
isLive={label === PRODUCTION_LABEL}
+ preserveCase
/>
),
)}
diff --git a/web/src/components/layouts/status-badge.tsx b/web/src/components/layouts/status-badge.tsx
index 5d56dfbe0c..c70e03e733 100644
--- a/web/src/components/layouts/status-badge.tsx
+++ b/web/src/components/layouts/status-badge.tsx
@@ -20,12 +20,14 @@ export const StatusBadge = ({
isLive = true,
className,
showText = true,
+ preserveCase = false,
children,
}: {
type: Status | (string & {});
isLive?: boolean;
className?: string;
showText?: boolean;
+ preserveCase?: boolean;
children?: ReactNode;
}) => {
let badgeColor = "bg-muted-gray text-primary";
@@ -85,7 +87,11 @@ export const StatusBadge = ({
></span>
</span>
)}
- {showText && type && <span>{type[0].toUpperCase() + type.slice(1)}</span>}
+ {showText && type && (
+ <span>
+ {preserveCase ? type : type[0].toUpperCase() + type.slice(1)}
+ </span>
+ )}
{children}
</div>
);
diff --git a/web/src/features/prompts/components/ProtectedLabelsSettings.tsx b/web/src/features/prompts/components/ProtectedLabelsSettings.tsx
index cf91d3da52..e18b07bec1 100644
--- a/web/src/features/prompts/components/ProtectedLabelsSettings.tsx
+++ b/web/src/features/prompts/components/ProtectedLabelsSettings.tsx
@@ -122,6 +122,7 @@ export default function ProtectedLabelsSettings({
key={label}
className="break-all sm:break-normal"
isLive={label === PRODUCTION_LABEL}
+ preserveCase
>
{hasAccess && hasEntitlement && (
<Button