Skip to content

feat: property filter custom operator support#4579

Open
revezard wants to merge 1 commit into
cloudscape-design:mainfrom
revezard:main
Open

feat: property filter custom operator support#4579
revezard wants to merge 1 commit into
cloudscape-design:mainfrom
revezard:main

Conversation

@revezard

@revezard revezard commented Jun 3, 2026

Copy link
Copy Markdown

Description

Adds end-to-end support for custom operators in the Property Filter component. Consumers can define their own operator strings with custom matching logic, display descriptions, and accessible labels.

Key changes:

  • getAllowedOperators now preserves custom operators (appended after known operators in standard display order)
  • getAllowedFreeTextOperators updated to handle extended operator objects and preserve custom operators
  • operatorToDescription checks custom description before built-in i18n, allowing consumers to override predefined operator labels (e.g. > described as "After" for date properties)
  • matchOperator requires word boundary after text-based operators to prevent false matches (e.g. "in" not matching "internal")
  • Token editor resolves custom operator descriptions from filtering properties when in free-text mode
  • Added getOperatorDescription accessor to InternalFilteringProperty

Depends on: cloudscape-design/collection-hooks#151

Related links, issue #, if available: n/a

How has this been tested?

  • Unit tests for operatorToDescription (custom description override, fallback to i18n, unknown operators)
  • Unit tests for getAllowedOperators (custom operators preserved, ordering, duplicates)
  • Unit tests for matchOperator (text-based operator word boundary, case-insensitive matching, symbolic operators unaffected)
  • Unit tests for parseText (text-based operators with space, case-insensitive, no false match on value prefix)
  • Integration test for autosuggest options (custom description in dropdown, override of predefined operator descriptions)
  • Demo page at /#/light/property-filter/property-filter-custom-operator exercising all scenarios
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@revezard revezard requested a review from a team as a code owner June 3, 2026 11:36
@revezard revezard requested review from NathanZlion and removed request for a team June 3, 2026 11:36
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.43%. Comparing base (00a695f) to head (e7b9bd9).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
src/property-filter/i18n-utils.ts 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4579      +/-   ##
==========================================
- Coverage   97.43%   97.43%   -0.01%     
==========================================
  Files         941      941              
  Lines       29692    29717      +25     
  Branches    10791    10801      +10     
==========================================
+ Hits        28930    28954      +24     
- Misses        715      756      +41     
+ Partials       47        7      -40     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant