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

Enable category-based narrowing and reset to default on search clear #2071

Merged
merged 3 commits into from
Dec 27, 2024

Conversation

shinshin86
Copy link
Collaborator

@shinshin86 shinshin86 commented Dec 27, 2024

This PR modifies the search behavior in the settings dialog to allow category-based narrowing of results. When a user initiates a search, the activeCategory is set to null, displaying all matching results across categories. Users can then click an enabled category to further refine those matches.

Additional Fix: Text Changes During Search

Previously, certain labels would change unexpectedly when search results were displayed (e.g., "Edit Token Weight" became "EditAttention," as shown in the attached images). This PR resolves that issue, ensuring text remains consistent regardless of whether a search is active.

before:
searched-display-categories_before

after:
searched-display-categories_after

Please review these changes at your convenience, and feel free to share any questions or feedback.
Thank you for your time and support!

Demo video:

filter_setting_result.mp4

@shinshin86 shinshin86 requested a review from a team as a code owner December 27, 2024 07:12
@huchenlei huchenlei force-pushed the searched-display-categories branch from 4d5d7b6 to 1329a3a Compare December 27, 2024 22:57
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.

Nice feature! I basically rewrite the impl for it to be more maintainable. The rule of thumb here is to avoid introducing extra ground states (Vue ref). In the rewrited version, the no extra ref is introduced. (searchResult ref is changed to restore search result setting id).

The extra state on SettingTreeNode to check whether the category is disabled is also simplified. (No extra floating state to maintain)

@huchenlei huchenlei added the enhancement New feature or request label Dec 27, 2024
@huchenlei huchenlei merged commit 20412f2 into main Dec 27, 2024
11 checks passed
@huchenlei huchenlei deleted the searched-display-categories branch December 27, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants