litellm/ui
yuneng-jiang b134c61300
refactor(ui): migrate the regenerate key and team member forms to react-hook-form and shadcn (#37300)
* refactor(ui): migrate the regenerate key and team member forms to react-hook-form and shadcn

Moves RegenerateKeyModal and EditMembership off antd Form onto react-hook-form
plus the shadcn field kit, and onto semantic color tokens so both are dark-mode
ready. The antd Modal shell and Alert stay as they are.

The submitted payload is unchanged on both. Payload construction is extracted
into regenerateKeyPayload.ts and memberFormValues.ts and unit tested there, and
each component keeps an integration test that was written against the antd
original and proven green before any source changed.

RegenerateKeyModal keeps antd InputNumber's precision=2 rounding of max_budget.
The rounding is string-exact rather than float based, so 1.005 still submits as
1.01 the way antd did. Submission stays on the modal footer button, so Enter
still does nothing.

EditMembership omits noValidate. Its numeric fields are already native number
inputs carrying min and step, so browser constraint validation blocks a bad
submit today and continues to. That is pinned by tests.

* fix(ui): accept null-valued fields the proxy returns for keys and members

The proxy returns null rather than omitting the key for an unset
key_alias, user_email or user_id. antd had no schema and forwarded
whatever came back, but z.string().optional() accepts undefined and
rejects null, so regenerating an alias-less key or editing a member
with no email failed validation and silently never submitted.

Widen those three fields to nullish() and pin each with a test that
seeds null and submits without touching the field. Each test passes
against the pre-migration antd component and failed against the
migration before this commit, and the payloads it asserts are the
ones antd put on the wire.
2026-08-18 18:42:33 +00:00
..
litellm-dashboard refactor(ui): migrate the regenerate key and team member forms to react-hook-form and shadcn (#37300) 2026-08-18 18:42:33 +00:00
Dockerfile chore(build): move the Admin UI toolchain to Node 24 (#35801) 2026-08-04 12:36:07 -07:00
nginx.conf fix(ui): serve /ui/assets from the nginx image instead of SPA fallback (#34066) 2026-07-21 09:22:02 -07:00