chore: bean organisation

This commit is contained in:
2026-03-22 08:56:06 +01:00
parent f17687d2fa
commit c064a1b8d4
26 changed files with 409 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
---
# nuzlocke-tracker-mmre
title: Admin global search bar
status: draft
type: feature
priority: normal
created_at: 2026-03-21T21:59:20Z
updated_at: 2026-03-21T22:04:08Z
parent: nuzlocke-tracker-9i9m
---
Add a search bar to the admin layout header that searches across all admin entities (games, routes, encounters, pokemon, evolutions, runs) and lets you jump directly to the relevant page.
## Approach
- Add a search input to `AdminLayout.tsx` above the nav
- Use a debounced search that queries multiple endpoints (or a single backend search endpoint)
- Show results in a dropdown grouped by entity type (Games, Routes, Encounters, Pokemon, Runs)
- Each result links directly to the relevant admin page (e.g., clicking a route goes to `/admin/games/:gameId/routes/:routeId`)
- Keyboard shortcut (Cmd/Ctrl+K) to focus the search bar
## Files to modify
- `frontend/src/components/admin/AdminLayout.tsx` — Add search bar UI
- `frontend/src/components/admin/AdminSearchBar.tsx` — New component
- `frontend/src/hooks/useAdminSearch.ts` — New hook for search logic
- `backend/src/app/api/search.py` — New unified search endpoint (required — client-side search across 5+ entity types is too slow)
## Checklist
- [ ] Search bar component with debounced input
- [ ] Search across games, routes, encounters, pokemon, runs
- [ ] Results dropdown grouped by entity type
- [ ] Click result navigates to correct admin page
- [ ] Keyboard shortcut (Cmd/Ctrl+K) to focus
- [ ] Empty state and loading state