refactor(ui): install the shadcn alert primitive - #38300
Merged
yuneng-berri merged 1 commit intoAug 26, 2026
Merged
Conversation
components/shared/Alert.tsx was base-vega's own alert.tsx copied in by hand, carrying the same four exports and the same class strings, so npx shadcn add could never reach it and it would drift from every upstream fix silently. It also still wrapped each part in forwardRef, which React 19 no longer needs. Install the primitive into components/ui/ where the CLI can update it, and reduce the shared file to a wrapper that adds the four status variants (info, success, warning, error) the dashboard actually uses on top of upstream's default and destructive. Rendered output is unchanged: every variant produces byte-identical classes, role and data-variant, so all 45 call sites look the same.
Contributor
Greptile SummaryThis PR moves the base alert primitive into the CLI-managed UI directory and reduces the shared alert component to a wrapper for the dashboard’s four additional status variants.
Confidence Score: 5/5The PR appears safe to merge with no actionable regressions identified. The wrapper preserves the existing variants, data attributes, accessibility role, prop forwarding, and merged styling, while React 19 supports the new ref-as-prop component form.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/shared/Alert.tsx | Replaces the copied primitive with a typed wrapper that preserves status variants and delegates base behavior to the new UI component. |
| ui/litellm-dashboard/src/components/ui/alert.tsx | Adds the shadcn alert primitive with the same structural, accessibility, and base styling behavior. |
| ui/litellm-dashboard/eslint-suppressions.json | Adds the expected filename-case suppression for the CLI-managed lowercase component file. |
Reviews (1): Last reviewed commit: "refactor(ui): install the shadcn alert p..." | Re-trigger Greptile
ryan-crabbe-berri
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
shared/Alert.tsxis base-vega'salert.tsxcopied in by handnpx shadcn addcannot reach it, so it drifts from upstreamforwardRef, which React 19 dropped the need forHow it solves it:
components/ui/where the CLI owns itUser Flow
This is a no-op refactor, so the two lists are identical by design. An admin sees the same alerts, in the same colours, on the same routes, before and after
Before: an admin loads the dashboard and sees the standard alerts
--detailed_debugand see an amber "Performance Warning: Detailed Debug Mode Active" banner across the topAfter: the same admin sees exactly the same three things
--detailed_debugand see an amber "Performance Warning: Detailed Debug Mode Active" banner across the topRelevant issues
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Setup: start the proxy with
python litellm/proxy/proxy_cli.py --config litellm/proxy/dev_config.yaml --detailed_debug --reload, then runnpm run devinui/litellm-dashboardand sign in at http://localhost:3000Before (3e2927d)
Warning alert, both themes
Info alert, both themes
After (a5b6f31)
Warning alert, both themes
Info alert, both themes
Type
🧹 Refactoring
Caveats (if any)
Low
alertVariantsis not exported, so the wrapper appends its status classes and leans on twMerge to settle the overlapui/alert.tsxtakes the samefilename-pascal-casesuppression every other CLI-managed primitive carriesshared/Alert.test.tsxalready covers all six variants and is the gate here, kept unedited. It fails when a status variant loses its token colour, checked by mutating the info variant and watching it go redFinal Attestation