mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-28 01:49:00 +09:00
<!-- @coderabbitai ignore --> ## Summary - **Admin feedback page** at `/admin/feedback` — browse all user feedback submissions with star ratings, text fields, search, pagination, and aggregate stats - **Email notification** to admin@nomadkaraoke.com whenever a user submits new feedback (configurable via `ADMIN_NOTIFICATION_EMAIL` env var) - **Admin API endpoint** `GET /api/admin/feedback` with pagination, search, test-data filtering, and average ratings ## Context User feedback was stored in Firestore (`user_feedback` collection) but completely invisible to the admin — the admin panel only showed a boolean "Feedback Submitted: Yes/No" badge per user. This PR closes that gap. ## Changes **Backend:** - `GET /api/admin/feedback` endpoint with pagination, search, `exclude_test` filter, aggregate rating averages - `send_feedback_notification()` method on `EmailService` — sends HTML email with star ratings, all text fields, link to admin page - Wired into `submit_user_feedback` as fire-and-forget (won't block user response) **Frontend:** - New admin page with aggregate stat cards, searchable/paginated table, visual star ratings, expandable rows for text detail - "Feedback" sidebar nav item with MessageSquare icon - `adminApi.listFeedback()` client method + TypeScript types **Tests:** 14 tests covering endpoint (pagination, search, filtering, aggregates, empty state, datetime edge cases), email (content, subject, custom admin, failure), and caller-callee contract integration ## Test plan - [x] `make test` — 712 tests pass (39 suites) - [x] 14 new tests in `test_admin_feedback.py` - [ ] Manual: verify admin page renders at `/admin/feedback` after deploy - [ ] Manual: submit feedback → verify email arrives at admin@nomadkaraoke.com 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>