From 2d876bfb8f36ec0605fbe142b4b3653d68d588b7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 11:52:38 +0000 Subject: [PATCH] feat(ui): ReasoningContent + compare ModelSelector + CreateProjectModal - ReasoningContent: antd Button + @ant-design BulbOutlined/Down/Right \u2192 shadcn Button variant=ghost + lucide Lightbulb/Chevron. Code blocks use semantic bg-muted; Markdown renderer unchanged. - compareUI/ModelSelector: antd Select + @tremor TextInput \u2192 shadcn Select + Input. 'Add custom model' option triggers inline input with Enter-to-commit and blur-to-commit. - CreateProjectModal: antd Modal/Typography/Button + @ant-design FolderAddOutlined \u2192 shadcn Dialog + Button + lucide FolderPlus. Inner ProjectBaseForm (antd Form) is preserved. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../ProjectModals/CreateProjectModal.tsx | 60 ++++++++++--------- .../playground/chat_ui/ReasoningContent.tsx | 31 ++++++---- .../compareUI/components/ModelSelector.tsx | 55 +++++++++++------ 3 files changed, 90 insertions(+), 56 deletions(-) diff --git a/ui/litellm-dashboard/src/components/Projects/ProjectModals/CreateProjectModal.tsx b/ui/litellm-dashboard/src/components/Projects/ProjectModals/CreateProjectModal.tsx index bbf56e4930a..000a722a434 100644 --- a/ui/litellm-dashboard/src/components/Projects/ProjectModals/CreateProjectModal.tsx +++ b/ui/litellm-dashboard/src/components/Projects/ProjectModals/CreateProjectModal.tsx @@ -1,5 +1,13 @@ -import { Modal, Form, Button, Typography } from "antd"; -import { FolderAddOutlined } from "@ant-design/icons"; +import { FolderPlus } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { Form } from "antd"; import MessageManager from "@/components/molecules/message_manager"; import { useCreateProject, @@ -52,32 +60,30 @@ export function CreateProjectModal({ }; return ( - - Create New Project - - } + - Cancel - , - , - ]} + onOpenChange={(o) => (!o ? handleCancel() : undefined)} > - - + + + + Create New Project + + + + + + + + + ); } diff --git a/ui/litellm-dashboard/src/components/playground/chat_ui/ReasoningContent.tsx b/ui/litellm-dashboard/src/components/playground/chat_ui/ReasoningContent.tsx index 133569cc2ed..0be1a33305a 100644 --- a/ui/litellm-dashboard/src/components/playground/chat_ui/ReasoningContent.tsx +++ b/ui/litellm-dashboard/src/components/playground/chat_ui/ReasoningContent.tsx @@ -1,15 +1,17 @@ import React, { useState } from "react"; -import { Button } from "antd"; +import { Button } from "@/components/ui/button"; import ReactMarkdown from "react-markdown"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { coy } from "react-syntax-highlighter/dist/esm/styles/prism"; -import { DownOutlined, RightOutlined, BulbOutlined } from "@ant-design/icons"; +import { ChevronDown, ChevronRight, Lightbulb } from "lucide-react"; interface ReasoningContentProps { reasoningContent: string; } -const ReasoningContent: React.FC = ({ reasoningContent }) => { +const ReasoningContent: React.FC = ({ + reasoningContent, +}) => { const [isExpanded, setIsExpanded] = useState(true); if (!reasoningContent) return null; @@ -17,32 +19,38 @@ const ReasoningContent: React.FC = ({ reasoningContent }) return (
{isExpanded && ( -
+
& { inline?: boolean; + // eslint-disable-next-line @typescript-eslint/no-explicit-any node?: any; }) { const match = /language-(\w+)/.exec(className || ""); return !inline && match ? ( = ({ reasoningContent }) {String(children).replace(/\n$/, "")} ) : ( - + {children} ); diff --git a/ui/litellm-dashboard/src/components/playground/compareUI/components/ModelSelector.tsx b/ui/litellm-dashboard/src/components/playground/compareUI/components/ModelSelector.tsx index ff7fe18ade2..c6d9d5f45c5 100644 --- a/ui/litellm-dashboard/src/components/playground/compareUI/components/ModelSelector.tsx +++ b/ui/litellm-dashboard/src/components/playground/compareUI/components/ModelSelector.tsx @@ -1,6 +1,13 @@ import React, { useMemo, useState } from "react"; -import { Select } from "antd"; -import { TextInput } from "@tremor/react"; +import { Input } from "@/components/ui/input"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; + interface ModelSelectorProps { value: string; onChange: (value: string) => void; @@ -8,7 +15,14 @@ interface ModelSelectorProps { loading?: boolean; disabled?: boolean; } -export function ModelSelector({ value, onChange, models, loading, disabled }: ModelSelectorProps) { + +export function ModelSelector({ + value, + onChange, + models, + loading, + disabled, +}: ModelSelectorProps) { const [isAddingCustom, setIsAddingCustom] = useState(false); const [customValue, setCustomValue] = useState(""); @@ -48,31 +62,34 @@ export function ModelSelector({ value, onChange, models, loading, disabled }: Mo setIsAddingCustom(false); setCustomValue(""); }; + return (
- + {isAddingCustom && ( - setCustomValue(e.target.value)} onKeyDown={(event) => { if (event.key === "Enter") { event.preventDefault();