-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Is your feature request related to a problem? Please describe.
When searching and filtering tree data, nodes that match the search criteria are not visible if their parent nodes are collapsed. This creates a poor user experience as users cannot immediately see all search results and must manually expand multiple parent nodes to find the matching items.
For example, if I search for "item-3-2" which is nested under "folder-1/folder-2/folder-3", I cannot see the result unless all parent folders are already expanded.
Describe the solution you'd like
I would like to implement two key features:
-
Enhanced Search Functionality:
- Automatically expand parent nodes when their children match search criteria
- Highlight matched nodes for better visibility
- Show breadcrumb path for deeply nested search results
-
Virtualization Support:
- Implement virtual scrolling to handle large data sets efficiently
- Only render visible nodes to improve performance
- Maintain smooth scrolling even with expanded search results
Describe alternatives you've considered
- Implementing a separate search results panel that shows matched items in a flat list
- This would work but breaks the hierarchical context of the tree
- Only showing matched nodes and their direct parents
- This would be simpler but might lose important context from the tree structure
Additional context
This enhancement would significantly improve the usability of the tree component, especially for large data sets where users need to quickly find specific items in a deep hierarchy. The current implementation requires too many manual interactions to view search results.
For the virtualization feature, I plan to utilize the react-window library, which is well-maintained and provides excellent performance for handling large lists and grid layouts. This library would help us implement efficient virtual scrolling while maintaining smooth performance even with expanded trees containing many nodes.
I would greatly appreciate your feedback on this feature request. If you think this would be a valuable addition to the library, I would be happy to contribute to its implementation. Please let me know if you would like me to proceed with this enhancement and if you have any specific guidelines or considerations I should keep in mind while implementing these features.