🪢 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
chore(dialog-ui): prevent dialog propagation on enter space; add breadcrumb to dashboards detail page (#12236)
marliessophie55b1c32cd073
diff --git a/web/src/components/ui/dialog.tsx b/web/src/components/ui/dialog.tsxindex 7fa8b82f49..10f78e7b31 100644--- a/web/src/components/ui/dialog.tsx+++ b/web/src/components/ui/dialog.tsx@@ -51,40 +51,59 @@ const DialogContent = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Content>,React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {closeOnInteractionOutside?: boolean;+ stopPropagationOnEnterSpace?: boolean;} & VariantProps<typeof dialogContentVariants>>((- { className, children, closeOnInteractionOutside = false, size, ...props },+ {+ className,+ children,+ closeOnInteractionOutside = false,+ stopPropagationOnEnterSpace = true,+ size,+ ...props+ },ref,- ) => (- <DialogPortal>- <DialogOverlay />- <DialogPrimitive.Content- ref={ref}- className={cn(dialogContentVariants({ size, className }))}- aria-describedby={undefined}- onPointerDownOutside={(e) => {- if (!closeOnInteractionOutside) {- e.preventDefault();- }- }}- onInteractOutside={(e) => {- if (!closeOnInteractionOutside) {- e.preventDefault();- }- }}- {...props}- >- {children}- <div className="[&:has(.dialog-header)]:hidden [&:not(:has(.dialog-header))]:absolute [&:not(:has(.dialog-header))]:right-3 [&:not(:has(.dialog-header))]:top-3 [&:not(:has(.dialog-header))]:z-20">- <DialogPrimitive.Close className="rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">- <X className="h-4 w-4" />- <span className="sr-only">Close</span>- </DialogPrimitive.Close>- </div>- </DialogPrimitive.Content>- </DialogPortal>- ),+ ) => {+ const handleKeyDown = (e: React.KeyboardEvent) => {+ // Prevent Enter/Space key events from propagating to parent elements+ // This prevents triggering actions like row clicks when submitting forms in dialogs+ if (stopPropagationOnEnterSpace && (e.key === "Enter" || e.key === " ")) {+ e.stopPropagation();+ }+ };++ return (+ <DialogPortal>+ <DialogOverlay />+ <DialogPrimitive.Content+ ref={ref}+ className={cn(dialogContentVariants({ size, className }))}+ aria-describedby={undefined}+ onKeyDown={handleKeyDown}+ onPointerDownOutside={(e) => {+ if (!closeOnInteractionOutside) {+ e.preventDefault();+ }+ }}+ onInteractOutside={(e) => {+ if (!closeOnInteractionOutside) {+ e.preventDefault();+ }+ }}+ {...props}+ >+ {children}+ <div className="[&:has(.dialog-header)]:hidden [&:not(:has(.dialog-header))]:absolute [&:not(:has(.dialog-header))]:right-3 [&:not(:has(.dialog-header))]:top-3 [&:not(:has(.dialog-header))]:z-20">+ <DialogPrimitive.Close className="rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">+ <X className="h-4 w-4" />+ <span className="sr-only">Close</span>+ </DialogPrimitive.Close>+ </div>+ </DialogPrimitive.Content>+ </DialogPortal>+ );+ },);DialogContent.displayName = DialogPrimitive.Content.displayName;diff --git a/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx b/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsxindex 46723c3ec4..7ec916c2dd 100644--- a/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx+++ b/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx@@ -404,6 +404,12 @@ export default function DashboardDetail() {(dashboard.data?.owner === "LANGFUSE"? " (Langfuse Maintained)": ""),+ breadcrumb: [+ {+ name: "Dashboards",+ href: `/project/${projectId}/dashboards`,+ },+ ],help: {description:dashboard.data?.description || "No description available",