Skip to content

[Feature] UI - Default Team Settings: Migrate Default Team Settings to use Reusable Model Select#20310

Merged
yuneng-jiang merged 1 commit intomainfrom
litellm_ui_def_team_settings
Feb 3, 2026
Merged

[Feature] UI - Default Team Settings: Migrate Default Team Settings to use Reusable Model Select#20310
yuneng-jiang merged 1 commit intomainfrom
litellm_ui_def_team_settings

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

Replaces the custom model selection implementation in TeamSSOSettings with the reusable ModelSelect component. Refactors ModelSelect tests to consolidate similar test cases and improve maintainability. Adds comprehensive test coverage for TeamSSOSettings component.

Screenshots

image image

@vercel
Copy link

vercel bot commented Feb 3, 2026

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 3, 2026 2:00am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 3, 2026

Greptile Overview

Greptile Summary

This PR refactors the Default Team Settings to use the reusable ModelSelect component and consolidates test coverage. The changes successfully eliminate code duplication while improving maintainability.

Key changes:

  • Replaced custom model selection dropdown in TeamSSOSettings with reusable ModelSelect component
  • Added global context support to ModelSelect for unrestricted model selection
  • Added optional style prop to ModelSelect for layout flexibility
  • Consolidated redundant ModelSelect tests into parameterized test cases using helper factory
  • Added comprehensive test suite for TeamSSOSettings component (28 new tests)

Clean-up opportunities:

  • availableModels state and related fetching logic in TeamSSOSettings.tsx:22-49 are no longer used and can be removed

Confidence Score: 4/5

  • This PR is safe to merge with minor clean-up recommended
  • Code successfully refactors to use reusable component with comprehensive test coverage. Minor unused code remains that should be cleaned up
  • TeamSSOSettings.tsx has unused state variables and model fetching logic that should be removed

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/ModelSelect/ModelSelect.tsx Added global context support and style prop for flexibility
ui/litellm-dashboard/src/components/ModelSelect/ModelSelect.test.tsx Consolidated redundant tests into parameterized tests with helper factory function
ui/litellm-dashboard/src/components/TeamSSOSettings.tsx Replaced custom model dropdown with reusable ModelSelect component, removed unused availableModels state
ui/litellm-dashboard/src/components/TeamSSOSettings.test.tsx Added comprehensive test coverage for TeamSSOSettings component functionality

Sequence Diagram

sequenceDiagram
    participant User
    participant TeamSSOSettings
    participant ModelSelect
    participant useAllProxyModels
    participant API

    User->>TeamSSOSettings: Opens Default Team Settings
    TeamSSOSettings->>API: getDefaultTeamSettings(accessToken)
    API-->>TeamSSOSettings: Returns settings & schema
    
    User->>TeamSSOSettings: Clicks "Edit Settings"
    TeamSSOSettings->>TeamSSOSettings: setIsEditing(true)
    
    TeamSSOSettings->>ModelSelect: Renders with context="global"
    ModelSelect->>useAllProxyModels: Fetch proxy models
    useAllProxyModels->>API: GET /models
    API-->>useAllProxyModels: Returns proxy models
    useAllProxyModels-->>ModelSelect: Returns filtered models
    
    ModelSelect->>ModelSelect: Filters models by context
    ModelSelect->>ModelSelect: Splits wildcard/regular models
    ModelSelect-->>TeamSSOSettings: Displays model options
    
    User->>ModelSelect: Selects models
    ModelSelect->>TeamSSOSettings: onChange(selectedModels)
    TeamSSOSettings->>TeamSSOSettings: handleTextInputChange("models", value)
    
    User->>TeamSSOSettings: Clicks "Save Changes"
    TeamSSOSettings->>API: updateDefaultTeamSettings(accessToken, editedValues)
    API-->>TeamSSOSettings: Returns updated settings
    TeamSSOSettings->>TeamSSOSettings: Updates state & exits edit mode
    TeamSSOSettings->>User: Shows success notification
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

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 3, 2026

Additional Comments (2)

ui/litellm-dashboard/src/components/TeamSSOSettings.tsx
availableModels state is no longer used after migration to ModelSelect component

Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/litellm-dashboard/src/components/TeamSSOSettings.tsx
Line: 22:22

Comment:
`availableModels` state is no longer used after migration to ModelSelect component

```suggestion
```

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

ui/litellm-dashboard/src/components/TeamSSOSettings.tsx
Model fetching logic is no longer needed since ModelSelect handles its own data

Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/litellm-dashboard/src/components/TeamSSOSettings.tsx
Line: 38:49

Comment:
Model fetching logic is no longer needed since ModelSelect handles its own data

```suggestion
```

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

@yuneng-jiang yuneng-jiang merged commit 2984832 into main Feb 3, 2026
48 of 65 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