Skip to content

Adds a Contains option to the search-attribute filter dropdown that - #3857

Open
Rasu-Dev wants to merge 1 commit into
temporalio:mainfrom
Rasu-Dev:visibility-like-operator
Open

Adds a Contains option to the search-attribute filter dropdown that#3857
Rasu-Dev wants to merge 1 commit into
temporalio:mainfrom
Rasu-Dev:visibility-like-operator

Conversation

@Rasu-Dev

Copy link
Copy Markdown

translates to a visibility LIKE query:

  • is.ts: recognize like as a filter operator/conditional (isContains)
  • filter-workflow-query / to-list-workflow-filters: build and parse LIKE "%value%" expressions
  • dropdown-filter-chip: show the Contains option; en locale string

Requires server-side LIKE support (companion server PR).

image

Description & motivation 💭

Adds a Contains option to the search-attribute filter dropdown for Keyword search attributes. Selecting it builds a visibility query using the LIKE operator with the value wrapped in % wildcards (e.g. `CustomKeywordField` LIKE "%payment%"), enabling substring filtering.

Today the dropdown only offers exact match (=, !=) and Starts with (STARTS_WITH) for Keyword attributes, so there is no way to filter by "value appears anywhere in the attribute". This is especially useful for filtering workflows/schedules whose IDs or custom Keyword attributes embed identifiers mid-string.

Changes:

  • dropdown-filter-chip.svelte — adds the Contains condition option for Keyword attributes and renders the chip label as "contains" (lowercased i18n string), mirroring the existing Starts-with handling.
  • is.ts — recognizes like as a valid operator/conditional and adds an isContains helper.
  • filter-workflow-query.ts — builds `Attr` LIKE "%value%" statements for the Contains conditional.
  • to-list-workflow-filters.ts — parses LIKE statements back into filter chips, stripping the % wildcards so the chip shows the raw user-typed text.
  • en/common.ts — new contains locale string.

⚠️ Requires server-side LIKE support for Keyword attributes: . Against a server without that support, using Contains returns the standard invalid-operator query error.

Design Considerations 🎨

  • "Contains" appears directly below "Starts with" in the condition dropdown, only for Keyword attributes (same gating as Starts with).
  • The chip displays the raw value (wildcards stripped), consistent with how Starts-with chips display.

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Manually verified against a local server build with LIKE visibility support: selecting Contains produces the LIKE "%…%" query, results match substrings, and reloading the page parses the query back into the chip correctly. Unit tests added in filter-workflow-query.test.ts (statement construction, wildcard wrapping) and to-list-workflow-filters.test.ts (parsing LIKE statements, wildcard stripping).

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

  1. Run the UI against a server build that supports LIKE on Keyword search attributes ().
  2. On the Workflows page, add a filter on a Keyword attribute (e.g. WorkflowType or a custom Keyword attribute) and pick Contains from the condition dropdown.
  3. Enter a substring and apply — the query bar shows `Attr` LIKE "%value%" and only workflows containing the substring are listed.
  4. Reload the page (or paste a LIKE query manually) — the filter chip is reconstructed showing the plain value without %.

Docs

Any docs updates needed?

The list-filter docs on docs.temporal.io (supported operators for Keyword attributes) should mention LIKE/Contains once the server-side support ships.

translates to a visibility LIKE query:

- is.ts: recognize `like` as a filter operator/conditional (isContains)
- filter-workflow-query / to-list-workflow-filters: build and parse
  `LIKE "%value%"` expressions
- dropdown-filter-chip: show the Contains option; en locale string

Requires server-side LIKE support (companion server PR).
@Rasu-Dev
Rasu-Dev requested a review from a team as a code owner August 22, 2026 08:03
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

@Rasu-Dev is attempting to deploy a commit to the Temporal Team on Vercel.

A member of the Team first needs to authorize it.

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