Skip to content

Fix custom search attributes inputs for different attribute types#3215

Merged
laurakwhit merged 5 commits intomainfrom
DT-3653-fix-custom-search-attributes-inputs
Mar 10, 2026
Merged

Fix custom search attributes inputs for different attribute types#3215
laurakwhit merged 5 commits intomainfrom
DT-3653-fix-custom-search-attributes-inputs

Conversation

@laurakwhit
Copy link
Collaborator

@laurakwhit laurakwhit commented Mar 9, 2026

Description & motivation 💭

Custom search attribute input was not updating based on the attribute type in the "Start a Workflow" form. E.g when selecting a custom search attribute with a Bool type, the value input stayed as a text input instead of switching to a true/false select.

  • Introduced local $state variables (type, value, label) instead of reading directly from attribute (which isn't deeply reactive through $bindable())
  • All inputs now bind:value to local state, with an $effect syncing value back to attribute.value only when the local state value changes
  • handleAttributeChange updates local state first, then reassigns attribute = { label, value, type } to notify the parent
  • Changed $derived(attributesToAdd) to $derived([...attributesToAdd]) so that when a child updates its attribute via binding, the derived value produces a new array reference, causing all rows to receive updated attributes and re-evaluate isDisabled
  • Added integration tests for custom search attributes

Screenshots (if applicable) 📸

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

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

Setup

  1. Ensure you have custom search attributes configured (Bool, Keyword, Int, Double, Datetime, KeywordList types)
  2. Navigate to /workflows/start-workflow page
  3. Click "More options" to expand the search attributes section

  • Click "Add" to add a search attribute row

    • Select a Bool attribute → verify a true/false select appears and a value can be entered
    • Select a Keyword attribute → verify a text input appears and a value can be entered
    • Select an Int attribute → verify a number input appears and a value can be entered
    • Select a Datetime attribute → verify a datetime input appears and a value can be entered
    • Select a KeywordList attribute → verify a chip input appears and a value can be entered
  • Click the close button on the rows

    • Verify the attributes are removed
  • Select a Keyword attribute

    • Change to Bool → verify text input is replaced with true/false Select
    • Change to Int → verify Select is replaced with number input
    • Change back to Keyword → verify number input is replaced with text input
  • Add a row and select a Bool attribute

    • Add a second row → open the "Search Attribute" select → verify the Bool option is disabled/greyed out
    • Verify the other attributes are still selectable
    • In the first row, change from the Bool attribute to the Keyword attribute → open the second row's "Search Attribute" select → verify the Bool attribute option is now enabled and the Keyword attribute is disabled

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

DT-3653

Docs

Any docs updates needed?

@vercel
Copy link

vercel bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Mar 10, 2026 3:54pm

Request Review

@temporal-cicd
Copy link
Contributor

temporal-cicd bot commented Mar 9, 2026

Warnings
⚠️

📊 Strict Mode: 2 errors in 1 file (0.2% of 1109 total)

src/lib/components/workflow/add-search-attributes.svelte (2)
  • L30:6: Type '{ type: "Unspecified" | "Keyword" | "Text" | "Int" | "Double" | "Bool" | "KeywordList" | "Datetime"; label: string; value?: any; } | { label: null; value: null; type: "Unspecified"; }' is not assignable to type '{ type: "Unspecified" | "Keyword" | "Text" | "Int" | "Double" | "Bool" | "KeywordList" | "Datetime"; label: string; value?: any; }'.
  • L31:8: Type 'null' is not assignable to type 'string'.

Generated by 🚫 dangerJS against 14e41a2

@laurakwhit laurakwhit marked this pull request as ready for review March 10, 2026 15:34
@laurakwhit laurakwhit requested review from a team and rossedfort as code owners March 10, 2026 15:34
@laurakwhit laurakwhit merged commit 93f0e8f into main Mar 10, 2026
18 checks passed
@laurakwhit laurakwhit deleted the DT-3653-fix-custom-search-attributes-inputs branch March 10, 2026 17:57
temporal-cicd bot pushed a commit that referenced this pull request Mar 10, 2026
Auto-generated version bump from 2.47.2 to 2.47.3

Bump type: patch

Changes included:
- [`115e9f4f`](115e9f4) always show create schedule button when 0 schedules (#3205)
- [`ee254fb1`](ee254fb) Revert Count Schedules API (#3203)
- [`954c647e`](954c647) Codefreeze 03.02.26 to main (#3213)
- [`93f0e8f4`](93f0e8f) Fix custom search attributes inputs for different attribute types (#3215)
laurakwhit added a commit that referenced this pull request Mar 10, 2026
Auto-generated version bump from 2.47.2 to 2.47.3

Bump type: patch

Changes included:
- [`115e9f4f`](115e9f4) always show create schedule button when 0 schedules (#3205)
- [`ee254fb1`](ee254fb) Revert Count Schedules API (#3203)
- [`954c647e`](954c647) Codefreeze 03.02.26 to main (#3213)
- [`93f0e8f4`](93f0e8f) Fix custom search attributes inputs for different attribute types (#3215)

Co-authored-by: laurakwhit <15069288+laurakwhit@users.noreply.github.com>
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