Skip to content

feat: Add error boundary for diagram rendering #124

Open
kumaradityaraj wants to merge 10 commits intoserverlessworkflow:mainfrom
kumaradityaraj:errorBoundary
Open

feat: Add error boundary for diagram rendering #124
kumaradityaraj wants to merge 10 commits intoserverlessworkflow:mainfrom
kumaradityaraj:errorBoundary

Conversation

@kumaradityaraj
Copy link
Copy Markdown
Contributor

closes Error Boundary

Add Error Boundary to Diagram Editor

Introduced a React Error Boundary around the DiagramEditor to handle unexpected runtime/rendering errors (e.g. React or React Flow crashes).

What this does

  • Catches unforeseen UI errors during rendering
  • Prevents the editor from crashing or showing a blank screen
  • Displays a fallback UI using the shared ErrorPage component
  • Tests has also been added

Result

Improves overall stability and resilience of the editor by safely handling unexpected failures.

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Copilot AI review requested due to automatic review settings April 27, 2026 07:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a React error boundary around the diagram editor to prevent full UI crashes during unexpected rendering/runtime failures, displaying a fallback ErrorPage instead.

Changes:

  • Introduces DiagramEditorErrorBoundary component that catches render errors and renders ErrorPage as fallback.
  • Wraps DiagramEditor rendering tree with the new error boundary.
  • Adds unit tests for the error boundary behavior.
  • Updates pnpm-lock.yaml (dependency resolution changes, including jsdom/syncpack/ajv/postcss, etc.).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
pnpm-lock.yaml Updates resolved dependency versions / lockfile graph.
packages/serverless-workflow-diagram-editor/src/diagram-editor/error-pages/DiagramEditorErrorBoundary.tsx New error boundary component rendering ErrorPage on crashes.
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx Wraps editor providers/content with the new error boundary.
packages/serverless-workflow-diagram-editor/tests/diagram-editor/error-pages/DiagramEditorErrorBoundary.test.tsx Adds unit tests validating fallback and reset behavior.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx Outdated
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
@kumaradityaraj
Copy link
Copy Markdown
Contributor Author

@lornakelly @fantonangeli @handreyrc please review this PR. Thank you.

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Copilot AI review requested due to automatic review settings April 28, 2026 07:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pnpm-lock.yaml
Comment thread packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx Outdated
kumaradityaraj and others added 2 commits April 28, 2026 13:06
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com>
Copy link
Copy Markdown
Member

@fantonangeli fantonangeli left a comment

Choose a reason for hiding this comment

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

@kumaradityaraj LGTM, but I needed to create a story to test this component.
Opened a PR with this: kumaradityaraj#4

Copilot AI review requested due to automatic review settings April 29, 2026 06:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx Outdated
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Copilot AI review requested due to automatic review settings April 29, 2026 07:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx Outdated
<div
className={`dec:rounded dec:border dec:border-gray-300 dec:dark:border-gray-600 dec:bg-white dec:dark:bg-gray-800 dec:text-gray-900 dec:dark:text-gray-100${selected ?' dec:ring-2 dec:ring-blue-400' : ""}`}
data-testid={`${type}-node-${id}`}
className={`dec:rounded dec:border dec:border-gray-300 dec:dark:border-gray-600 dec:bg-white dec:dark:bg-gray-800 dec:text-gray-900 dec:dark:text-gray-100${selected ? " dec:ring-2 dec:ring-blue-400" : ""}`}
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.

I dont think this change is intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lornakelly is there some formatting auto-configured? I undo the changes here manually still the double inverted got pushed 🤔

@lornakelly
Copy link
Copy Markdown
Contributor

Thanks for PR @kumaradityara just added a few comments

@kumaradityaraj
Copy link
Copy Markdown
Contributor Author

@fantonangeli @lornakelly it's ready for final review

Comment thread pnpm-lock.yaml
Comment thread .github/ISSUE_TEMPLATE/bug_report.yml
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Copilot AI review requested due to automatic review settings April 30, 2026 09:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fantonangeli
Copy link
Copy Markdown
Member

@kumaradityaraj please also see my comment: #124 (comment)

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