From 7c9cd2b3dfdaacc0fb9e4e7daed75bdd327a61c1 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Thu, 13 Aug 2026 15:21:54 -0700 Subject: [PATCH] refactor(ui): migrate guardrails-monitor to shadcn Replaces the antd Button, Row, Col, Spin and Typography usage in GuardrailsOverview with the shadcn button, a CSS grid and the house loading wrapper, and swaps the ant-design icons for lucide equivalents that the already-migrated GuardrailDetail sibling uses. The busy state keeps the aria-busy attribute the antd Spin exposed, so the loading contract is unchanged for assistive tech. The route's other analyzer-listed file, GuardrailsMonitorView, keeps its DateRangePickerValue type import because the shared AdvancedDatePicker prop contract requires it, so there is nothing to migrate there. Retires the file's now unused no-restricted-imports suppression --- ui/litellm-dashboard/eslint-suppressions.json | 3 - .../_components/GuardrailsOverview.tsx | 84 +++++++++---------- 2 files changed, 40 insertions(+), 47 deletions(-) diff --git a/ui/litellm-dashboard/eslint-suppressions.json b/ui/litellm-dashboard/eslint-suppressions.json index d7f71a5840d..5df4a5af0ae 100644 --- a/ui/litellm-dashboard/eslint-suppressions.json +++ b/ui/litellm-dashboard/eslint-suppressions.json @@ -321,9 +321,6 @@ "src/app/(dashboard)/guardrails-monitor/_components/GuardrailsOverview.tsx": { "no-nested-ternary": { "count": 5 - }, - "no-restricted-imports": { - "count": 1 } }, "src/app/(dashboard)/guardrails/_components/GuardrailTestPanel.tsx": { diff --git a/ui/litellm-dashboard/src/app/(dashboard)/guardrails-monitor/_components/GuardrailsOverview.tsx b/ui/litellm-dashboard/src/app/(dashboard)/guardrails-monitor/_components/GuardrailsOverview.tsx index 8d45b4a4ee8..3d91fc1b9b6 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/guardrails-monitor/_components/GuardrailsOverview.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/guardrails-monitor/_components/GuardrailsOverview.tsx @@ -1,11 +1,12 @@ -import { DownloadOutlined, RiseOutlined, SafetyOutlined, SettingOutlined, WarningOutlined } from "@ant-design/icons"; import { useQuery } from "@tanstack/react-query"; import type { ColumnDef, OnChangeFn, SortingState } from "@tanstack/react-table"; -import { Button, Col, Row, Spin, Typography } from "antd"; +import { Download, Settings, Shield, TrendingUp, TriangleAlert } from "lucide-react"; import React, { useMemo, useState } from "react"; import { DataTable, DataTableSortHeader } from "@/components/shared/DataTable"; import { getGuardrailsUsageOverview } from "@/components/networking"; import { type PerformanceRow } from "@/components/GuardrailsMonitor/mockData"; +import { Button } from "@/components/ui/button"; +import { UiLoadingSpinner } from "@/components/ui/ui-loading-spinner"; import { EvaluationSettingsModal } from "./EvaluationSettingsModal"; import { MetricCard } from "@/components/GuardrailsMonitor/MetricCard"; import { ScoreChart } from "./ScoreChart"; @@ -197,51 +198,42 @@ export function GuardrailsOverview({
- +

Guardrails Monitor

Monitor guardrail performance across all requests

-
- - - - - - } - /> - - - } - /> - - - 150 ? "text-red-600" : metrics.avgLatency > 50 ? "text-amber-600" : "text-green-600" - } - /> - - - - - +
+ + } + /> + } + /> + 150 ? "text-red-600" : metrics.avgLatency > 50 ? "text-amber-600" : "text-green-600" + } + /> + +
@@ -250,7 +242,11 @@ export function GuardrailsOverview({
{(isLoading || error) && (
- {isLoading && } + {isLoading && ( + + + + )} {error && Failed to load data. Try again.}
)} @@ -270,20 +266,20 @@ export function GuardrailsOverview({ toolbar={() => (
- - Guardrail Performance - +
Guardrail Performance

Click a guardrail to view details, logs, and configuration

)}