feat(DataTable): add case-sensitivity control for string filters#229
Merged
feat(DataTable): add case-sensitivity control for string filters#229
Conversation
commit: |
Contributor
Author
|
/review |
Add a "Case insensitive" checkbox to StringFilterEditor in DataTable.Filters. When enabled, the filter is internally converted to a regex operator with (?i) prefix for case-insensitive matching on the Tailor Platform API. Changes: - Add caseInsensitive?: boolean to Filter type - Add regex to OPERATORS_BY_FILTER_TYPE.string - Extend addFilter with filterOptions parameter - Add toCaseInsensitiveRegex helper that converts operator+value to regex - Add checkbox UI in StringFilterEditor - Show (Aa) suffix on filter chip when case-insensitive is active - Add i18n labels (en/ja) for filterCaseInsensitive - Add tests for UI checkbox and regex conversion logic
The checkbox was only in the edit popover (StringFilterEditor). Now also shown in the add-new-filter popover for string type filters.
- Rename caseInsensitive -> caseSensitive on Filter type and options - Default behavior (caseSensitive=false or unset via UI) uses regex (?i) - Checkbox now labeled 'Case sensitive'; checking it opts into exact match - Only triggers regex when caseSensitive is explicitly false (backward compat)
- Add regex operator support (parses (?i) prefix for case-insensitive) - Remove unconditional toLowerCase in matchStringOperator so that case-sensitive mode (original operators) works correctly
7135959 to
09596f8
Compare
davedc
approved these changes
May 1, 2026
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.
Summary
Add a "Case sensitive" checkbox to string filter UI in
DataTable.Filters. By default, string filters are case-insensitive (converted to Tailor Platform'sregexoperator with(?i)prefix). Users can opt into case-sensitive matching by checking the checkbox.Screen shot
Behavior
{ regex: "(?i)..." }{ contains: "..." }(original operator)Operator → Regex Conversion
When case-insensitive (default), each string operator is converted to a
regexvalue:Alice)eq(?i)^Alice$ne(?i)^(?!Alice$).*$contains(?i)AlicenotContains(?i)^(?!.*Alice).*$hasPrefix(?i)^AlicehasSuffix(?i)Alice$notHasPrefix(?i)^(?!Alice)notHasSuffix(?i)^(?!.*Alice$).*$