litellm/ui/litellm-dashboard/src/hooks
Yuneng Jiang 59730325da
fix(ui): keep tab panel state across tab switches on the migrated routes
Greptile caught a real regression in the shadcn migration: starting to edit organization
settings and switching to another tab silently discarded the unsaved input.

antd Tabs and Tremor TabGroup mount a panel lazily and then keep it mounted, so a
half-filled form or a search history survives leaving the tab and coming back. Base UI
unmounts inactive panels instead. Its keepMounted escape hatch is not equivalent either:
it mounts every panel eagerly, which renders work the user may never ask for and, on the
organization view, put the organization name on screen twice.

useVisitedTabs reproduces the original semantics by tracking which tabs have been opened
and keeping only those mounted. It is applied to the two tab strips whose panels wrap
stateful children: organization Settings, and the vector-stores Create and Test tabs,
where an in-progress upload or a search history was equally exposed. The access-group
detail tabs render lists derived from props, so they stay lazy.

The added regression test fails without the fix and passes with it, and it also passes
against the pre-migration antd component, so it pins parity rather than the new markup.
2026-07-23 23:16:34 -07:00
..
policies style(ui): run prettier --write across the dashboard (#29622) 2026-06-04 11:37:54 -07:00
mcpOAuthUtils.ts fix(mcp): let non-creator users OAuth into OBO-mode MCP servers from the Tools page (#29867) 2026-06-08 13:35:49 -07:00
use-safe-layout-effect.ts added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00
useMcpOAuthFlow.test.tsx fix(mcp): persist DCR client_id from on-create MCP OAuth Authorize & Fetch (#31920) 2026-07-03 12:15:33 -07:00
useMcpOAuthFlow.tsx fix(mcp): mint an ephemeral OAuth client when passthrough authorize has no client_id 2026-07-22 18:03:58 -07:00
useTestMCPConnection.tsx refactor(ui): useTestMCPConnection uses the shared isClientForwardedTokenMode helper 2026-07-09 13:51:03 -07:00
useToolsOAuthFlow.test.tsx fix(mcp): mint an ephemeral OAuth client when passthrough authorize has no client_id 2026-07-22 18:03:58 -07:00
useToolsOAuthFlow.tsx fix(mcp): mint an ephemeral OAuth client when passthrough authorize has no client_id 2026-07-22 18:03:58 -07:00
useUserMcpOAuthFlow.tsx style(ui): run prettier --write across the dashboard (#29622) 2026-06-04 11:37:54 -07:00
useVisitedTabs.ts fix(ui): keep tab panel state across tab switches on the migrated routes 2026-07-23 23:16:34 -07:00
useWorker.ts style(ui): run prettier --write across the dashboard (#29622) 2026-06-04 11:37:54 -07:00