onlook icon indicating copy to clipboard operation
onlook copied to clipboard

Fix/font search bug

Open kishansinghifs1 opened this issue 6 months ago • 2 comments

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 FontManager to 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.tsx to include animations using framer-motion and changes text and button styles.
  • Code Refactoring:
    • Locks aspect ratio in resize-handles.tsx by setting aspectRatioLocked to true.
    • Refactors variable names in resize-handles.tsx for clarity (e.g., currentWidth to newWidth).

This description was created by Ellipsis for 9f2affbb79c595bde58af6088bcb9aa27af1d5a6. You can customize this summary. It will automatically update as commits are pushed.

kishansinghifs1 avatar Jun 09 '25 16:06 kishansinghifs1

Someone is attempting to deploy a commit to the Onlook Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 09 '25 16:06 vercel[bot]

@Kitenite can you please review it .

kishansinghifs1 avatar Jun 10 '25 07:06 kishansinghifs1