Skip to content

Conversation

@louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Jul 28, 2025

Describe Your Changes

Fixed the Model Hub search result sorting by weight.

image image

Fixes Issues

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Important

Replaces fuzzySearch with Fuse.js for improved search result sorting by weight in the Model Hub and adds debouncing to search input.

  • Behavior:
    • Replaces fuzzySearch with Fuse.js for search result sorting by weight in Hub component in index.tsx.
    • Adds debouncing to search input in Hub component to improve performance.
  • Dependencies:
    • Adds fuse.js to package.json.
  • Code Removal:
    • Removes fuzzySearch function from utils.ts and its tests from utils.test.ts.

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

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 5211f1d in 1 minute and 27 seconds. Click for details.
  • Reviewed 184 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. web-app/package.json:45
  • Draft comment:
    Added dependency 'fuse.js'. Ensure that any custom options (like threshold or key weights) are configured if needed in the future.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. web-app/src/lib/__tests__/utils.test.ts:3
  • Draft comment:
    Removed tests for the fuzzySearch function. Confirm that no external consumers rely on fuzzySearch and the removal is intentional.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. web-app/src/lib/utils.ts:90
  • Draft comment:
    The fuzzySearch function has been removed. Verify that no other part of the codebase depends on it now.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. web-app/src/routes/hub/index.tsx:200
  • Draft comment:
    Search filtering now uses Fuse.js with the given searchOptions. Consider memoizing the searchOptions (or the Fuse instance) to avoid recreating it on every rerender for better performance, especially if the sources array grows large.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
5. web-app/src/routes/hub/index.tsx:215
  • Draft comment:
    The HuggingFace repo (if available) is prepended to the filtered results. Double-check that this behavior aligns with the requirement to sort results purely by relevance score, as it overrides the Fuse-based ranking.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
6. web-app/src/routes/hub/index.tsx:200
  • Draft comment:
    Ensure that Fuse.js is returning results in the expected order (lower score indicates a better match) so that the best matches appear at the top.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_h42olztc19BEXdjR

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@Minh141120
Copy link
Member

[Windows]

Tested search model in hub, works as intended

image image image

@louis-jan louis-jan merged commit 160d158 into release/v0.6.6 Jul 28, 2025
55 of 63 checks passed
@louis-jan louis-jan deleted the fix/search-result-sort-by-weight branch July 28, 2025 16:33
@github-project-automation github-project-automation bot moved this to QA in Jan Jul 28, 2025
@github-actions github-actions bot added this to the v0.6.7 milestone Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants