Repository navigation
Conversation
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
🦋 Changeset detectedLatest commit: 5bfaa2d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for openworkflow-editor ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
🟡 Changes recommended
Nested union collapsing can hide saved URL and expression values, while runtime-expression schema detection can lose labels and disable expression styling; both issues need fixes and regression tests.
2 open issues
What changed in this PR
Simplifies schema-driven side-panel forms for issue #397 by combining string alternatives into one text input while retaining structural choices.
Changes:
- Merges string alternatives with schema-derived labels, captions, placeholders, and expression styling.
- Defers pointer-triggered blur validation to prevent layout shifts during clicks.
- Updates unit, integration, and browser regression coverage.
| File | Description |
|---|---|
| packages/open-workflow-diagram-editor/tests/side-panel/forms/validation/useDeferredFieldValidation.test.ts | Tests deferred validation and cleanup. |
| packages/open-workflow-diagram-editor/tests/side-panel/forms/taskFormContext.test.ts | Updates merged-field sentinel expectations. |
| packages/open-workflow-diagram-editor/tests/side-panel/forms/TaskForm.oneOfLevels.test.tsx | Tests simplified endpoint editing. |
| packages/open-workflow-diagram-editor/tests/side-panel/forms/TaskForm.eventFilters.test.tsx | Adjusts filter option tests. |
| packages/open-workflow-diagram-editor/tests/side-panel/forms/TaskForm.customFields.test.tsx | Tests moving text into merged fields. |
| packages/open-workflow-diagram-editor/tests/side-panel/forms/draft.test.ts | Updates endpoint draft labels. |
| packages/open-workflow-diagram-editor/tests/side-panel/forms/customFields/StringControl.test.tsx | Tests live expression styling. |
| packages/open-workflow-diagram-editor/tests/side-panel/EditFormFooter.variantRoundTrip.test.tsx | Tests endpoint restoration across switches. |
| packages/open-workflow-diagram-editor/tests/side-panel/EditFormFooter.reapply.test.tsx | Updates merged endpoint selector. |
| packages/open-workflow-diagram-editor/tests/side-panel/EditFormFooter.raiseTask.test.tsx | Tests expression retention and accessible captions. |
| packages/open-workflow-diagram-editor/tests/side-panel/EditFormFooter.draftStatus.test.tsx | Updates variant round-trip coverage. |
| packages/open-workflow-diagram-editor/tests/side-panel/EditFormFooter.callHttpEndpoint.test.tsx | Updates endpoint clear-and-apply tests. |
| packages/open-workflow-diagram-editor/tests/fixtures/taskValidation.ts | Adds valid and invalid string-field cases. |
| packages/open-workflow-diagram-editor/tests/core/schemaToFormFields.test.ts | Covers merging, labels, captions, and placeholders. |
| packages/open-workflow-diagram-editor/tests-e2e/expression-clear-apply.spec.ts | Uses the merged endpoint input. |
| packages/open-workflow-diagram-editor/tests-e2e/add-field-after-error.spec.ts | Tests clicks following invalid-field blur. |
| packages/open-workflow-diagram-editor/src/side-panel/SidePanel.css | Styles captions in both themes. |
| packages/open-workflow-diagram-editor/src/side-panel/forms/VariantPicker.tsx | Generalizes an explanatory comment. |
| packages/open-workflow-diagram-editor/src/side-panel/forms/validation/useDeferredFieldValidation.ts | Adds pointer-aware validation deferral. |
| packages/open-workflow-diagram-editor/src/side-panel/forms/validation/index.ts | Exports the new hook. |
| packages/open-workflow-diagram-editor/src/side-panel/forms/TaskForm.tsx | Integrates deferred validation. |
| packages/open-workflow-diagram-editor/src/side-panel/forms/FormField.tsx | Renders string-field captions. |
| packages/open-workflow-diagram-editor/src/side-panel/forms/customFields/StringControl.tsx | Adds dynamic styling and caption linkage. |
| packages/open-workflow-diagram-editor/src/side-panel/forms/customFields/fieldHelpers.tsx | Adds caption ID generation. |
| packages/open-workflow-diagram-editor/src/core/schemaToFormFields.ts | Merges string variants and derives presentation metadata. |
| .changeset/collapse-string-only-one-of.md | Records the minor release change. |
Review effort: Balanced
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>

Closes #397
This PR collapses oneOf variants in a single text field in the scenarios below:
uri(*.endpoint.uri,with.server.uri)uriTemplate/runtimeExpressioncallSecureApi:with.endpoint.urisource(emit,listen)uriTemplate/runtimeExpressionemitEvent:emit.event.with.sourcedataschemauriTemplate/runtimeExpressionemitEvent(optional field)timestring+date-time/runtimeExpressionemitEvent(optional field)raise.error.typeuriTemplate/runtimeExpressionraiseByDefinitionraise.error.instancestring+json-pointer/runtimeExpressionraiseByDefinitionraise.error.titleruntimeExpression/string(any)raiseByDefinitionraise.error.detailruntimeExpression/string(any)raiseByDefinitionauthorityuriTemplateonly (two literal patterns), no expressiongetPet:...oauth2.authorityChanges
oneOf/anyOfalternatives into a single text field in and its tooltip combines the descriptions when present.formatVariantLabel.URIandExpressionlabels are now derived from the schema (a URIformatvia the newisUriSchema, and the runtime-expression pattern). Errortypeand duration expressions now readURI/Expressiontoo.${...}, and a date-time example forformat: date-time).hasExpressionSiblingon string fields withhasExpressionAlternativeand a newcaptionproperty onStringField.StringControlnow styles the input as an expression while its live value matches the runtime-expression pattern. It links the caption througharia-describedby, and only blanks stale literals for expression-only fields.FormFieldrenders the new caption (dec-form-field-caption, styled inSidePanel.css, with dark mode), with acaptionIdhelper infieldHelpers.tsx.useDeferredFieldValidation, used inTaskForm. It holds on-blur validation while a pointer is pressed, so an error appearing on blur can't shift the layout and make a click miss its target (add-field chips, drill rows, remove buttons). Keyboard blur still validates immediately.How to test