• Will Chen's avatar
    Add fuzzy search to settings sidebar (#2449) · a711c99b
    Will Chen 提交于
    ## Summary
    - Add a search bar with fuzzy matching (fuse.js) to the settings sidenav
    for quickly finding any setting
    - Create a searchable index of all ~23 settings with labels,
    descriptions, and keywords for forgiving matches
    - Clicking a search result scrolls to and briefly highlights the target
    setting with an animation
    
    ## Test plan
    - Navigate to Settings and type partial/approximate terms in the search
    bar (e.g. "aprv" for Auto-approve, "dark" for Theme, "zoom" for Zoom
    Level)
    - Verify results show matching settings grouped by section name
    - Click a result and verify it scrolls to and highlights the setting
    - Clear search and verify normal section navigation is restored
    - Verify "No settings found" appears for non-matching queries
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2449">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > **Medium Risk**
    > Moderate UI/navigation change: expands settings DOM with new anchor
    IDs and changes `useScrollAndNavigateTo` signature/behavior, which could
    impact other scroll-to call sites if any were missed. Adds a new
    dependency (`fuse.js`) and client-side search logic but no security- or
    data-sensitive behavior.
    > 
    > **Overview**
    > Adds a fuzzy-search input to the settings sidebar (powered by
    `fuse.js`) so users can search across a new `SETTINGS_SEARCH_INDEX` of
    settings metadata and jump directly to a specific setting.
    > 
    > Updates settings navigation to use centralized
    `SECTION_IDS`/`SETTING_IDS`, adds per-setting DOM `id`s in
    `settings.tsx`, and extends `useScrollAndNavigateTo` with optional
    *highlight-on-scroll* behavior (with new `.settings-highlight` CSS
    animation) used when clicking search results.
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    2734a219ca2d3ebe80571dede1ea88d36cca77cc. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Add a fuzzy search bar to the settings sidebar so you can quickly find
    any setting. Clicking a result smooth-scrolls to and briefly highlights
    the setting.
    
    - **New Features**
    - Fuzzy search across ~23 settings using a searchable index (labels,
    descriptions, keywords).
    - Smooth scroll-to with a highlight animation; added anchor IDs for
    precise navigation.
      - Clear button to reset the query and a "No settings found" state.
    
    - **Dependencies**
      - Added fuse.js ^7.1.0.
    
    <sup>Written for commit 2734a219ca2d3ebe80571dede1ea88d36cca77cc.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
    a711c99b