Skip to content

[Refactor] UI - Admin Page: Migrate to AntD Tabs#20465

Merged
yuneng-jiang merged 2 commits intomainfrom
litellm_ui_dep_tremor
Feb 6, 2026
Merged

[Refactor] UI - Admin Page: Migrate to AntD Tabs#20465
yuneng-jiang merged 2 commits intomainfrom
litellm_ui_dep_tremor

Conversation

@yuneng-jiang
Copy link
Collaborator

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🧹 Refactoring
✅ Test

Changes

Migrates the AdminPanel component from Tremor tabs (TabGroup, TabList, Tab, TabPanel, TabPanels) to Ant Design Tabs component. This is a test migration on a moderately used page (admin settings) rather than a heavily used page to validate the migration approach before applying it more broadly. Refactors the component to use the useAuthorized hook instead of prop drilling, removes unused member and admin management code, and adds comprehensive test coverage.

Screenshots

image image

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 5, 2026 4:56am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

Refactors the AdminPanel component to migrate from Tremor's TabGroup/TabList/Tab/TabPanel/TabPanels to Ant Design's Tabs component. This is a test migration on a moderately-used page to validate the approach before broader adoption.

Key Changes:

  • Migrated tab implementation from Tremor to Ant Design using the items prop pattern
  • Refactored to use useAuthorized hook instead of prop drilling accessToken, userId, premiumUser, showSSOBanner, searchParams, and setTeams
  • Removed ~280 lines of unused admin/member management code (handleMemberCreate, handleAdminCreate, handleMemberUpdate, form modals, etc.)
  • Added comprehensive test coverage (325 lines) for tabs, SSO configuration, allowed IPs, and UI access control
  • Updated imports in parent components and changed file name casing (admins.tsxAdmins.tsx)

Issues Found:

  • Missing rel="noopener noreferrer" on external link (security best practice)

Confidence Score: 4/5

  • Safe to merge with one minor security fix
  • Clean refactoring with good test coverage. Only issue is missing security attribute on external link. No breaking changes to functionality.
  • ui/litellm-dashboard/src/components/admins.tsx needs the rel attribute added to the external link

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/admins.tsx Migrated from Tremor tabs to Ant Design Tabs, removed unused admin/member management code, integrated useAuthorized hook
ui/litellm-dashboard/src/app/(dashboard)/settings/admin-settings/page.tsx Simplified parent component by removing all prop drilling to AdminPanel
ui/litellm-dashboard/src/app/page.tsx Updated import path and removed prop drilling to AdminPanel
ui/litellm-dashboard/src/components/Admins.test.tsx Added comprehensive test coverage for AdminPanel component with all tabs, modals, and interactions

Sequence Diagram

sequenceDiagram
    participant User
    participant AdminPanel
    participant useAuthorized
    participant Tabs
    participant API

    User->>AdminPanel: Load component
    AdminPanel->>useAuthorized: Call hook
    useAuthorized-->>AdminPanel: {accessToken, userId, premiumUser}
    
    AdminPanel->>API: checkSSOConfiguration()
    API->>API: getSSOSettings(accessToken)
    API-->>AdminPanel: SSO configuration data
    AdminPanel->>AdminPanel: setSsoConfigured(true/false)
    
    AdminPanel->>Tabs: Render AntD Tabs
    Tabs-->>User: Display tabs (SSO, Security, SCIM, UI Settings)
    
    alt User clicks Security Settings tab
        User->>Tabs: Click "Security Settings"
        Tabs->>AdminPanel: Render Security Settings content
        AdminPanel-->>User: Show SSO, Allowed IPs, UI Access Control buttons
        
        alt User clicks Allowed IPs
            User->>AdminPanel: Click "Allowed IPs"
            AdminPanel->>AdminPanel: Check premiumUser
            alt Premium user
                AdminPanel->>API: getAllowedIPs(accessToken)
                API-->>AdminPanel: IP list
                AdminPanel->>AdminPanel: setAllowedIPs()
                AdminPanel-->>User: Show IP management modal
            else Non-premium user
                AdminPanel-->>User: Show premium required message
            end
        end
        
        alt User clicks UI Access Control
            User->>AdminPanel: Click "UI Access Control"
            AdminPanel->>AdminPanel: Check premiumUser
            alt Premium user
                AdminPanel-->>User: Show UI Access Control modal
            else Non-premium user
                AdminPanel-->>User: Show premium required message
            end
        end
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 176 to 178
useEffect(() => {
checkSSOConfiguration();
}, [accessToken, premiumUser]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing checkSSOConfiguration in dependency array

Suggested change
useEffect(() => {
checkSSOConfiguration();
}, [accessToken, premiumUser]);
useEffect(() => {
checkSSOConfiguration();
}, [accessToken, premiumUser, checkSSOConfiguration]);
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/litellm-dashboard/src/components/admins.tsx
Line: 176:178

Comment:
missing `checkSSOConfiguration` in dependency array

```suggestion
  useEffect(() => {
    checkSSOConfiguration();
  }, [accessToken, premiumUser, checkSSOConfiguration]);
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 345 to 347
<a href={nonSssoUrl} target="_blank">
<b>{nonSssoUrl}</b>{" "}
</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing rel="noopener noreferrer" security attribute

Suggested change
<a href={nonSssoUrl} target="_blank">
<b>{nonSssoUrl}</b>{" "}
</a>
<a href={nonSssoUrl} target="_blank" rel="noopener noreferrer">
<b>{nonSssoUrl}</b>{" "}
</a>
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/litellm-dashboard/src/components/admins.tsx
Line: 345:347

Comment:
missing `rel="noopener noreferrer"` security attribute

```suggestion
            <a href={nonSssoUrl} target="_blank" rel="noopener noreferrer">
              <b>{nonSssoUrl}</b>{" "}
            </a>
```

How can I resolve this? If you propose a fix, please make it concise.

@yuneng-jiang yuneng-jiang merged commit 26cdc4a into main Feb 6, 2026
55 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant