🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
refactor(ui): use CodeView for prompt rendering
Marc Klingen509dc92539c1
diff --git a/src/components/layouts/status-badge.tsx b/src/components/layouts/status-badge.tsxindex 7c9b4c4ab8..3bd2ca99ad 100644--- a/src/components/layouts/status-badge.tsx+++ b/src/components/layouts/status-badge.tsx@@ -12,14 +12,14 @@ export const StatusBadge = (props: { className?: string; type: Status }) => {return (<divclassName={cn(- "flex items-center gap-2 rounded-sm px-3",+ "inline-flex items-center gap-2 rounded-sm px-2 py-1 text-xs",statusCategories.active.includes(props.type)? " bg-green-100 text-green-600": "bg-gray-100 text-gray-800",props.className,)}>- <span className="relative flex h-2 w-2 ">+ <span className="relative inline-flex h-2 w-2"><spanclassName={cn("absolute inline-flex h-full w-full rounded-full opacity-75",@@ -37,7 +37,7 @@ export const StatusBadge = (props: { className?: string; type: Status }) => {)}></span></span>- {props.type}+ <span>{props.type}</span></div>);};diff --git a/src/features/prompts/components/new-prompt-button.tsx b/src/features/prompts/components/new-prompt-button.tsxindex dd057f0f5a..2dcbc051cb 100644--- a/src/features/prompts/components/new-prompt-button.tsx+++ b/src/features/prompts/components/new-prompt-button.tsx@@ -210,7 +210,7 @@ export const NewPromptForm = (props: {<FormControl><Textarea{...field}- className="min-h-[150px] flex-1 whitespace-pre-wrap font-mono text-xs"+ className="min-h-[150px] flex-1 font-mono text-xs"/></FormControl><FormMessage />diff --git a/src/features/prompts/components/prompt-detail.tsx b/src/features/prompts/components/prompt-detail.tsxindex 5443663a77..2820f95dd4 100644--- a/src/features/prompts/components/prompt-detail.tsx+++ b/src/features/prompts/components/prompt-detail.tsx@@ -1,6 +1,7 @@import Header from "@/src/components/layouts/header";import { Badge } from "@/src/components/ui/badge";import { Button } from "@/src/components/ui/button";+import { CodeView } from "@/src/components/ui/code";import { DetailPageNav } from "@/src/features/navigate-detail-pages/DetailPageNav";import { CreatePromptDialog } from "@/src/features/prompts/components/new-prompt-button";import { useHasAccess } from "@/src/features/rbac/utils/checkAccess";@@ -66,18 +67,19 @@ export const PromptDetail = (props: PromptDetailProps) => {}/>- <div className="mx-auto w-full rounded-lg border text-base leading-7 text-gray-700">- <div className="border-b px-3 py-1 text-xs font-medium">Prompt</div>- <p className="p-3 text-sm leading-8">{prompt.data.prompt}</p>- </div>- <div className="mx-auto mt-10 w-full rounded-lg border text-base leading-7 text-gray-700">+ <CodeView content={prompt.data.prompt} title="Prompt" />+ <div className="mx-auto mt-5 w-full rounded-lg border text-base leading-7 text-gray-700"><div className="border-b px-3 py-1 text-xs font-medium">Variables</div><div className="flex flex-wrap gap-2 p-3">- {extractedVariables.map((variable) => (- <Badge key={variable} variant="outline">- {variable}- </Badge>- ))}+ {extractedVariables.length > 0 ? (+ extractedVariables.map((variable) => (+ <Badge key={variable} variant="outline">+ {variable}+ </Badge>+ ))+ ) : (+ <span className="text-xs">No variables</span>+ )}</div></div></div>