Skip to content
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

Add category-based filtering in settings search #2086

Merged
merged 3 commits into from
Dec 30, 2024
Merged

Conversation

shinshin86
Copy link
Collaborator

@shinshin86 shinshin86 commented Dec 29, 2024

This PR add category-based filtering in the settings dialog.

before:
search-categories_1

after:
search-categories_2

About Comfy.Locale

Previously, the Comfy.Locale setting lacked a category, so it did not appear under any category filters. By adding ['Comfy', 'Locale', 'Language'] to its category, the setting now correctly shows up under the "Locale" category, making it easier to find and filter by language-related options.
https://github.com/Comfy-Org/ComfyUI_frontend/pull/2086/files#diff-feddb5538790cf32783a1d79209f8111a1e27cb565b937d15a59c047b1b2228bR264

When you have a moment, I would appreciate it if you could review these changes. Thank you!

@shinshin86 shinshin86 requested a review from a team as a code owner December 29, 2024 01:51
Copy link
Member

@huchenlei huchenlei left a comment

Choose a reason for hiding this comment

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

Changes made:

  • Reverted category add on "Comfy.Locale" as category by default is determined by the id. The extra field is just to change the display without modifying the id.
  • Changed to a more explicit handling of categories.

@@ -232,14 +233,26 @@ const handleSearch = (query: string) => {
const filteredSettings = allSettings.filter((setting) => {
const idLower = setting.id.toLowerCase()
const nameLower = setting.name.toLowerCase()
const translatedName = t(
`settings.${normalizeI18nKey(setting.id)}.name`
const translatedName = st(
Copy link
Member

Choose a reason for hiding this comment

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

Switch t to st here as extension registered settings might not have translation.

@huchenlei huchenlei changed the title Add category-based filtering and assign Locale category to Comfy.Locale for locale-based filtering Add category-based filtering Dec 30, 2024
@huchenlei huchenlei changed the title Add category-based filtering Add category-based filtering in settings search Dec 30, 2024
@huchenlei huchenlei merged commit be7e2c6 into main Dec 30, 2024
10 checks passed
@huchenlei huchenlei deleted the search-categories branch December 30, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants