Repository navigation
feat: add parsing error prop - #569
lornakelly wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: d4bcf7c The changes in this PR will be included in the next version bump. 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
Changing parseErrorDisplay while content is invalid leaves the stale diagram editable, allowing undo/redo to overwrite broken content because the reconciliation effect does not rerun.
1 open issue
What changed in this PR
Adds configurable parsing-error display to the diagram editor so the dual editor can keep the last valid diagram visible during incomplete text edits.
Changes:
- Introduces
"page"and"last-valid"modes, with a stale-diagram notice and undo/redo guards. - Handles workflows that the SDK cannot draw and displays non-YAML error details.
- Enables last-valid mode in the dual editor and adds tests, documentation, and release metadata.
| File | Description |
|---|---|
packages/open-workflow-diagram-editor/tests/test-utils/render-helpers.tsx |
Adds stale-state defaults to mock context. |
packages/open-workflow-diagram-editor/tests/fixtures/workflows.ts |
Adds an untyped-task workflow fixture. |
packages/open-workflow-diagram-editor/tests/diagram-editor/error-pages/ParsingErrorPage.test.tsx |
Tests non-YAML error details. |
packages/open-workflow-diagram-editor/tests/diagram-editor/DiagramEditor.test.tsx |
Covers display modes, recovery, and history guards. |
packages/open-workflow-diagram-editor/tests/core/workflowSdk.integration.test.ts |
Tests workflows the SDK cannot draw. |
packages/open-workflow-diagram-editor/src/styles.css |
Styles the stale notice in both themes. |
packages/open-workflow-diagram-editor/src/store/DiagramEditorContextProvider.tsx |
Retains the last valid model and guards undo/redo. |
packages/open-workflow-diagram-editor/src/store/DiagramEditorContext.tsx |
Exposes stale state through context. |
packages/open-workflow-diagram-editor/src/i18n/locales/en.ts |
Adds stale-notice messages. |
packages/open-workflow-diagram-editor/src/diagram-editor/StaleDiagramNotice.tsx |
Adds a live-region warning component. |
packages/open-workflow-diagram-editor/src/diagram-editor/error-pages/ParsingErrorPage.tsx |
Displays non-YAML error messages. |
packages/open-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx |
Defines the new prop and renders the notice. |
packages/open-workflow-diagram-editor/src/core/workflowSdk.ts |
Converts graph-building failures into parse errors. |
packages/open-workflow-diagram-editor/README.md |
Documents the display modes. |
packages/dual-editor/tests/DualEditor.test.tsx |
Verifies last-valid mode is passed through. |
packages/dual-editor/src/DualEditor.tsx |
Enables last-valid display mode. |
.changeset/parse-error-display.md |
Records package releases and feature summary. |
Review effort: Balanced
d77d5c3 to
53aabdf
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Malformed content updates temporarily unlock undo/redo, allowing a host-triggered undo to restore an old model and overwrite the broken content through onContentChange.
1 open issue
1 resolved since last review
Review effort: Balanced
Signed-off-by: lornakelly <lornakelly88@gmail.com>
53aabdf to
d4bcf7c
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The preflight builds and clones a graph that downstream consumers rebuild, adding redundant synchronous work to every drawable update and increasing typing overhead for large workflows.
1 open issue
1 resolved since last review
Review effort: Balanced
|
@handreyrc @fantonangeli @kumaradityaraj Ready for review again - there is a spacebar issue but that is separate to this PR and fabrizio is looking into it |
kumaradityaraj
left a comment
There was a problem hiding this comment.
This is a nice feature. Looks good.


Summary
Contributes to #235
@netlify/dual-editor
Introduces an optional
parseErrorDisplayprop to control how parsing errors are displayed in the diagram editor. The dual editor now keeps the last valid diagram visible while users type, preventing jarring error page flickers. It still displays node errors as before on diagram. The standalone diagram editor keeps the same behaviour as beforeMain Changes
parseErrorDisplayprop toDiagramEditorwith "page" (default) and "last-valid" modesStaleDiagramNoticecomponent to show warning banner when diagram is out of syncDiagramEditorContextProviderto track stale state and disable undo/redo during parse errorsparseErrorDisplay="last-valid"for better typing experienceBefore
Screen.Recording.2026-11-26.at.12.34.53.mov
After
Screen.Recording.2026-11-26.at.12.36.07.mov