Skip to content

feat: add parsing error prop - #569

Open
lornakelly wants to merge 1 commit into
open-workflow-specification:mainfrom
lornakelly:235/parsing-error
Open

lornakelly wants to merge 1 commit into
open-workflow-specification:mainfrom
lornakelly:235/parsing-error

Conversation

@lornakelly

@lornakelly lornakelly commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Contributes to #235

@netlify/dual-editor

Introduces an optional parseErrorDisplay prop 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 before

Main Changes

  • Add parseErrorDisplay prop to DiagramEditor with "page" (default) and "last-valid" modes
  • Implement StaleDiagramNotice component to show warning banner when diagram is out of sync
  • Update DiagramEditorContextProvider to track stale state and disable undo/redo during parse errors
  • Configure DualEditor to use parseErrorDisplay="last-valid" for better typing experience
  • Add tests

Before

Screen.Recording.2026-11-26.at.12.34.53.mov

After

Screen.Recording.2026-11-26.at.12.36.07.mov

Copilot AI balanced review requested due to automatic review settings November 26, 2026 12:37
@changeset-bot

changeset-bot Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest 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

@netlify

netlify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openworkflow-editor ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d4bcf7c
🔍 Latest deploy log https://app.netlify.com/projects/openworkflow-editor/deploys/6b08312cb045366112c69c32
😎 Deploy Preview https://deploy-preview-569--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.

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.

🟡 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

Copilot AI balanced review requested due to automatic review settings November 26, 2026 12:47

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.

🟡 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>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 13:16

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.

🟡 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

@lornakelly

Copy link
Copy Markdown
Collaborator Author

@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 kumaradityaraj 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.

This is a nice feature. Looks good.

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.

3 participants