Skip to content

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

fix(ui): scroll dataset item editor on large inputs (#2027)

Marc Klingen2c55cd842ab7
diff --git a/web/src/components/json-editor.tsx b/web/src/components/json-editor.tsx
index e011ccd9e2..b84d9e38d3 100644
--- a/web/src/components/json-editor.tsx
+++ b/web/src/components/json-editor.tsx
@@ -1,6 +1,7 @@
import CodeMirror, { EditorView } from "@uiw/react-codemirror";
import { githubLight } from "@uiw/codemirror-theme-github";
import { json } from "@codemirror/lang-json";
+import { cn } from "@/src/utils/tailwind";
// todo: add json linting
@@ -9,11 +10,13 @@ export function JsonEditor({
onChange,
editable = true,
lineWrapping = true,
+ className,
}: {
defaultValue: string;
onChange?: (value: string) => void;
editable?: boolean;
lineWrapping?: boolean;
+ className?: string;
}) {
return (
<CodeMirror
@@ -26,7 +29,7 @@ export function JsonEditor({
extensions={[json(), ...(lineWrapping ? [EditorView.lineWrapping] : [])]}
defaultValue={defaultValue}
onChange={onChange}
- className="overflow-hidden rounded-md border"
+ className={cn("overflow-hidden rounded-md border", className)}
editable={editable}
/>
);
diff --git a/web/src/features/datasets/components/EditDatasetItem.tsx b/web/src/features/datasets/components/EditDatasetItem.tsx
index ad6d37d471..9e789adb16 100644
--- a/web/src/features/datasets/components/EditDatasetItem.tsx
+++ b/web/src/features/datasets/components/EditDatasetItem.tsx
@@ -150,6 +150,7 @@ export const EditDatasetItem = ({
field.onChange(v);
}}
editable={hasAccess}
+ className="max-h-[600px] overflow-y-auto"
/>
</FormControl>
<FormMessage />
@@ -170,6 +171,7 @@ export const EditDatasetItem = ({
field.onChange(v);
}}
editable={hasAccess}
+ className="max-h-[600px] overflow-y-auto"
/>
</FormControl>
<FormMessage />
@@ -191,6 +193,7 @@ export const EditDatasetItem = ({
field.onChange(v);
}}
editable={hasAccess}
+ className="max-h-[300px] overflow-y-auto"
/>
</FormControl>
<FormMessage />