feat: Complete search overhaul — fuzzy, filters, highlighting, debounce, saved searches
Search improvements (all 7 recommendations implemented):
1. Search all metadata fields:
- Fuzzy search now includes: title, prompt, artist, album, comment,
model, status, error_message, key, BPM, duration, structured prompt fields
- Built _searchText concatenated field for Fuse.js indexing
2. Fuzzy search via fuse.js:
- Installed fuse.js@7.0.0
- threshold: 0.4 (balanced precision/recall)
- ignoreLocation: true (matches anywhere in text)
- includeScore for ranking
3. Advanced filters panel:
- Model: All / Clip Preview / Pro
- Status: All / Ready / Generating / Failed
- Artwork: All / Has Artwork / No Artwork
- BPM Range: Min/Max number inputs
- Date Range: From/To date pickers
- Active filter chips shown below search bar
- Clear all button
4. Search term highlighting:
- HighlightText component wraps matched terms in
bg-lyria-accent/30 background
- Applied to title and prompt in both ribbon and tile views
5. Debounced input (300ms):
- useDebounce hook delays search execution
- Prevents filtering on every keystroke
- Smoother UX, less CPU usage
6. Saved searches:
- Save current search + filters with custom name
- Stored in localStorage (lyria-saved-searches)
- Load saved search to restore query + filters
- Delete saved searches
- Bookmark icon in search bar
7. Backend search endpoint:
- GET /api/clips/search?q=&model=&status=&bpm_min=&bpm_max=&date_from=&date_to=&limit=&offset=
- Full pagination support for large libraries
- Same fuzzy logic as frontend, server-side
Gallery component completely rewritten with:
- Cleaner header layout with search, filters, saved searches, view toggle
- Results count showing filtered/total
- Empty state when no matches
- Pagination with page info
This commit is contained in:
1 parent
b3807f0f60
commit
f8969d8585
3 files changed
+3114
-30
No files matched your search
Generated
+2729
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user