feat(workflow): one clear condition editor for If/Else#2605
Open
simlarsen wants to merge 1 commit into
Open
Conversation
…acked fields)
Configuring an If/Else step meant filling five generic, manually-type-synced
fields — "Input 1 Type", "Input 1", "Operator", "Input 2 Type", "Input 2" —
with a field description literally reading "This fields takes number, text,
boolean, null, undefined as values." It made you think like the evaluator.
This replaces them, for the If/Else step only, with one readable condition
card: a Value, a plain-English Condition ("is greater than", "contains", …),
and a Compare-with value, each with a compact "treated as" type selector
(defaulting to Text) and the data-reference chip helper. It also states plainly
that a true condition runs the Yes branch, otherwise No.
The editor writes exactly the same argument ids (input-1, input-1-type,
operator, input-2, input-2-type), so the server evaluator
(Conditions/IfElse) is untouched. Confirmed byte-compatible: the server
already defaults an unset operator to "==" and unset types to Text, matching
the editor's defaults — so leaving the sensible defaults writes nothing and
evaluates identically (an improvement over the old flow, which forced an
explicit operator pick). ValueType/Operator input types are used by no other
component, so the special-case is self-contained.
Tests: ConditionBuilder (5 RTL cases — shows current values, writes the legacy
ids on change incl. the type selector, defaults type to Text, and reports
required-value validity). 49 workflow tests pass; tsc + eslint clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another named "worst friction" from the design pass: If/Else's five stacked, manually-type-synced fields. Stacked on #2604 (retargets up the stack as each merges).
Before
Configuring an If/Else step meant filling five generic fields —
Input 1 Type,Input 1,Operator,Input 2 Type,Input 2— where the value field's own description read "This fields takes number, text, boolean, null, undefined as values." You had to think like the evaluator and keep type + value in sync by hand.After
For the If/Else step only, one readable condition card:
Byte-compatibility (server untouched)
The editor writes exactly the same argument ids —
input-1,input-1-type,operator,input-2,input-2-type— soConditions/IfElseis unchanged. Confirmed against the server: it already defaults an unsetoperatorto==and unset types toText(IfElse.ts:66-69, 164), which match the editor's defaults — so leaving the sensible defaults writes nothing and evaluates identically. (This is actually an improvement: the old flow forced an explicit operator pick.)ValueType/Operatorinput types are used by no other component, so the special-case is fully self-contained.Verification
ConditionBuilder.test.tsx(5, RTL/jsdom): shows current values; changing the value / operator / compare-with writes the legacyinput-1/operator/input-2ids; the "treated as" selector writesinput-1-type; the type defaults to Text when unset; required-value validity is reported (blocks Save while empty).tsc✓,eslint✓.🤖 Generated with Claude Code