Repository navigation
feat: support negated text filters and search with "!" prefix - #549
Open
Zufallsgenerat0r wants to merge 1 commit into
Open
Zufallsgenerat0r wants to merge 1 commit into
Zufallsgenerat0r wants to merge 1 commit into
Conversation
Column filters and the search box on the Activity/History views only supported include-style substring matching (LIKE '%term%'). A leading "!" now inverts the match so e.g. "!alice" excludes that user. - db-helper: parseTextFilter() handles the "!" prefix; buildFilterList uses it for filter.value. A bare "!" or empty term applies no filter instead of excluding everything while the user is still typing. - buildWhereClause renders NOT LIKE as (col IS NULL OR col NOT LIKE $n) so rows with a NULL column (Client, DeviceName, RemoteEndPoint can be NULL) are kept by an exclusion filter; plain NOT LIKE would drop them. - buildSearchCondition() replaces the six inline search LIKE blocks in api.js/stats.js so the search box gets the same behaviour. - Fix latent aliasing bug in buildFilterList: the CTE copy of a text filter mutated the same object already pushed to query.where, which left one bound parameter unreferenced. - Activity table text columns show a placeholder hint for the "!" syntax (new en-GB key ACTIVITY_TABLE.FILTER_EXCLUDE_HINT). Closes CyferShepard#545
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #545
Column filters and the search box only supported include-style substring matching (
LIKE '%term%'). A leading!now inverts the match:!aliceexcludes that user.parseTextFilter()/buildSearchCondition()indb-helper.jshandle the prefix. Only string values are parsed; booleans/numbers (e.g. the documentedIsPaused: false) are ignored as before.NOT LIKEis rendered NULL-safe:(col IS NULL OR col NOT LIKE $n), so rows with a NULL Client/DeviceName/IP are kept by an exclusion filter.!applies no filter (avoids excluding everything while typing).LIKEsites inapi.js/stats.jsuse the shared helper, so the search box gets the same behaviour.buildFilterList: the CTE copy of a text filter mutated the same object already pushed toquery.where, leaving one bound parameter unreferenced.ACTIVITY_TABLE.FILTER_EXCLUDE_HINT, other locales fall back).Test plan
!alice→ alice rows gone, rows with NULL Client/Device still presentalice→ unchanged include behaviour!→ no filtering applied!breaking→ titles without "breaking"getLibraryItemsWithStats)!foo