Skip to content

chore(ui): migrate router_settings page from Tremor to antd#25879

Merged
ryan-crabbe-berri merged 4 commits intolitellm_internal_stagingfrom
litellm_chore-migrate-router-settings-page-off-of-tremor
Apr 18, 2026
Merged

chore(ui): migrate router_settings page from Tremor to antd#25879
ryan-crabbe-berri merged 4 commits intolitellm_internal_stagingfrom
litellm_chore-migrate-router-settings-page-off-of-tremor

Conversation

@ryan-crabbe-berri
Copy link
Copy Markdown
Collaborator

@ryan-crabbe-berri ryan-crabbe-berri commented Apr 16, 2026

Summary

  • Replace @tremor/react imports with antd equivalents in the router_settings/ directory (4 files)
  • Button → antd Button, TextInput → antd Input, Switch → antd Switch
  • No functional changes — pure component library swap

Screenshots

before

Screenshot 2026-04-16 at 10 47 58 AM

after

Screenshot 2026-04-16 at 11 03 16 AM

Test plan

  • Navigate to Settings → Router Settings
  • Verify Reliability & Retries inputs render and accept values
  • Verify Tag Filtering toggle works
  • Select "latency-based-routing" strategy and verify Latency-Based Configuration inputs render
  • Click Save Changes and Reset buttons, confirm they work

Replace @tremor/react components with antd equivalents:
- Button → antd Button
- TextInput → antd Input
- Switch → antd Switch
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 16, 2026 9:06pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 16, 2026

Greptile Summary

Pure component library migration for the router_settings/ directory — four source files swap Tremor's TextInput, Switch, and Button for their antd equivalents, and the three test files update mocks/assertions to match the new component APIs. No business logic is changed.

Confidence Score: 5/5

Safe to merge — pure UI library swap with no logic changes and well-aligned test updates.

All changes are mechanical Tremor → antd substitutions. Test mock changes are necessary (antd components now need to be available in tests) and test assertion updates are correct (antd Switch onChange passes two args). No P0/P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/router_settings/LatencyBasedConfiguration.tsx Simple TextInput → antd Input swap; props (name, defaultValue, className) are compatible.
ui/litellm-dashboard/src/components/router_settings/ReliabilityRetriesSection.tsx Simple TextInput → antd Input swap; no logic changes.
ui/litellm-dashboard/src/components/router_settings/TagFilteringToggle.tsx Tremor Switch → antd Switch; uses onChange prop which is supported by antd.
ui/litellm-dashboard/src/components/router_settings/index.tsx Tremor Button → antd Button; Save Changes uses type="primary", Reset uses default variant — visual hierarchy is maintained.
ui/litellm-dashboard/src/components/router_settings/TagFilteringToggle.test.tsx Assertion split from toHaveBeenCalledWith(true) to check call count and first arg separately — correct because antd Switch onChange fires with (checked, event) rather than just (checked).
ui/litellm-dashboard/src/components/router_settings/RouterSettingsForm.test.tsx Antd mock widened from full-replacement to partial (spread real antd + override Select only), necessary since Switch and Button are now sourced from antd and must be available in tests.
ui/litellm-dashboard/src/components/router_settings/index.test.tsx Same partial-mock pattern as RouterSettingsForm.test.tsx — correct and consistent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[index.tsx] -->|renders| B[RouterSettingsForm]
    B -->|renders| C[TagFilteringToggle\nantd Switch]
    B -->|renders| D[ReliabilityRetriesSection\nantd Input]
    B -->|renders| E[LatencyBasedConfiguration\nantd Input]
    A -->|action buttons| F[antd Button\nReset / Save Changes]
Loading

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@ryan-crabbe-berri
Copy link
Copy Markdown
Collaborator Author

note: latency based routing options dont show up and this is a pre existing bug

The antd mocks in RouterSettingsForm.test.tsx and index.test.tsx
replaced the entire antd module with only Select, so the Switch and
Button used by nested components failed to render. Use importOriginal
to preserve the rest of antd and override only Select.

Also fix the TagFilteringToggle click assertion — antd's Switch fires
onChange with (checked, event), so toHaveBeenCalledWith(true) was
always going to miss. Assert the checked arg directly instead of
coupling to antd's call signature.
yuneng-berri and others added 2 commits April 16, 2026 18:21
@ryan-crabbe-berri ryan-crabbe-berri merged commit 55d3229 into litellm_internal_staging Apr 18, 2026
89 of 95 checks passed
@ryan-crabbe-berri ryan-crabbe-berri deleted the litellm_chore-migrate-router-settings-page-off-of-tremor branch April 18, 2026 17:23
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.

2 participants