Skip to content

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

fix(prompt-ui): state stuck in showing prompt diff cycle (#6258)

marliessophie4048e807afab
diff --git a/web/src/components/trace/TraceTimelineView.tsx b/web/src/components/trace/TraceTimelineView.tsx
index 377b66dd22..416c6c4bfe 100644
--- a/web/src/components/trace/TraceTimelineView.tsx
+++ b/web/src/components/trace/TraceTimelineView.tsx
@@ -515,7 +515,8 @@ export function TraceTimelineView({
// Use scrollWidth which accounts for all content, including overflow
const scrollWidth = timelineContentRef.current.scrollWidth;
- const newWidth = Math.max(SCALE_WIDTH, scrollWidth);
+ // Add 20px to account for scrollbar padding
+ const newWidth = Math.max(SCALE_WIDTH, scrollWidth + 20);
if (newWidth !== contentWidth) {
setContentWidth(newWidth);
}
diff --git a/web/src/features/prompts/components/PromptVersionDiffDialog.tsx b/web/src/features/prompts/components/PromptVersionDiffDialog.tsx
index 4224ebbc44..e558be5d3e 100644
--- a/web/src/features/prompts/components/PromptVersionDiffDialog.tsx
+++ b/web/src/features/prompts/components/PromptVersionDiffDialog.tsx
@@ -49,7 +49,12 @@ export const PromptVersionDiffDialog: React.FC<PromptVersionDiffDialogProps> = (
<DialogContent
className="max-w-screen-xl"
+ // prevent event bubbling up and triggering the row's click handler
onClick={(event) => event.stopPropagation()}
+ onPointerDownOutside={(e) => {
+ setIsOpen(false);
+ e.stopPropagation();
+ }}
>
<DialogHeader>
<DialogTitle>