chore(ui): migrate router_settings page from Tremor to antd#25879
Conversation
Replace @tremor/react components with antd equivalents: - Button → antd Button - TextInput → antd Input - Switch → antd Switch
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryPure component library migration for the Confidence Score: 5/5Safe 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.
|
| 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]
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
|
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.
[Infra] Promote Internal Staging to main
…-router-settings-page-off-of-tremor
55d3229
into
litellm_internal_staging
Summary
@tremor/reactimports withantdequivalents in therouter_settings/directory (4 files)Button→ antdButton,TextInput→ antdInput,Switch→ antdSwitchScreenshots
before
after
Test plan