Conversation
…ow warning when sub-files can't be resolved Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-editor/sessions/cde0510e-a5f2-413a-8ccb-0d0493cb622c Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
…olidate file collection logic Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-editor/sessions/cde0510e-a5f2-413a-8ccb-0d0493cb622c Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
application: structure on round-trip, warn when sub-files unresolvable
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for the ApplicationConfig YAML format (application: with workflows[].file references) so the editor can preserve that structure across import → edit → export, and provides user-facing warnings when referenced sub-files can’t be resolved/rendered.
Changes:
- Add
ApplicationConfigMetaand persist_applicationConfigmetadata through parsing, import resolution, store round-trip, and export. - Teach serialization/export paths (
configToYaml,exportMainFileYaml/exportToFiles) to emitapplication:YAML when appropriate, plus add a dedicatedbuildApplicationConfigYamlhelper. - Add/adjust tests to validate ApplicationConfig detection and round-trip behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/serialization.ts | Detect application: format, preserve metadata through resolveImports, and add ApplicationConfig YAML emit paths. |
| src/utils/serialization-multifile.test.ts | Update multifile expectations to match application: main-file output. |
| src/utils/serialization-applicationconfig.test.ts | New comprehensive test suite for ApplicationConfig recognition and round-tripping. |
| src/utils/index.ts | Re-export buildApplicationConfigYaml. |
| src/types/workflow.ts | Define ApplicationConfigMeta and add _applicationConfig to WorkflowConfig. |
| src/stores/workflowStore.ts | Preserve ApplicationConfig metadata in store import/export and clear it on reset. |
| src/components/WorkflowEditor.tsx | Warn when ApplicationConfig is detected but full resolution/rendering isn’t possible. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // ApplicationConfig format detected but no file resolver provided — warn the user | ||
| // rather than silently converting the format. | ||
| if (config._applicationConfig && !sourceMapProp) { | ||
| addToast( | ||
| 'ApplicationConfig format detected. Configure a workspace file resolver to render the full application graph from referenced sub-files.', | ||
| 'warning', | ||
| ); | ||
| } |
There was a problem hiding this comment.
The warning is meant to trigger when ApplicationConfig is detected but onResolveFile is not provided. This check uses !sourceMapProp, which can suppress the warning when a host passes a sourceMap but no resolver (still cannot resolve referenced sub-files). Consider keying this warning off !onResolveFile (and optionally also when resolver returns missing files).
|
@copilot apply changes based on the comments in this thread |
… warning condition, strengthen test assertion Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-editor/sessions/365aa754-1dd3-4dce-8884-3575138941a1 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Applied all four review comments in commit
|
|
@copilot Address the merge conflicts intelligently, ensure all tests still pass. |
…hrough, and preserve ApplicationConfig format - Keep both _applicationConfig and _extraTopLevelKeys on WorkflowConfig - Replace applicationConfig store field with importedPassthrough (master's approach) - Explicitly reattach _applicationConfig in exportToConfig from importedPassthrough - Integrate KNOWN_TOP_LEVEL_KEYS and extractExtraTopLevelKeys from master alongside buildApplicationConfigYaml and isMetadataOnlyApplicationConfig from our branch - Use master's buildMainFileContent (delegate to configToYaml); clear workflows/triggers in mainOnlyConfig for ApplicationConfig format so isMetadataOnlyApplicationConfig works correctly on the merged config - All 4055 tests pass Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-editor/sessions/a1a28ad8-429d-4928-80f4-956801c8d6b4 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Resolved in commit
All 4055 tests pass. |
Opening an
ApplicationConfig-format YAML (application:top-level key withworkflows[].filereferences) silently converted it to flatWorkflowConfigon the firstonChangeevent and rendered no sub-file nodes.Root causes
parseYaml/parseYamlSafedidn't recognize theapplication:format — returned an empty config, triggering a silent rewrite on exportconfigToYaml,exportMainFileYaml, andbuildMainFileContenthad no path to emitapplication:format — always produced flatWorkflowConfigwithimports:WorkflowStore.exportToConfig()callednodesToConfig()which strips all metadata, losing ApplicationConfig identity across the round-tripChanges
src/types/workflow.tsApplicationConfigMetainterface (name?,version?,workflows: [{file}])_applicationConfig?: ApplicationConfigMetatoWorkflowConfig(alongside master's_extraTopLevelKeys)src/utils/serialization.tsparseYaml/parseYamlSafe: detectapplication:format; populate_applicationConfig,imports,name,versionresolveImports: set_applicationConfigon the returned merged config so format identity survives sub-file resolutionbuildApplicationConfigYaml(new export): round-tripsApplicationConfigMeta→application:YAMLisMetadataOnlyApplicationConfig(new): returns true when config has no real main-file modules/workflows/triggers/pipelinesconfigToYaml: delegates tobuildApplicationConfigYamlonly when_applicationConfigis present and the config is metadata-only; falls back to full WorkflowConfig serialization otherwise so top-level content is never droppedbuildMainFileContent: delegates toconfigToYaml(preserving_extraTopLevelKeysand_originalKeysordering); clears sub-file-ownedworkflows/triggersfrom the main-file view for ApplicationConfig configs soisMetadataOnlyApplicationConfigcorrectly identifies the main file;importedFilesnaturally excludes unresolvable sub-files (files not present infileModules/filePipelines) preventing empty YAML overwritessrc/stores/workflowStore.tsimportedPassthrough(from master) to carry all non-visual fields — including_applicationConfig— through the import/export cycle;exportToConfigexplicitly reattaches_applicationConfigfromimportedPassthroughafternodesToConfigsrc/components/WorkflowEditor.tsx!onResolveFile(not!sourceMapProp) so it fires correctly when a host passes a static sourceMap but no resolverExample
Two existing tests updated to assert
application:format (previously assertedimports:); 22 new tests added inserialization-applicationconfig.test.tscovering ApplicationConfig detection, round-trip, metadata-only guard, and empty-file filtering.