feat: Add switch task form support - #451
Open
lornakelly wants to merge 2 commits into
Open
lornakelly wants to merge 2 commits into
lornakelly wants to merge 2 commits into
Conversation
Signed-off-by: lornakelly <lornakelly88@gmail.com>
✅ Deploy Preview for openworkflow-editor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved critical findings include prototype-key data loss and missing context updates that break typechecking.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (3)
What changed in this PR
Adds dynamic form support for switch-task cases using ordered-map descriptors, editable case rows, and array-aware draft handling.
Changes:
- Adds ordered-map detection and JSON fallback for arrays.
- Adds draft pruning for cleared switch-case fields.
- Updates form context, controls, styling, Storybook coverage, tests, and release notes.
Unresolved findings include prototype-key data loss, an RHF key collision, and missing context updates that break typechecking.
| File | Summary |
|---|---|
packages/open-workflow-diagram-editor/tests/side-panel/forms/OrderedMapRow.test.tsx |
Tests ordered-map rendering and editing. |
packages/open-workflow-diagram-editor/tests/side-panel/forms/OneOfFieldRow.test.tsx |
Updates form context fixtures. |
packages/open-workflow-diagram-editor/tests/side-panel/forms/customFields/StringControl.test.tsx |
Updates expression context fixtures. |
packages/open-workflow-diagram-editor/tests/side-panel/forms/customFields/NumberControl.test.tsx |
Updates form context fixtures. |
packages/open-workflow-diagram-editor/tests/side-panel/forms/customFields/KeyValueMapField.test.tsx |
Updates form context fixtures. |
packages/open-workflow-diagram-editor/tests/side-panel/EditFormFooter.switchTask.test.tsx |
Tests committed switch-case edits. |
packages/open-workflow-diagram-editor/tests/core/taskDraft.test.ts |
Tests array draft handling and pruning. |
packages/open-workflow-diagram-editor/tests/core/schemaToFormFields.test.ts |
Tests array descriptor generation. |
packages/open-workflow-diagram-editor/stories/nested-editing/NestedEditing.stories.tsx |
Enables the editable switch-case story. |
packages/open-workflow-diagram-editor/src/side-panel/SidePanel.css |
Styles ordered-map controls. |
packages/open-workflow-diagram-editor/src/side-panel/forms/taskFormContext.ts |
Adds form-path and expression context helpers. |
packages/open-workflow-diagram-editor/src/side-panel/forms/TaskForm.tsx |
Supplies expression variant context. |
packages/open-workflow-diagram-editor/src/side-panel/forms/FormField.tsx |
Renders ordered-map case groups. |
packages/open-workflow-diagram-editor/src/side-panel/forms/FieldControl.tsx |
Excludes ordered maps from scalar controls. |
packages/open-workflow-diagram-editor/src/side-panel/forms/customFields/StringControl.tsx |
Handles expression variant clearing. |
packages/open-workflow-diagram-editor/src/side-panel/EditFormFooter.tsx |
Applies ordered-map changes during commit. |
packages/open-workflow-diagram-editor/src/core/taskDraft.ts |
Applies and prunes edited array values. |
packages/open-workflow-diagram-editor/src/core/schemaToFormFields.ts |
Adds ordered-map and JSON array descriptors. |
.changeset/switchTask-form.md |
Records the package release change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: lornakelly <lornakelly88@gmail.com>
lornakelly
force-pushed
the
407/switch-task
branch
from
September 25, 2026 12:06
f18b1b1 to
85baa90
Compare
lornakelly
requested review from
fantonangeli,
handreyrc and
kumaradityaraj
September 25, 2026 12:23
This branch has not been deployed
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.


Closes: #407
Summary
Implements dynamic form support for switch task cases, introducing ordered-map field type for rendering and editing array-based structures like switch cases through form controls.
Verify: Storybook > Nested Editing > Switch Locked Cases
Main Changes
ordered-mapdescriptor kind for arrays of single-key objects where order matters (switch cases).arrayItemsSchema(), now shared by both array detectors.jsontextarea instead of the string fallback for nowapplyDirtyValuestakesformListPathsand prunes empty leaves only there, so clearing a case'swhenremoves the key rather than committingwhen: "".OrderedMapRowrenders one<fieldset>per case onuseFieldArray, withkeyName: "__rhfEntryKey"so a case may be namedid.Out of scope
Notes
Filed a bug to be handled separately for default branch of switch cases: #450