-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: implement search functionality in configuration components and update UI #5168
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
Merged
+146
−23
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
issue (bug_risk): 带搜索的分区级可见性在只有 section 元数据匹配时,可能会导致标签页中没有可见内容。
在
shouldShowSection中,通过hasVisibleItems(经由shouldShowItem,会应用搜索过滤)来做要求,这与 wrapper 中已经在使用的visibleSections存在冲突,后者会在 section 元数据和 items 上同时使用sectionHasSearchMatch。这意味着,一个 section 可能因为其描述/提示文本匹配了关键词而被显示,但如果没有任何 item 匹配,shouldShowSection仍然返回 false,最终得到的是一个空标签页。为避免这种不一致,你可以: (1) 在searchKeyword非空时跳过hasVisibleItems检查,并依赖 wrapper 的可见性判断,或者 (2) 将分区级的搜索逻辑移动到当前组件中,让 wrapper 只负责标签页的选择。Original comment in English
issue (bug_risk): Section-level visibility with search can lead to tabs with no visible content when only the section-level metadata matches.
In
shouldShowSection, requiringhasVisibleItems(viashouldShowItem, which applies search filtering) conflicts with the wrapper’svisibleSections, which already usessectionHasSearchMatchon both section metadata and items. This means a section can be shown because its description/hint matches the keyword, butshouldShowSectionstill returns false when no items match, yielding an empty tab. To avoid this mismatch, either: (1) bypass thehasVisibleItemscheck whensearchKeywordis non-empty and rely on the wrapper’s visibility decision, or (2) move the section-level search logic into this component and have the wrapper only manage tab selection.