Skip to content

Comments

Add generic searchable list to back settings and extensions#18838

Merged
chrstnb merged 6 commits intomainfrom
cb/genericlist
Feb 12, 2026
Merged

Add generic searchable list to back settings and extensions#18838
chrstnb merged 6 commits intomainfrom
cb/genericlist

Conversation

@chrstnb
Copy link
Collaborator

@chrstnb chrstnb commented Feb 11, 2026

Summary

In order to support searchable extensions list, genericize the searchable list component

Details

Related Issues

Part of https://github.com/orgs/google-gemini/projects/33/views/17?pane=issue&itemId=3903695497&issue=google-gemini%7Cmaintainers-gemini-cli%7C1323

How to Validate

Run locally and validate that /settings still functions normally

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@chrstnb chrstnb requested review from a team as code owners February 11, 2026 19:29
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 introduces a new, reusable SearchableList component, designed to provide generic fuzzy search capabilities for various list-based UI elements. The SettingsDialog component has been refactored to leverage this new component, significantly reducing its complexity by abstracting away the search implementation details. This change promotes code reusability and maintains a consistent search experience across different parts of the application, while also updating documentation to reflect the maturity of settings functionality.

Highlights

  • New SearchableList Component: A new generic React component, SearchableList, was introduced to encapsulate fuzzy search functionality for lists, promoting reusability.
  • Refactored SettingsDialog: The existing SettingsDialog component was updated to utilize the new SearchableList component, abstracting away its internal search logic and related UI calculations.
  • Documentation Update: An outdated note in the documentation, which previously marked extension settings as an experimental feature, was removed.
Changelog
  • docs/extensions/reference.md
    • Removed a note indicating that extension settings are an experimental feature.
  • packages/cli/src/ui/components/SettingsDialog.tsx
    • Removed direct AsyncFzf import and related search state management.
    • Eliminated useTextBuffer and useUIState imports related to search.
    • Replaced the direct use of BaseSettingsDialog with the new SearchableList component.
    • Removed search-related useEffect hooks and useMemo calculations for label width.
  • packages/cli/src/ui/components/shared/SearchableList.test.tsx
    • Added a new test file for the SearchableList component, covering rendering, filtering, and search callbacks.
  • packages/cli/src/ui/components/shared/SearchableList.tsx
    • Added a new SearchableList React component that wraps BaseSettingsDialog.
    • Implemented internal state for searchQuery and filteredKeys.
    • Integrated AsyncFzf for fuzzy searching and useTextBuffer for search input.
    • Calculated maxLabelWidth internally for consistent item alignment.
Activity
  • No specific activity (comments, reviews, progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the settings dialog to use a new generic SearchableList component, centralizing search logic and improving modularity. The documentation for extensions has also been updated to reflect that settings are no longer experimental. The new SearchableList component includes basic tests for its functionality. Additionally, a high-severity issue regarding unhandled promise rejections in the SearchableList component has been identified and should be addressed.

};

// eslint-disable-next-line @typescript-eslint/no-floating-promises
doSearch();
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The doSearch async function in useEffect does not handle potential rejections from fzfInstance.find(searchQuery). An unhandled promise rejection could lead to unexpected behavior or application crashes. Consider adding a .catch() block to handle errors gracefully, perhaps by logging the error and resetting the filtered keys to the full list.

    doSearch().catch((error) => {
      console.error("Search failed:", error);
      setFilteredKeys(items.map((i) => i.key)); // Reset to all items on error
    });

@gemini-cli gemini-cli bot added the priority/p1 Important and should be addressed in the near term. label Feb 11, 2026
@github-actions
Copy link

github-actions bot commented Feb 11, 2026

Size Change: +554 B (0%)

Total Size: 24.4 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.4 MB +554 B (0%)
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 11, 2026
Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@chrstnb chrstnb enabled auto-merge February 12, 2026 20:38
@chrstnb chrstnb added this pull request to the merge queue Feb 12, 2026
Merged via the queue into main with commit 991b2c6 Feb 12, 2026
27 checks passed
@chrstnb chrstnb deleted the cb/genericlist branch February 12, 2026 21:06
chrstnb added a commit that referenced this pull request Feb 13, 2026
@jackwotherspoon
Copy link
Contributor

@chrstnb @jacob314 potential regression caused by this PR

In /settings the j and k keys now navigate up and down the list instead of typing in the search field.

It is impossible to type a j and k in the search field now, while several of our settings use these letters...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p1 Important and should be addressed in the near term. status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants