Skip to content

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

style(prompts): display all prompt tags on versions, not just on hover (#3422)

marliessophiec483293b10b5
diff --git a/web/src/features/prompts/components/prompt-history.tsx b/web/src/features/prompts/components/prompt-history.tsx
index 1547e4b3cd..d6376d4deb 100644
--- a/web/src/features/prompts/components/prompt-history.tsx
+++ b/web/src/features/prompts/components/prompt-history.tsx
@@ -37,12 +37,18 @@ const PromptHistoryTraceNode = (props: {
: a.localeCompare(b),
)
.map((label) => {
- return <StatusBadge type={label} key={label} className="h-6" />;
+ return (
+ <StatusBadge
+ type={label}
+ key={label}
+ className="break-all sm:break-normal"
+ />
+ );
});
return (
<div
- className={`group mb-2 flex cursor-pointer flex-col gap-1 rounded-sm p-2 hover:bg-primary-foreground ${
+ className={`group mb-2 flex w-full cursor-pointer flex-col gap-1 rounded-sm p-2 hover:bg-primary-foreground ${
props.currentPromptVersion === prompt.version ? "bg-muted" : ""
}`}
onMouseEnter={() => setIsHovered(true)}
@@ -55,21 +61,27 @@ const PromptHistoryTraceNode = (props: {
: props.setCurrentPromptVersion(prompt.version);
}}
>
- <div className="grid grid-cols-[auto,1fr] items-start gap-2">
- <div
- className={`grid grid-cols-[auto,1fr] items-start ${isHovered ? "h-full" : "h-7"}`}
- >
- <span className="flex h-6 text-nowrap rounded-sm bg-input p-1 text-xs">
- Version {prompt.version}
- </span>
- {Boolean(prompt.labels.length) && (
- <div className="ml-2 flex h-full flex-wrap gap-1 overflow-auto">
- {badges}
- </div>
- )}
+ <div className="flex h-full min-h-6 flex-wrap gap-1">
+ <span className="text-nowrap rounded-sm bg-input p-1 text-xs">
+ Version {prompt.version}
+ </span>
+ {badges}
+ </div>
+ <div className="grid w-full grid-cols-1 items-start justify-between gap-1 md:grid-cols-[1fr,auto]">
+ <div>
+ <div className="flex gap-2">
+ <span className="text-xs text-muted-foreground">
+ {prompt.createdAt.toLocaleString()}
+ </span>
+ </div>
+ <div className="flex gap-2">
+ <span className="text-xs text-muted-foreground">
+ by {prompt.creator || prompt.createdBy}
+ </span>
+ </div>
</div>
{isHovered && (
- <div className="flex flex-row space-x-1">
+ <div className="flex flex-row justify-end space-x-1">
<SetPromptVersionLabels
prompt={prompt}
isOpen={isLabelPopoverOpen}
@@ -111,16 +123,6 @@ const PromptHistoryTraceNode = (props: {
</div>
)}
</div>
- <div className="flex gap-2">
- <span className="text-xs text-muted-foreground">
- {prompt.createdAt.toLocaleString()}
- </span>
- </div>
- <div className="flex gap-2">
- <span className="text-xs text-muted-foreground">
- by {prompt.creator || prompt.createdBy}
- </span>
- </div>
</div>
);
};
@@ -134,7 +136,7 @@ export const PromptHistoryNode = (props: {
const router = useRouter();
const projectId = router.query.projectId as string;
return (
- <div className="flex-1">
+ <div className="w-full flex-1">
{props.prompts.map((prompt, index) => (
<PromptHistoryTraceNode
key={prompt.id}