mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-12-04 00:56:43 +09:00
## Summary - Filter out E2E test data from admin dashboard by default (emails ending in `@inbox.testmail.app`) - Add "Show test data" toggle in admin header that persists to localStorage - Add `exclude_test` query parameter to all admin list/stats endpoints (defaults to `true`) - Add streaming limits with warnings to prevent memory issues on large datasets ## Changes **Backend:** - New `backend/utils/test_data.py` with `is_test_email()` utility - Updated admin stats endpoint with test data filtering - Updated users list, jobs list, beta stats, and audio searches endpoints - Added USERS_STREAM_LIMIT (2000) and JOBS_STREAM_LIMIT (10000) with warning logs **Frontend:** - New `frontend/lib/admin-settings.ts` zustand store for admin preferences - Toggle switch in admin layout header - All admin pages pass `exclude_test: !showTestData` to API calls **Docs:** - Updated API.md with exclude_test parameter documentation ## Test Plan - [x] Backend tests pass (68 passed) - [x] Frontend tests pass (128 passed) - [x] Frontend build succeeds - [x] CodeRabbit review passed - [ ] Manual: Visit `/admin` - stats should show lower numbers by default - [ ] Manual: Toggle "Show test data" ON - counts should increase - [ ] Manual: Toggle persists across page refreshes <!-- @coderabbitai ignore --> 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>