Conversation
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
Signed-off-by: Handrey Cunha <handrey.cunha@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.
🟡 Changes recommended
Variant discrimination and unconstrained JSON handling currently produce incorrect form behavior for valid emit data.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds schema-driven emitTask form fields for read-only and edit modes.
Changes:
- Adds emit event field variants and transparent wrapper handling.
- Renders unconstrained variants as key-value maps.
- Adds unit coverage and a minor changeset.
File summaries
| File | Description |
|---|---|
schemaToFormFields.ts |
Extends variant mapping and wrapper elimination. |
schemaToFormFields.test.ts |
Tests emit fields and endpoint variants. |
.changeset/emitTask-form.md |
Records the feature release. |
Review details
Suppressed comments (2)
packages/open-workflow-diagram-editor/src/core/schemaToFormFields.ts:815
- Preserving every all-string variant leaves their discriminators indistinguishable:
buildDiscriminatorreturnstypeof data === "string"for each one, whileOneOfFieldRowselects the first matching variant. Consequently one branch (for example URI versus Expression forsource,dataschema, ortime) can never be auto-selected correctly in read-only mode. These variants need mutually exclusive matching based on the runtime-expression syntax (and any other relevant schema constraints) before they are exposed separately.
const allStrings = resolvedList.every((item) => item.kind === "string");
if (allStrings && resolvedList.length > 1) {
return resolvedList.map((item) => ({
label: item.label,
fields: item.fields,
matchesData: item.matchesData,
}));
packages/open-workflow-diagram-editor/src/core/schemaToFormFields.ts:763
ExpressionDataSchemais relabeled as “Expression” above, but it is not recognized here as a runtime expression (its ref/title isexpressionDataSchema/ExpressionDataSchema, notruntimeExpression/RuntimeExpression). ThedataschemaExpression branch therefore getsisRuntimeExpression: falseand loses the expression placeholder/styling. Include this schema in the runtime-expression detection.
const isRe =
(typeof c.$ref === "string" && c.$ref.includes("runtimeExpression")) ||
resolved.title === "RuntimeExpression" ||
RUNTIME_EXPRESSION_PATTERN.test(String(resolved.pattern ?? ""));
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
handreyrc
force-pushed
the
emitTask-form
branch
from
September 16, 2026 15:26
550c7d3 to
7f18ab4
Compare
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
handreyrc
force-pushed
the
emitTask-form
branch
from
September 16, 2026 15:37
7f18ab4 to
a1ee806
Compare
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
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 #401
This PR introduces full field support to
emitTaskform generation in both read-only and edit mode.Not Addressed in This PR
Changes
emitTaskmulti-level field rendering, includingsource,time,dataschema, anddatavariants.emitTask.How to Test
emitTaskin both read-only and edit mode.