-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: Support additional filters #6213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to 2ee4fa2 in 2 minutes and 19 seconds. Click for details.
- Reviewed
431lines of code in9files - Skipped
0files when reviewing. - Skipped posting
3draft 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/src/components/filters/__tests__/ModelFilters.test.tsx:15
- Draft comment:
The 'rerender' variable is used inside the onFiltersChange callback before its declaration. Consider reorganizing the setup to avoid potential temporal dead zone issues. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. web-app/src/components/filters/__tests__/ModelFilters.test.tsx:67
- Draft comment:
Using a selector based on a data-slot attribute can be brittle. Consider assigning a dedicated test id for a more stable query in tests. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. web-app/src/routes/hub/index.tsx:165
- Draft comment:
In the useMemo for filtering models, the tool calling filter applies supportsToolCalling on each model. For large datasets, consider caching these results for better performance. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_bvRHydnr9ZE7Ww9C
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
2ee4fa2 to
311b43c
Compare
|
If these translations were generated automatically, would it be possible to rebase onto |
|
On the second thought, here are the translations: |
311b43c to
54bcfc5
Compare
|
@0rzech i've rebased and added the polish translations |
|
Thanks! |
cc12eec to
774f48f
Compare
|
Is there anything else you'd like to see? |
|
Hi @kamal , can you help me rebase and update the screenshots? We now have the vision model as an eye icon, and we’ve updated a couple of logic points, for example, searching the |
774f48f to
9a55f8e
Compare
|
@urmauur I've added vision to the list of filters and updated the screenshot.
Can you explain this a bit more? I don't see any change of behavior against the |
Hi @kamal, i gave approval, this is differences make sure when u paste hgf url and toggle on Download, it should like screenshot |
|
@urmauur thanks for the explanation. someone on the team will have to merge it. |
help me, fix conflict then will merge this. sorry |
c14fae1 to
2598f97
Compare
|
@urmauur rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive filtering system for the Hub model list by adding a new ModelFilters component that replaces the existing simple downloaded-only filter with a more feature-rich modal-style filter interface.
- Replaces the simple switch-based downloaded filter with a dropdown menu supporting multiple filter types
- Adds new filter options for tool calling and vision capabilities beyond the existing downloaded filter
- Updates localization strings across multiple languages to support the new filtering interface
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| web-app/src/routes/hub/index.tsx | Integrates ModelFilters component and refactors filtering logic to support multiple filter types |
| web-app/src/components/filters/ModelFilters.tsx | New dropdown-based filter component with support for downloaded, tool calling, and vision filters |
| web-app/src/components/filters/tests/ModelFilters.test.tsx | Comprehensive test suite for the ModelFilters component functionality |
| web-app/src/locales/*/hub.json | Adds localization strings for filter-related UI elements across 8 language locales |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| filtered = filtered?.filter((model) => | ||
| model.quants.some((variant) => | ||
| useModelProvider | ||
| .getState() | ||
| .getProviderByName('llamacpp') | ||
| ?.models.some((m: { id: string }) => m.id === variant.model_id) | ||
| ) | ||
| ) |
Copilot
AI
Sep 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for the showOnlyDownloaded filter has changed from the original implementation. Previously, it filtered out variants that weren't downloaded and only kept models with at least one downloaded variant. Now it filters out entire models if no variants are downloaded, which could be correct, but the change in behavior should be verified.
| } else if (!newFilters.showOnlyDownloaded && filterOptions.showOnlyDownloaded) { | ||
| // Re-trigger HuggingFace search when switching back to "All models" | ||
| fetchHuggingFaceModel(searchValue) | ||
| } | ||
| }} |
Copilot
AI
Sep 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The condition !newFilters.showOnlyDownloaded && filterOptions.showOnlyDownloaded is checking if the downloaded filter was turned off. This logic could be clearer by extracting it to a variable like const wasDownloadedFilterTurnedOff = !newFilters.showOnlyDownloaded && filterOptions.showOnlyDownloaded.
| } else if (!newFilters.showOnlyDownloaded && filterOptions.showOnlyDownloaded) { | |
| // Re-trigger HuggingFace search when switching back to "All models" | |
| fetchHuggingFaceModel(searchValue) | |
| } | |
| }} | |
| } else { | |
| const wasDownloadedFilterTurnedOff = !newFilters.showOnlyDownloaded && filterOptions.showOnlyDownloaded | |
| if (wasDownloadedFilterTurnedOff) { | |
| // Re-trigger HuggingFace search when switching back to "All models" | |
| fetchHuggingFaceModel(searchValue) | |
| } | |
| } |
| <div className="flex flex-col"> | ||
| <span className="text-sm">{t('hub:toolCalling')}</span> | ||
| </div> |
Copilot
AI
Sep 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The div wrapper with flex flex-col is unnecessary since it only contains a single span element. The wrapper can be removed and the span can be used directly.
| <div className="flex flex-col"> | ||
| <span className="text-sm">{t('hub:vision')}</span> | ||
| </div> |
Copilot
AI
Sep 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the tool calling filter, this div wrapper with flex flex-col is unnecessary since it only contains a single span element. The wrapper can be removed for consistency and cleaner code.
|
Thanks a lot for your contribution and the effort you’ve put into this PR @kamal 🙏 We really appreciate your time and initiative here. Your contributions are always welcome, and we’d love to have your input once the new Hub structure is ready. Thanks again for understanding 💪 |


Describe Your Changes
Add a filter modal in Hub to house additional filters.
Fixes Issues
Self Checklist
Important
Add
ModelFilterscomponent to support filtering models by download status and tool calling capability, with tests and localization updates.ModelFilterscomponent inModelFilters.tsxto manage filters forshowOnlyDownloadedandtoolCallingOnly.ModelFiltersinindex.tsxto apply filters to model list.ModelFilters.test.tsxto verify filter toggling and clearing functionality.hub.jsonin multiple locales to include new filter-related strings:filters,filterBy,toolCalling,clearFilters.This description was created by
for 2ee4fa2. You can customize this summary. It will automatically update as commits are pushed.