Skip to content

fix(ui): add searchable filter to User Usage page - #25751

Closed
xykong wants to merge 1 commit into
BerriAI:mainfrom
xykong:fix/user-usage-searchable-filter
Closed

fix(ui): add searchable filter to User Usage page#25751
xykong wants to merge 1 commit into
BerriAI:mainfrom
xykong:fix/user-usage-searchable-filter

Conversation

@xykong

@xykong xykong commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #25750

The User Usage filter only showed a static preloaded list. Users could not type to search for a specific user, unlike the Global Usage page which supports debounced server-side search.

This PR introduces UserSingleSelect — a dedicated single-select component with useInfiniteUsers + 300ms debounce + infinite scroll — and wires it into EntityUsage for entityType === "user".

Root Cause

EntityUsage.tsx delegated user filtering to UsageExportHeader, which renders a plain <Select> without showSearch/onSearch. The same issue was fixed for Team Usage in PR #25107 using TeamMultiSelect.

Changes

  • ui/litellm-dashboard/src/components/common_components/user_single_select.tsx — new component
  • ui/litellm-dashboard/src/components/common_components/user_single_select.test.tsx — 10 tests
  • ui/litellm-dashboard/src/components/UsagePage/components/EntityUsage/EntityUsage.tsx — wire up UserSingleSelect for entityType === "user"
  • ui/litellm-dashboard/src/components/UsagePage/components/EntityUsage/EntityUsage.test.tsx — add mock for user_single_select

Testing

cd ui/litellm-dashboard
npx vitest run src/components/UsagePage/components/EntityUsage/ --reporter=verbose
npx vitest run src/components/common_components/user_single_select.test.tsx --reporter=verbose

All 92 existing tests pass + 10 new tests for UserSingleSelect.

Related

User Usage filter only allowed selecting from a static preloaded list,
unlike Global Usage which supports debounced text search via useInfiniteUsers.

Add UserSingleSelect component (single-select with useInfiniteUsers +
300ms debounce + infinite scroll) and wire it into EntityUsage for
entityType === 'user', mirroring the TeamMultiSelect fix in PR BerriAI#25107.

- Add src/components/common_components/user_single_select.tsx
- Add src/components/common_components/user_single_select.test.tsx (10 tests)
- Update EntityUsage.tsx to render UserSingleSelect for user entity type
- Update EntityUsage.test.tsx to mock user_single_select
@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 15, 2026 4:53am

Request Review

@greptile-apps

greptile-apps Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (937 files found, 100 file limit)

@CLAassistant

CLAassistant commented Apr 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@gitguardian

gitguardian Bot commented Apr 15, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic High Entropy Secret da67018fe3d06730f1d212c99124966a6cde0463 litellm/proxy/management_endpoints/sso/happyelements_endpoints.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@xykong

xykong commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebuilt this PR as a clean, focused branch on top of berri/main:

  • Removed all unrelated commits (SSO, VOD, otel, etc.) — those were internal patches that accidentally leaked into this branch
  • Single commit with only the 4 files changed for the User Usage searchable filter
  • No secrets or internal code — GitGuardian warning is now resolved
  • CLA: all commits are now from the GitHub account (xy.kong@gmail.com), so both committers are signed ✅

The fix itself is unchanged: adds UserSingleSelect component using useInfiniteUsers with 300ms debounce, mirroring the TeamMultiSelect pattern from #25107.

@codspeed-hq

codspeed-hq Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing xykong:fix/user-usage-searchable-filter (5d21637) with main (3e1479c)

Open in CodSpeed

@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions Bot added the stale label Jul 29, 2026
@github-actions github-actions Bot closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants