From 086cbb2d85d6c2a4ff75e290032504e0777793ac Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 25 Jul 2026 18:41:06 -0700 Subject: [PATCH] fix(ui): center vertical toolbar dividers The shadcn separator primitive ships `data-vertical:self-stretch` so a bare vertical divider fills its row, but every call site overrides the height with `h-5`. A definite cross size makes `align-self: stretch` behave as `flex-start`, so the dividers rendered flush with the top of their flex line instead of centered: 0px above and 18px below in the dashboard header, 0px above and 12px below in the models table toolbar Routes the three vertical dividers through a ToolbarSeparator that pairs the fixed height with a same-variant `data-vertical:self-center`. Matching the variant is what matters; tailwind-merge then drops the conflicting class outright, whereas a plain `self-center` ties on specificity (the variant is defined with `:where()`) and loses on utility order. The CLI-managed primitive is left untouched --- .../components/AllModelsTable.test.tsx | 9 +++++ .../components/AllModelsTable.tsx | 4 +-- .../src/components/DashboardHeader.test.tsx | 9 +++++ .../src/components/DashboardHeader.tsx | 6 ++-- .../shared/ToolbarSeparator.test.tsx | 36 +++++++++++++++++++ .../components/shared/ToolbarSeparator.tsx | 12 +++++++ 6 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 ui/litellm-dashboard/src/components/shared/ToolbarSeparator.test.tsx create mode 100644 ui/litellm-dashboard/src/components/shared/ToolbarSeparator.tsx diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.test.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.test.tsx index 4dc45b9f825..a91548a5a1b 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.test.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.test.tsx @@ -200,6 +200,15 @@ describe("AllModelsTable", () => { expect(screen.getByText("+2 more")).toBeInTheDocument(); }); + it("renders the toolbar divider centered rather than stretched to the top of the row", () => { + const { container } = render(); + + const separators = container.querySelectorAll('[data-slot="separator"][data-orientation="vertical"]'); + expect(separators).toHaveLength(1); + expect(separators[0].className).not.toMatch(/self-stretch/); + expect(separators[0].className).toContain("data-vertical:self-center"); + }); + describe("pause / resume", () => { it("renders the toggle on for an active DB model and off for a blocked one", () => { const { rerender } = render(); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx index d073519d162..c447e16d0ec 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx @@ -14,7 +14,7 @@ import { import { SearchSelect } from "@/components/shared/SearchSelect"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger } from "@/components/ui/select"; -import { Separator } from "@/components/ui/separator"; +import { ToolbarSeparator } from "@/components/shared/ToolbarSeparator"; import { cn } from "@/lib/cva.config"; import { @@ -242,7 +242,7 @@ export function AllModelsTable({ - +