Skip to content

feat: handle blank canvas state in Diagram Editor - #535

Open
kumaradityaraj wants to merge 9 commits into
open-workflow-specification:mainfrom
kumaradityaraj:blankCanvas
Open

kumaradityaraj wants to merge 9 commits into
open-workflow-specification:mainfrom
kumaradityaraj:blankCanvas

Conversation

@kumaradityaraj

Copy link
Copy Markdown
Contributor

closes - #418

Summary

  • Add a localized empty state for blank or whitespace-only workflow content.
  • Show a loading status while updated content is being parsed, avoiding a transient parsing error during empty-to-valid transitions.
  • Add tests for blank content and transitions between empty and populated diagrams.

Screenshot

Screenshot 2026-11-12 at 1 40 52 PM

Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:11
@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1b97f39

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@openworkflowspec/diagram-editor Minor
@openworkflowspec/core Minor
@openworkflowspec/i18n Minor

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 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openworkflow-editor ready!

Built without sensitive environment variables

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

Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>

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

Loading a workflow through the ref from a blank editor leaves the canvas hidden, while missing backgrounds make empty and loading state text unreadable in dark mode on white hosts.

2 open issues
What changed in this PR

Adds blank-canvas handling to the Diagram Editor for issue #418, giving users guidance when workflow content is empty.

Changes:

  • Adds localized empty-state guidance and a loading status.
  • Tracks parse completion to avoid transient parsing errors.
  • Tests blank-content transitions and updates dual-editor test mocks.
File Description
packages/​open-workflow-diagram-editor/​tests/​test-utils/​render-helpers.tsx Adds parse-completion state to mock context.
packages/​open-workflow-diagram-editor/​tests/​diagram-editor/​DiagramEditor.test.tsx Tests blank content and empty/populated transitions.
packages/​open-workflow-diagram-editor/​src/​styles.css Styles empty and loading states for both themes.
packages/​open-workflow-diagram-editor/​src/​store/​DiagramEditorContextProvider.tsx Tracks content processed through props and imperative loading.
packages/​open-workflow-diagram-editor/​src/​store/​DiagramEditorContext.tsx Exposes processed content in the context type.
packages/​open-workflow-diagram-editor/​src/​i18n/​locales/​en.ts Adds English empty-state and loading messages.
packages/​open-workflow-diagram-editor/​src/​diagram-editor/​DiagramEditor.tsx Selects empty, loading, error, or diagram views.
packages/​dual-editor/​tests/​DualEditor.test.tsx Replaces state-based textarea mocks with ref-backed mocks.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:15

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.

🔵 Needs a closer look

The blank-prop check keeps the empty state visible after a successful imperative setContent call, hiding the loaded workflow and breaking the documented loading API.

2 open issues

Review effort: Balanced

Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:23

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.

🔵 Needs a closer look

Human assessment is needed because the tests check only the post-effect DOM and cannot rule out a transient parsing-error alert during the blank-to-valid transition.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:34

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.

🔵 Needs a closer look

Human assessment is needed because the regression test can pass when the wrapper mounts, before workflow nodes render or asynchronous layout errors surface.

No open issues 🎉

Review effort: Balanced

Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:45

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.

🟢 Approval recommended

No active review issues are recorded for the blank-canvas handling change.

No open issues 🎉

Review effort: Balanced

Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 08:56
Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>

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.

🟢 Approval recommended

No active review issues are reported for the Diagram Editor’s blank-canvas and content-transition changes.

No open issues 🎉

Review effort: Balanced

@lornakelly

Copy link
Copy Markdown
Collaborator

Thanks @kumaradityaraj , one very small comment on wording

Signed-off-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 08:21

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.

🟢 Approval recommended

No active review issues block the Diagram Editor’s blank-canvas and loading-state improvements.

No open issues 🎉

Review effort: Balanced

@kumaradityaraj

kumaradityaraj commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

@lornakelly ready for review again.

@lornakelly lornakelly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

4 participants