From b599c8bfd41a26e4e8f38cd8f0915f2e048188d6 Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Wed, 15 Apr 2026 10:39:25 -0700 Subject: [PATCH] refactor(ui): reduce Tremor usage in Guardrails Monitor layout Move Guardrails Monitor overview/detail layout wrappers and section heading components to antd/plain Tailwind while keeping the existing Tremor chart and date picker behavior unchanged for a smaller, low-risk migration step. --- .../GuardrailsMonitor/GuardrailDetail.tsx | 21 ++++------ .../GuardrailsMonitor/GuardrailsOverview.tsx | 41 +++++++++---------- .../GuardrailsMonitor/ScoreChart.tsx | 1 + 3 files changed, 30 insertions(+), 33 deletions(-) diff --git a/ui/litellm-dashboard/src/components/GuardrailsMonitor/GuardrailDetail.tsx b/ui/litellm-dashboard/src/components/GuardrailsMonitor/GuardrailDetail.tsx index 3447b4cb78..057ff702f0 100644 --- a/ui/litellm-dashboard/src/components/GuardrailsMonitor/GuardrailDetail.tsx +++ b/ui/litellm-dashboard/src/components/GuardrailsMonitor/GuardrailDetail.tsx @@ -5,7 +5,6 @@ import { WarningOutlined, } from "@ant-design/icons"; import { useQuery } from "@tanstack/react-query"; -import { Col, Grid } from "@tremor/react"; import { Button, Spin, Tabs } from "antd"; import React, { useMemo, useState } from "react"; import { @@ -172,11 +171,11 @@ export function GuardrailDetail({ {activeTab === "overview" && (
- - +
+
- - +
+
15 ? : undefined} /> - - +
+
150 @@ -204,8 +201,8 @@ export function GuardrailDetail({ } subtitle={data.avgLatency != null ? "Per request (avg)" : "No data"} /> - - +
+
- - +
+
- - +
+
} /> - - +
+
} /> - - +
+
- - - - - +
+
+ +
+
- + {(isLoading || error) && (
{isLoading && } @@ -272,9 +271,9 @@ export function GuardrailsOverview({ )}
- + <Typography.Title level={5} className="!mb-0 text-gray-900"> Guardrail Performance - +

Click a guardrail to view details, logs, and configuration

diff --git a/ui/litellm-dashboard/src/components/GuardrailsMonitor/ScoreChart.tsx b/ui/litellm-dashboard/src/components/GuardrailsMonitor/ScoreChart.tsx index e4803747d4..17c6f4d1f0 100644 --- a/ui/litellm-dashboard/src/components/GuardrailsMonitor/ScoreChart.tsx +++ b/ui/litellm-dashboard/src/components/GuardrailsMonitor/ScoreChart.tsx @@ -11,6 +11,7 @@ interface ScoreChartProps { export function ScoreChart({ data }: ScoreChartProps) { const chartData = data && data.length > 0 ? data : []; + return (