Skip to content

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

fix(ui): encode promptName when in url (#1498)

Marc Klingend282da61860c
diff --git a/web/src/features/prompts/components/prompt-detail.tsx b/web/src/features/prompts/components/prompt-detail.tsx
index cedae66891..a34d9fc07a 100644
--- a/web/src/features/prompts/components/prompt-detail.tsx
+++ b/web/src/features/prompts/components/prompt-detail.tsx
@@ -56,7 +56,7 @@ export const PromptDetail = (props: PromptDetailProps) => {
},
{
name: prompt.name,
- href: `/project/${props.projectId}/prompts/${props.promptName}`,
+ href: `/project/${props.projectId}/prompts/${encodeURIComponent(props.promptName)}`,
},
{ name: `Version ${prompt.version}` },
]}
diff --git a/web/src/pages/project/[projectId]/prompts/[promptName]/index.tsx b/web/src/pages/project/[projectId]/prompts/[promptName]/index.tsx
index b6558e289c..c8d7a033e6 100644
--- a/web/src/pages/project/[projectId]/prompts/[promptName]/index.tsx
+++ b/web/src/pages/project/[projectId]/prompts/[promptName]/index.tsx
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
export default function PromptDetailPage() {
const router = useRouter();
const projectId = router.query.projectId as string;
- const promptName = router.query.promptName as string;
+ const promptName = decodeURIComponent(router.query.promptName as string);
return <PromptDetail projectId={projectId} promptName={promptName} />;
}