feat: Add error boundary for diagram rendering #124
feat: Add error boundary for diagram rendering #124kumaradityaraj wants to merge 10 commits intoserverlessworkflow:mainfrom
Conversation
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
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
DiagramEditorErrorBoundarycomponent that catches render errors and rendersErrorPageas fallback. - Wraps
DiagramEditorrendering 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.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
|
@lornakelly @fantonangeli @handreyrc please review this PR. Thank you. |
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
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.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com>
fantonangeli
left a comment
There was a problem hiding this comment.
@kumaradityaraj LGTM, but I needed to create a story to test this component.
Opened a PR with this: kumaradityaraj#4
…add-story LGTM
There was a problem hiding this comment.
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.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
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.
| <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" : ""}`} |
There was a problem hiding this comment.
I dont think this change is intended?
There was a problem hiding this comment.
@lornakelly is there some formatting auto-configured? I undo the changes here manually still the double inverted got pushed 🤔
|
Thanks for PR @kumaradityara just added a few comments |
|
@fantonangeli @lornakelly it's ready for final review |
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
ac2aaff to
50d4b0e
Compare
There was a problem hiding this comment.
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.
|
@kumaradityaraj please also see my comment: #124 (comment) |
closes Error Boundary
Add Error Boundary to Diagram Editor
Introduced a React Error Boundary around the
DiagramEditorto handle unexpected runtime/rendering errors (e.g. React or React Flow crashes).What this does
ErrorPagecomponentResult
Improves overall stability and resilience of the editor by safely handling unexpected failures.