Skip to content

feat(DataTable): add case-sensitivity control for string filters#229

Merged
IzumiSy merged 7 commits intomainfrom
feat/string-filter-case-insensitive
May 1, 2026
Merged

feat(DataTable): add case-sensitivity control for string filters#229
IzumiSy merged 7 commits intomainfrom
feat/string-filter-case-insensitive

Conversation

@IzumiSy
Copy link
Copy Markdown
Contributor

@IzumiSy IzumiSy commented May 1, 2026

Summary

Add a "Case sensitive" checkbox to string filter UI in DataTable.Filters. By default, string filters are case-insensitive (converted to Tailor Platform's regex operator with (?i) prefix). Users can opt into case-sensitive matching by checking the checkbox.

Screen shot

スクリーンショット 2026-05-01 15 39 31

Behavior

Checkbox state Query variable output Matching
Unchecked (default) { regex: "(?i)..." } Case-insensitive
Checked { contains: "..." } (original operator) Case-sensitive

Operator → Regex Conversion

When case-insensitive (default), each string operator is converted to a regex value:

Original Operator Regex Pattern (value = Alice)
eq (?i)^Alice$
ne (?i)^(?!Alice$).*$
contains (?i)Alice
notContains (?i)^(?!.*Alice).*$
hasPrefix (?i)^Alice
hasSuffix (?i)Alice$
notHasPrefix (?i)^(?!Alice)
notHasSuffix (?i)^(?!.*Alice$).*$

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 1, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@tailor-platform/app-shell@229
npm i https://pkg.pr.new/@tailor-platform/app-shell-sdk-plugin@229
npm i https://pkg.pr.new/@tailor-platform/app-shell-vite-plugin@229

commit: 9dbdc22

@IzumiSy
Copy link
Copy Markdown
Contributor Author

IzumiSy commented May 1, 2026

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated by API Design Review for issue #229

Comment thread packages/core/src/types/collection.ts
Comment thread packages/core/src/components/data-table/toolbar.tsx
@IzumiSy IzumiSy changed the title feat(DataTable): add case-insensitive option to string filters feat: add case-sensitivity control for string filters in DataTable May 1, 2026
IzumiSy added 6 commits May 1, 2026 15:58
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
@IzumiSy IzumiSy force-pushed the feat/string-filter-case-insensitive branch from 7135959 to 09596f8 Compare May 1, 2026 06:59
@IzumiSy IzumiSy changed the title feat: add case-sensitivity control for string filters in DataTable feat(DataTable): add case-sensitivity control for string filters May 1, 2026
@IzumiSy IzumiSy merged commit 642aa1e into main May 1, 2026
4 checks passed
@IzumiSy IzumiSy deleted the feat/string-filter-case-insensitive branch May 1, 2026 08:25
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