Fix/font search bug
Description
Fixes the font search logic to properly match full query strings. Previously, searching for a font like "Adlam Display" would return results that only partially matched the term (e.g., fonts that contained just "Display"), instead of requiring a more complete match.
The updated logic uses FlexSearch with suggest and enrich options, maps and filters results, and applies a stricter condition for multi-word queries to ensure full, case-insensitive matching.
Related Issues
Fixes #2058 Font search doesn't work as expected .
Type of Change
Bug fix
Testing
Verified the font search returns exact match results for multi-word queries like "Adlam Display".
Ensured partial matches still work for single-word queries like "Roboto".
Confirmed that no fonts are returned when no match is found.
Manually validated that _searchResults is updated only with valid results.
Checked that loadFontBatch() is only triggered when valid fonts are found.
No console errors were encountered during searches.
[!IMPORTANT] Fixes font search logic for full query matches and updates UI with animations and style changes.
- Font Search Logic:
- Fixes font search logic in
FontManagerto ensure full query string matches for multi-word queries using FlexSearch.- Filters results for exact case-insensitive matches when query has multiple words.
- UI Enhancements:
- Updates
not-found.tsxto include animations usingframer-motionand changes text and button styles.- Code Refactoring:
- Locks aspect ratio in
resize-handles.tsxby settingaspectRatioLockedtotrue.- Refactors variable names in
resize-handles.tsxfor clarity (e.g.,currentWidthtonewWidth).This description was created by
for 9f2affbb79c595bde58af6088bcb9aa27af1d5a6. You can customize this summary. It will automatically update as commits are pushed.
Someone is attempting to deploy a commit to the Onlook Team on Vercel.
A member of the Team first needs to authorize it.
@Kitenite can you please review it .