Skip to content

feat: Add full field support to callTask form generation - #452

Open
handreyrc wants to merge 6 commits into
open-workflow-specification:feature/node-editingfrom
handreyrc:call-task-form
Open

handreyrc wants to merge 6 commits into
open-workflow-specification:feature/node-editingfrom
handreyrc:call-task-form

Conversation

@handreyrc

@handreyrc handreyrc commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #399

This PR introduces full field support to callTask form generation in both read-only and edit mode.

Not Addressed in This PR

  • Layered validation (field-level and task-level).

Changes

  • Added full field support for callTask form generation, covering HTTP, MCP, OpenAPI, and AsyncAPI call types with appropriate variants and controls.
  • Extended the schema-to-form-field walker with support for new custom controls and patterns:
    • Added StringListField for string array arguments (e.g. MCP stdio transport arguments).
    • Added McpProtocolVersionField for MCP calendar-date protocol versions.
    • Handled validation-only oneOf discriminator patterns and base-property injection alongside variant-specific properties.
    • Added support for constWrites to automatically write and keep const discriminator properties (e.g. call: "http") in sync with variant selection.
  • Routed structured payload properties (payload, body, data, and as in output/export) to StructuredValueField (JSON/YAML textarea) instead of plain key-value editors or strings.
  • Improved oneOf variant selection and state management, preserving form draft state and dirty tracking across variant switching and draft discards.

How to Test

  • Use call tasks sample workflows from **Examples ** stories in Storybook to validate callTask in both read-only and edit mode.

Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openworkflow-editor ready!

Name Link
🔨 Latest commit c22b193
🔍 Latest deploy log https://app.netlify.com/projects/openworkflow-editor/deploys/6aba74aeb07e96000814a1e0
😎 Deploy Preview https://deploy-preview-452--openworkflow-editor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Root variant cleanup, function-call editing, sentinel restoration, and safe path traversal contain blocking defects.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 High severity · 1 Medium severity · 1 Low severity

Open (5)
What changed in this PR

Adds schema-driven field support for call-task forms, including variant switching, discriminator persistence, structured values, MCP controls, and regression coverage.

Changes:

  • Expands schema-to-form mapping and custom controls.
  • Improves variant state, reset, and dirty tracking.
  • Adds unit, integration, and end-to-end tests.
File Description
.changeset/​callTask-form.md Records the minor feature release.
tests/​test-utils/​render-helpers.tsx Adds reusable form spying helpers.
tests/​test-utils/​index.ts Exports added test utilities.
tests/​test-utils/​edit-helpers.ts Formats editing helpers.
tests/​side-panel/​forms/​padRemovedPaths.test.ts Tests reset-value padding.
tests/​side-panel/​forms/​customFields/​TaskListDisplay.test.tsx Tests task-list rendering.
tests/​side-panel/​forms/​customFields/​StringListField.test.tsx Tests string-list behavior.
tests/​side-panel/​forms/​customFields/​StringControl.test.tsx Extends variant/reset regressions.
tests/​side-panel/​forms/​customFields/​McpProtocolVersionField.test.tsx Tests MCP version input.
tests/​side-panel/​EditFormFooter.emitTask.test.tsx Updates emit-task reset tests.
tests/​side-panel/​EditFormFooter.dirtyCounter.test.tsx Tests phantom dirty counts.
tests/​side-panel/​EditFormFooter.callHttpEndpoint.test.tsx Tests call variant persistence.
tests/​core/​taskDraft.test.ts Tests discriminator writes.
tests/​core/​schemaToFormFields.test.ts Expands schema-walker coverage.
tests-e2e/​expression-clear-apply.spec.ts Covers expression clearing end-to-end.
src/​side-panel/​SidePanel.css Styles task and string lists.
src/​side-panel/​forms/​TaskForm.tsx Pads removed values during resets.
src/​side-panel/​forms/​FormField.tsx Preserves one-of selections.
src/​side-panel/​forms/​FieldControl.tsx Dispatches new controls.
src/​side-panel/​forms/​customFields/​TaskListDisplay.tsx Adds task-list presentation.
src/​side-panel/​forms/​customFields/​StringListField.tsx Adds editable string arrays.
src/​side-panel/​forms/​customFields/​StringControl.tsx Handles cross-variant stale values.
src/​side-panel/​forms/​customFields/​McpProtocolVersionField.tsx Adds MCP version input.
src/​side-panel/​forms/​customFields/​index.ts Exports new controls.
src/​side-panel/​forms/​customFields/​DurationField.tsx Avoids object stringification.
src/​side-panel/​forms/​customFields/​ChildTaskListField.tsx Reuses task-list display.
src/​side-panel/​EditFormFooter.tsx Applies discriminator writes and reset state.
src/​i18n/​locales/​en.ts Adds control translations.
src/​core/​taskDraft.ts Applies selected variant constants.
src/​core/​schemaToFormFields.ts Extends schema-to-field generation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/open-workflow-diagram-editor/src/core/taskDraft.ts
Comment thread .changeset/callTask-form.md
@handreyrc handreyrc self-assigned this Sep 25, 2026
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
@changeset-bot

changeset-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c22b193

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@openworkflowspec/diagram-editor Minor
@openworkflowspec/i18n Minor

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

This branch has not been deployed

No deployments
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