Skip to content

Conversation

@allison-truhlar
Copy link
Collaborator

@allison-truhlar allison-truhlar commented Nov 20, 2025

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 accessorFn to make the displayPath the 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 the fsp_name and path. This, in turn, required moving the linksColumns definition 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

- this was necessary to enable searching against the file path, as opposed to the fsp name and path (the fsp name does not equal the way the full path is displayed)
- this required moving the linksColumns into a hook, to access the contexts.
- it also required memoizing the links columns to ensure a stable reference for the table and prevent infinite re-renders
- decides which comparison to make based on the relative length of the two values. For example, if someone pastes a full data URL, you want to see if the cell value is contained in the query, not the other way around. But if there are only a couple of letters in the search, you want to see if the query is contained in the cell value
- also added preferenceQuery to the loading conditions because the path preference was not loading before the proxied paths, and so the preferred display path was not calculating correctly
@allison-truhlar allison-truhlar requested review from neomorphic and removed request for neomorphic November 20, 2025 15:18
- since URLs are the use case where we need to match a longer string to a shorter value, and now we're only matching these by key, no need for this two-way check. Can simply check if the query is part of the cell value
@allison-truhlar allison-truhlar merged commit 2cd087a into main Nov 20, 2025
7 checks passed
@allison-truhlar allison-truhlar deleted the fix-search-in-tables branch November 20, 2025 22:11
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

Successfully merging this pull request may close these issues.

2 participants