From 0fba22151a8682a1c3fc8f824f930d99a05a7dd5 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Tue, 4 Aug 2026 15:07:39 -0700 Subject: [PATCH] refactor(ui): delete the discarded expressions, not just their bindings Dropping the binding but keeping the initializer left two statements that compute a value and throw it away: a ternary in ChatUI returning rawSelected from both branches under a comment about resolving server IDs, and an isAdminRole call in the prompts panel that also kept its import alive. Both computations were already unreachable in effect; remove them whole. --- .../app/(dashboard)/playground/components/chat_ui/ChatUI.tsx | 2 -- .../src/app/(dashboard)/prompts/_components/index.tsx | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/chat_ui/ChatUI.tsx b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/chat_ui/ChatUI.tsx index 79368886c8b..57ff7906eda 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/playground/components/chat_ui/ChatUI.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/playground/components/chat_ui/ChatUI.tsx @@ -589,8 +589,6 @@ const ChatUI: React.FC = ({ NotificationsManager.fromBackend("Please select an MCP server to test"); return; } - // Resolve the real server ID (toolsets use toolset: prefix) - rawSelected.startsWith("toolset:") ? rawSelected : rawSelected; if (!selectedMCPDirectTool) { NotificationsManager.fromBackend("Please select an MCP tool to call"); return; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/index.tsx b/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/index.tsx index c885fdcbf35..f9bba3ce661 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/index.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/prompts/_components/index.tsx @@ -7,7 +7,7 @@ import PromptInfoView from "./prompt_info"; import AddPromptForm from "./add_prompt_form"; import PromptEditorView from "./prompt_editor_view"; import NotificationsManager from "@/components/molecules/notifications_manager"; -import { isAdminRole, isProxyAdminRole } from "@/utils/roles"; +import { isProxyAdminRole } from "@/utils/roles"; import { Button } from "@/components/ui/button"; import { AlertDialog, @@ -47,7 +47,6 @@ const PromptsPanel: React.FC = ({ accessToken, userRole }) => { const [isDeleting, setIsDeleting] = useState(false); const [promptToDelete, setPromptToDelete] = useState<{ id: string; name: string } | null>(null); - userRole ? isAdminRole(userRole) : false; // Admin Viewer follows the read-parity rule: see prompts, no writes. const canModify = userRole ? isProxyAdminRole(userRole) : false;