mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
* refactor(ui): move the budget, cache, cost tracking and playground forms off tremor Swaps tremor Accordion for the Base UI Collapsible, TextInput for the shadcn Input and the two tremor Buttons for the shadcn Button across the budget modals, cache settings, the cost tracking add-provider and add-margin forms and the playground model selector. The accordion bodies keep tremor's unmount-when-closed semantics, since headless-ui's Disclosure.Panel and Base UI's panel both default to unmounting, so the antd fields inside behave exactly as before. The two cost tracking buttons are the one deliberate behaviour change. tremor's Button renders a bare button with no type, so inside the antd Form that wraps both components it was an implicit submit on top of its own onClick. For the discount form that meant every click ran handleAddProvider twice, once from onClick and once from the form's onFinish, and for the margin form the submit did nothing at all because that Form has no onFinish. The shadcn Button forces type="button", so the add now fires once from onClick alone and no type="submit" is added back. The three inputs that used onValueChange now read e.target.value, and each one gained a test that types into it and asserts the reported string, so the wiring cannot silently regress. The cache settings suite gained a collapse contract test that the advanced sections are absent until the section is expanded. Prunes the six no-restricted-imports suppressions these files no longer need, each dropping from two to one for the antd import that stays. * fix(ui): keep enter to submit on the cost tracking add forms The shadcn Button forces type="button", so converting the two tremor buttons left both cost tracking modals with no submit button at all. Each form still holds two fields that block implicit submission, the provider select's search input and the value input, so pressing Enter stopped adding anything. Both buttons get type="submit" back. For the discount modal that alone would restore the double add the conversion had just removed, since a submit also ran the form's onFinish, so the parent drops onFinish and the now dead handleFormSubmit. Click and Enter both go through onClick exactly once. The margin form's parent never had an onFinish, so restoring the submit type there is enough on its own. Adds three cases to the cost tracking settings suite: the discount add fires once from a click, the discount add fires once from Enter, and the margin add fires once from Enter. Dropping either type="submit" kills the Enter cases and putting onFinish back makes both discount cases see two calls. Also drops the two empty placeholders on the budget modals that only existed to suppress tremor's "Type..." default. * fix(ui): restore Enter-to-submit on the margin modal The tremor Button rendered a bare native button, which defaults to type="submit", so Enter in the percentage field submitted the margin modal. The shadcn Button wraps Base UI, which defaults to type="button", and the migration also replaced the margin modal's form element with a plain div, so Enter went inert while the visually identical discount modal kept working. Give the margin modal the same form wrapper the discount modal already has and mark its action button as the submit button. Also move the cache settings advanced-section test into the integration file, where a test that renders the real component tree belongs. |
||
|---|---|---|
| .. | ||
| litellm-dashboard | ||
| Dockerfile | ||
| nginx.conf | ||