From 64d6a41ae024ed17e4f181905d776d434512ecbf Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 11:40:11 +0000 Subject: [PATCH] feat(ui): prompt editor + Fallbacks modal batch to shadcn - AddFallbacksModal: antd Modal \u2192 shadcn Dialog with indigo-tinted icon header. - VariableInput: antd Input \u2192 shadcn Input (h-8). text-gray-600 \u2192 text-muted-foreground. - MessageList: antd Spin + LoadingOutlined \u2192 lucide Loader2 spin. - PublishModal: @tremor Button + antd Modal/Input \u2192 shadcn Dialog + Button + Input with keydown-to-submit. - ToolsCard: @tremor Card/Text \u2192 shadcn Card + plain span; TrashIcon \u2192 lucide Trash. Text-blue-600 \u2192 text-primary. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../Fallbacks/AddFallbacksModal.tsx | 52 +++++------- .../prompt_editor_view/PublishModal.tsx | 80 ++++++++++++------- .../prompts/prompt_editor_view/ToolsCard.tsx | 29 ++++--- .../conversation_panel/MessageList.tsx | 10 +-- .../conversation_panel/VariableInput.tsx | 15 ++-- 5 files changed, 100 insertions(+), 86 deletions(-) diff --git a/ui/litellm-dashboard/src/components/Settings/RouterSettings/Fallbacks/AddFallbacksModal.tsx b/ui/litellm-dashboard/src/components/Settings/RouterSettings/Fallbacks/AddFallbacksModal.tsx index 5048c99d817..0b43c4aa5c5 100644 --- a/ui/litellm-dashboard/src/components/Settings/RouterSettings/Fallbacks/AddFallbacksModal.tsx +++ b/ui/litellm-dashboard/src/components/Settings/RouterSettings/Fallbacks/AddFallbacksModal.tsx @@ -1,9 +1,9 @@ -/** - * Modal wrapper for the fallback selection form - * Handles modal visibility and layout, but delegates content to children - */ - -import { Modal } from "antd"; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; import { ArrowRight } from "lucide-react"; import React from "react"; @@ -19,34 +19,26 @@ export function AddFallbacksModal({ children, }: AddFallbacksModalProps) { return ( - -
-
- + (!o ? onCancel() : undefined)}> + + +
+
+
-

Configure Model Fallbacks

-

- Manage multiple fallback chains for different models (up to 5 groups at a time) + + Configure Model Fallbacks + +

+ Manage multiple fallback chains for different models (up to 5 + groups at a time)

-
- } - open={open} - width={900} - footer={null} - onCancel={onCancel} - maskClosable={false} - className="top-8" - styles={{ - body: { padding: "24px" }, - header: { padding: "24px 24px 0 24px", border: "none" }, - }} - > -
{children}
- + +
{children}
+ + ); } diff --git a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/PublishModal.tsx b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/PublishModal.tsx index 411a463c45c..4ca84f8561f 100644 --- a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/PublishModal.tsx +++ b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/PublishModal.tsx @@ -1,6 +1,13 @@ import React from "react"; -import { Button as TremorButton, Text } from "@tremor/react"; -import { Input, Modal } from "antd"; +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; interface PublishModalProps { visible: boolean; @@ -20,37 +27,50 @@ const PublishModal: React.FC = ({ onCancel, }) => { return ( - - - Cancel - - - Publish - -
- ]} + onOpenChange={(open) => (!open ? onCancel() : undefined)} > -
- Name - onNameChange(e.target.value)} - placeholder="Enter prompt name" - onPressEnter={onPublish} - autoFocus - /> - - Published prompts can be used in API calls and are versioned for easy tracking. - -
-
+ + + Publish Prompt + +
+ + onNameChange(e.target.value)} + placeholder="Enter prompt name" + onKeyDown={(e) => { + if (e.key === "Enter") { + e.preventDefault(); + onPublish(); + } + }} + autoFocus + /> +

+ Published prompts can be used in API calls and are versioned for + easy tracking. +

+
+ + + + +
+ ); }; export default PublishModal; - diff --git a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/ToolsCard.tsx b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/ToolsCard.tsx index 53444c5d8e9..5bbfd5e4135 100644 --- a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/ToolsCard.tsx +++ b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/ToolsCard.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { Card, Text } from "@tremor/react"; -import { PlusIcon, TrashIcon } from "lucide-react"; +import { Card } from "@/components/ui/card"; +import { Plus, Trash } from "lucide-react"; import { Tool } from "./types"; interface ToolsCardProps { @@ -19,40 +19,46 @@ const ToolsCard: React.FC = ({ return (
- Tools + Tools
{tools.length === 0 ? ( - No tools added +

No tools added

) : (
{tools.map((tool, index) => (
{tool.name}
-
{tool.description}
+
+ {tool.description} +
@@ -64,4 +70,3 @@ const ToolsCard: React.FC = ({ }; export default ToolsCard; - diff --git a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/MessageList.tsx b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/MessageList.tsx index 5d7eef456b3..6c88dd069a5 100644 --- a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/MessageList.tsx +++ b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/MessageList.tsx @@ -1,6 +1,5 @@ import React from "react"; -import { LoadingOutlined } from "@ant-design/icons"; -import { Spin } from "antd"; +import { Loader2 } from "lucide-react"; import EmptyState from "./EmptyState"; import MessageBubble from "./MessageBubble"; import { Message } from "./types"; @@ -18,8 +17,6 @@ const MessageList: React.FC = ({ hasVariables, messagesEndRef, }) => { - const antIcon = ; - return (
{messages.length === 0 && } @@ -30,13 +27,12 @@ const MessageList: React.FC = ({ {isLoading && (
- +
)} -
+
); }; export default MessageList; - diff --git a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/VariableInput.tsx b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/VariableInput.tsx index a8e07bfdf57..0de7ed3fd26 100644 --- a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/VariableInput.tsx +++ b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/VariableInput.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Input } from "antd"; +import { Input } from "@/components/ui/input"; interface VariableInputProps { extractedVariables: string[]; @@ -17,21 +17,23 @@ const VariableInput: React.FC = ({ } return ( -
-

+
+

Fill in template variables to start testing

{extractedVariables.map((varName) => (
-
))} @@ -41,4 +43,3 @@ const VariableInput: React.FC = ({ }; export default VariableInput; -