Skip to content

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

fix(ui): preserve query params in ResizableImage custom loader (#12386)

MatrixA180c1fef8143
diff --git a/web/src/components/ui/resizable-image.tsx b/web/src/components/ui/resizable-image.tsx
index b40be3769d..ca536b88e7 100644
--- a/web/src/components/ui/resizable-image.tsx
+++ b/web/src/components/ui/resizable-image.tsx
@@ -23,7 +23,9 @@ const customLoader = ({
width: number;
quality?: number;
}) => {
- return src + (width && quality ? `?w=${width}&q=${quality || 75}` : "");
+ if (!width || !quality) return src;
+ const separator = src.includes("?") ? "&" : "?";
+ return `${src}${separator}w=${width}&q=${quality || 75}`;
};
const ImageErrorDisplay = ({