Skip to content

fix(ui): set defaultValue to null for empty strings in workflow variable creation and updates [FLOW-DEV-30]#2017

Draft
billcookie wants to merge 11 commits into
mainfrom
FLOW-UI-30
Draft

fix(ui): set defaultValue to null for empty strings in workflow variable creation and updates [FLOW-DEV-30]#2017
billcookie wants to merge 11 commits into
mainfrom
FLOW-UI-30

Conversation

@billcookie
Copy link
Copy Markdown
Contributor

@billcookie billcookie commented Mar 25, 2026

Overview

Updates workflow-variable persistence in the Editor UI so that an empty-string defaultValue is sent as null during create/update operations (likely to represent “unset” more explicitly).

What I've done

  • Convert defaultValue === "" to null when building creates payloads for batch updates.
  • Convert defaultValue === "" to null when building updates payloads for batch updates.
  • Convert defaultValue === "" to null onAdd` for single workflow variable creation (if creates fails).
  • Convert defaultValue === "" to null onChange` for single workflow variable creation (if updates fails).

What I haven't done

How I tested

Screenshot

Which point I want you to review particularly

Memo

@billcookie billcookie marked this pull request as ready for review March 25, 2026 23:07
@billcookie billcookie requested a review from KaWaite as a code owner March 25, 2026 23:07
Copilot AI review requested due to automatic review settings March 25, 2026 23:07
@github-actions github-actions Bot added the ui label Mar 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates workflow-variable persistence in the Editor UI so that an empty-string defaultValue is sent as null during create/update operations (likely to represent “unset” more explicitly).

Changes:

  • Convert defaultValue === "" to null when building creates payloads for batch updates.
  • Convert defaultValue === "" to null when building updates payloads for batch updates.
Comments suppressed due to low confidence (1)

ui/src/features/Editor/components/OverlayUI/components/Homebar/components/WorkflowVariablesDialog/hooks.ts:268

  • creates currently sets index: localWorkflowVariables.length for every new variable. If multiple variables are created (or temp variables are reordered before submit), this sends the same index for each create and can produce incorrect ordering server-side. Consider deriving the index per created variable based on its current position in localWorkflowVariables (or base existing count + map index).
          type: change.workflowVariable.type,
          required: change.workflowVariable.required,
          publicValue: change.workflowVariable.public,
          index: localWorkflowVariables.length,
        }));

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 25, 2026

🚀 Cloud Run Preview Deployed

🔗 Click here to open the preview in a new tab

@billcookie billcookie changed the title fix(ui): set defaultValue to null for empty strings in workflow variable creation and updates [FLOW-UI-30] fix(ui): set defaultValue to null for empty strings in workflow variable creation and updates [FLOW-DEV-30] Mar 29, 2026
@KaWaite KaWaite marked this pull request as draft March 30, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants