Skip to content

Expose search string capability #430

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

Open
downright-development opened this issue Apr 6, 2025 · 2 comments
Open

Expose search string capability #430

downright-development opened this issue Apr 6, 2025 · 2 comments
Assignees

Comments

@downright-development
Copy link

Is your feature request related to a problem? Please describe.
I would love to see a feature where the tree-sorting can happen through a provided search string, this would allow separate components (like a search bar) above the tree to filter the content.

For now, I can simply filter the data in a custom provider and re-shake the tree rendering, but this seems unnecessary :)

Describe the solution you'd like
Expose a tree prop of "searchString"
... even cooler, expose a "search function" that would allow the user to search more than just a title

Describe alternatives you've considered
Searching is built into the tree, but it's not overly intuitive for folks used to accessibility.

@lukasbach
Copy link
Owner

There already exists functionality where users can enter search keywords and the tree visualizes search results over normal results, can you elaborate how your suggestion differs from that? Do I understand it correct that you suggest the tree should not visualize search-hits, but rather filter out non-hits in the search results and only render those items that are matched?

@downright-development
Copy link
Author

downright-development commented Apr 18, 2025

There already exists functionality where users can enter search keywords and the tree visualizes search results over normal results, can you elaborate how your suggestion differs from that? Do I understand it correct that you suggest the tree should not visualize search-hits, but rather filter out non-hits in the search results and only render those items that are matched?

Yes -

https://github.com/brimdata/react-arborist?tab=readme-ov-file#tree-filtering

Similar to another react tree library, I can supply a search function and a search string - this allows me to search on some metadata on the row itself like tags, alongside the name/title of the row too :).

In Arborist, leveraging the search function will show the items (plus its parents) for matches.

This search string would be set in something separate from the tree itself.

Consider this sketch:

Image

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

No branches or pull requests

2 participants