Revert "Add generic searchable list to back settings and extensions (…#19434
Revert "Add generic searchable list to back settings and extensions (…#19434
Conversation
Summary of ChangesHello @chrstnb, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request reverts a previous change that introduced a generic Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: -487 B (0%) Total Size: 24.5 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request reverts the introduction of a generic searchable list component and its associated hook, moving the fuzzy search logic back into the SettingsDialog component. While the revert aims to restore previous behavior, the manual implementation of search and focus management introduces some inefficiencies and minor regressions in UI behavior, such as non-optimal scroll indicator logic and missing key handling returns. All original comments are kept as they do not contradict any provided rules and offer valid improvements.
| }); | ||
|
|
||
| // Generate items for BaseSettingsDialog | ||
| const settingKeys = searchQuery ? filteredKeys : getDialogSettingKeys(); |
There was a problem hiding this comment.
The settingKeys variable is calculated on every render, and since it's used as a dependency for the items useMemo below, it causes the items array to be re-created every time SettingsDialog renders. This in turn triggers the useEffect in BaseSettingsDialog that manages focus and scroll offsets, leading to unnecessary O(N) computations on every render. Wrapping this logic in a useMemo would improve performance and prevent redundant effect executions.
| const settingKeys = searchQuery ? filteredKeys : getDialogSettingKeys(); | |
| const settingKeys = useMemo(() => searchQuery ? filteredKeys : getDialogSettingKeys(), [searchQuery, filteredKeys]); |
8188b08 to
eedea45
Compare
#19434) Co-authored-by: jacob314 <jacob314@gmail.com>
google-gemini#19434) Co-authored-by: jacob314 <jacob314@gmail.com>
google-gemini#19434) Co-authored-by: jacob314 <jacob314@gmail.com>
google-gemini#19434) Co-authored-by: jacob314 <jacob314@gmail.com>
…#18838)"
This reverts commit 991b2c6.
Summary
Details
Related Issues
How to Validate
Pre-Merge Checklist