Skip to content

fix(usage): support searchable API key filter on /usage page#1692

Open
hansnow wants to merge 1 commit intoWei-Shaw:mainfrom
hansnow:fix/usage-api-key-search
Open

fix(usage): support searchable API key filter on /usage page#1692
hansnow wants to merge 1 commit intoWei-Shaw:mainfrom
hansnow:fix/usage-api-key-search

Conversation

@hansnow
Copy link
Copy Markdown

@hansnow hansnow commented Apr 16, 2026

Summary

  • keep the existing /usage API key filter UI as a Select, but make it searchable
  • stop preloading only the first 100 API keys and load matching candidates on demand through the existing /keys API
  • add regression coverage for the new Select search event and the user usage page filter flow

Problem

The user usage page could only filter API keys from a preloaded list, which made the control effectively unsearchable and also meant keys beyond the first 100 entries were hard to reach.

Solution

  • add an optional search event to the shared Select component
  • update the user usage page to debounce remote key lookup and keep the selected key label stable across result refreshes
  • preserve existing usage query, stats, pagination, sorting, and CSV export behavior

Testing

  • docker run --rm -v "$PWD/frontend:/app" -w /app node:24-alpine sh -lc 'corepack enable && corepack prepare pnpm@10.33.0 --activate && pnpm install --frozen-lockfile && pnpm exec vitest run src/components/common/__tests__/Select.spec.ts src/views/user/__tests__/UsageView.spec.ts && pnpm run typecheck'
  • cd deploy && POSTGRES_PASSWORD=testpass JWT_SECRET=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef TOTP_ENCRYPTION_KEY=abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 ADMIN_PASSWORD=admin123 docker compose -f docker-compose.dev.yml build sub2api
  • manual browser verification completed locally by the reporter

Demo

screen recording

sub2api-pr-1692-demo.mp4

@hansnow hansnow changed the title fix(usage): support searchable API key filter on /usage fix(usage): support searchable API key filter on /usage page Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant