From 3f82cfaee8c9133ce78f2ab2bfd34b1f9b8ff4d6 Mon Sep 17 00:00:00 2001 From: kerry Date: Sat, 10 Oct 2026 04:11:50 +0000 Subject: [PATCH 1/7] fix(ui): render the System One JSON editor with the stock One Dark theme Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../components/systemOneUI/JsonEditor.tsx | 68 ++++++------------- .../systemOneUI/lib/rootBlocks.test.ts | 53 --------------- .../components/systemOneUI/lib/rootBlocks.ts | 52 -------------- 3 files changed, 21 insertions(+), 152 deletions(-) delete mode 100644 ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/lib/rootBlocks.test.ts diff --git a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/JsonEditor.tsx b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/JsonEditor.tsx index fce617b4c476..d7608e4ce436 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/JsonEditor.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/systemOneUI/JsonEditor.tsx @@ -1,11 +1,11 @@ import { Badge } from "@/components/ui/badge"; import { cn } from "@/lib/cva.config"; import { CircleAlert, CircleCheck, TriangleAlert } from "lucide-react"; -import { useId, useMemo, useRef } from "react"; +import { useId, useRef } from "react"; import { createElement, PrismLight as SyntaxHighlighter } from "react-syntax-highlighter"; import type { SyntaxHighlighterProps } from "react-syntax-highlighter"; import json from "react-syntax-highlighter/dist/esm/languages/prism/json"; -import { findRootBlocks, ROOT_BLOCK_STYLES, type RootBlock } from "./lib/rootBlocks"; +import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism"; import type { SystemOnePayloadValidation } from "./lib/validatePayload"; SyntaxHighlighter.registerLanguage("json", json); @@ -16,14 +16,7 @@ type LineRendererProps = Parameters { - const lineElement = { node: row, stylesheet, useInlineStyles, key: line }; - const block = rootBlocks.find(({ startLine, endLine }) => line >= startLine && line <= endLine); - return ( -
- - {line + 1} - - - {createElement(lineElement)} - -
- ); - }); - }; +function LineRows({ rows, stylesheet, useInlineStyles }: LineRendererProps) { + return rows.map((row, line) => { + const lineElement = { node: row, stylesheet, useInlineStyles, key: line }; + return ( +
+ {line + 1} + {createElement(lineElement)} +
+ ); + }); } export default function JsonEditor({ value, onChange, validation }: JsonEditorProps) { const issuesId = useId(); const highlightRef = useRef(null); - const renderer = useMemo(() => renderLines(findRootBlocks(value)), [value]); const lineCount = value.split("\n").length; const hasErrors = !validation.isValid; return (
@@ -122,19 +97,18 @@ export default function JsonEditor({ value, onChange, validation }: JsonEditorPr
-