feat(search): Switch filter operator from contains to is on dropdown selection#111668
Merged
nsdeschenes merged 6 commits intoMar 31, 2026
Merged
Conversation
… action Extend modifyFilterValue and the UPDATE_TOKEN_VALUE reducer action to accept an optional operator parameter. When provided, the entire filter token is replaced atomically to update both value and operator in a single dispatch, avoiding stale token location issues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a user selects a value from the filter value combobox dropdown, the operator now switches from "contains" to "is". Free-text input continues to use the "contains" operator. For negated filters, "does not contain" switches to "is not" on dropdown selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e operators in modifyFilterValue The internalOp mapping in modifyFilterValue was missing cases for DOES_NOT_START_WITH and DOES_NOT_END_WITH. These operators were handled by the negated flag check above, but the else branch fell through and assigned the raw negative operator as internalOp, producing an invalid replacement string. Add the missing mappings to match the behaviour already present in the companion function modifyFilterOperatorQuery. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a user selects a value from the dropdown, the operator was unconditionally switching from 'contains' to 'is'. This should only happen when the filter has no existing value (i.e. the user is picking their first value on a new filter token). Check token.value.value instead of token.value.text to detect an empty value, since token.value.text is '""' (truthy) for a newly created empty filter while token.value.value is '' (falsy). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ator switch Add a type guard (token.value.type === Token.VALUE_TEXT) before accessing token.value.value to satisfy TypeScript and avoid accessing the property on incompatible value token variants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…e duplicated operator mapping The negated/internalOp mapping from TermOperator existed identically in both modifyFilterOperatorQuery and modifyFilterValue. Consolidate into a single helper.
dashed
pushed a commit
that referenced
this pull request
Apr 1, 2026
…selection (#111668) Tweaking the logic around selecting default operators. When a user selects a value from the dropdown it's likely they're looking for an exact matching value, rather than it containing that value. This PR modifies the query builder logic so that if a user selects a value from the value combobox it'll change it from `contains` to `is`. However, if a user already has a valid contains filter, we do not change the operator if selecting a value afterwards. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Tweaking the logic around selecting default operators. When a user selects a value from the dropdown it's likely they're looking for an exact matching value, rather than it containing that value.
This PR modifies the query builder logic so that if a user selects a value from the value combobox it'll change it from
containstois. However, if a user already has a valid contains filter, we do not change the operator if selecting a value afterwards.Example:
Screen.Recording.2026-03-26.at.16.11.46.mov