fix: improve table search #252
Merged
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.
Clickup id: 86adby503
This PR improves the global filtering logic for table rows. In the case where the string starts with
http://, the global filtering function only looks to see if the key is contained in the search query. In all other cases, the function looks to see if the search query is contained in the value of each cell in a row (except for the name cell, which will always also be in the file path cell).As part of this change, I added an
accessorFnto make thedisplayPaththe cell value for the file path cell, as opposed to just the file subpath, as it was previously. this was necessary to enable searching against the full, correctly formatted based on user preferences file path, as opposed to thefsp_nameandpath. This, in turn, required moving thelinksColumnsdefinition into a hook, to be able to access the needed contexts. This then required also required memoizing the links columns definition to prevent infinite re-renders.@krokicki