Testing co-pilot review#1375
Open
mofojed wants to merge 1 commit into
Open
Conversation
Expose @deephaven/components ErrorBoundary as ui.error_boundary, supporting a fallback component and an on_error callback that fires server-side with serialized error info. Caught errors are contained to the boundary so the rest of the widget continues to render. Includes JS/Python wiring, unit and e2e tests, and documentation.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new error_boundary component to the Deephaven UI plugin, wiring it end-to-end across the Python component API, the JS element registry, and both unit + Playwright UI tests.
Changes:
- Added a JS
ErrorBoundaryelement wrapper that serializes caught errors for server callbacks, and registered it in the element name + component map. - Added a Python
error_boundary(...)component plus a newErrorInfoevent type for theon_errorcallback. - Added coverage via a Jest unit test for the JS wrapper and a Playwright test panel demonstrating boundary containment + server callback behavior.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ui.spec.ts | Adds Playwright coverage validating error boundary fallback + server on_error behavior. |
| tests/app.d/ui.py | Adds a test panel/component that intentionally triggers a render error inside an error boundary. |
| plugins/ui/src/js/src/widget/WidgetUtils.tsx | Registers the new ErrorBoundary element in the element-to-component map. |
| plugins/ui/src/js/src/elements/model/ElementConstants.ts | Adds ELEMENT_NAME.errorBoundary constant for element registration. |
| plugins/ui/src/js/src/elements/index.ts | Re-exports the new ErrorBoundary element from the elements barrel. |
| plugins/ui/src/js/src/elements/ErrorBoundary.tsx | Implements the JS wrapper that serializes the caught error before calling onError. |
| plugins/ui/src/js/src/elements/ErrorBoundary.test.tsx | Adds Jest tests verifying rendering, fallback, and serialized error callback behavior. |
| plugins/ui/src/deephaven/ui/components/types/events.py | Introduces ErrorInfo / ErrorInfoCallable typing for the Python callback payload. |
| plugins/ui/src/deephaven/ui/components/error_boundary.py | Adds the Python error_boundary component factory. |
| plugins/ui/src/deephaven/ui/components/init.py | Exports error_boundary from the components package. |
| plugins/ui/docs/sidebar.json | Adds a docs sidebar entry for error_boundary. |
Comment on lines
+118
to
+142
| class ErrorInfo(TypedDict): | ||
| """ | ||
| Information about an error caught by an error_boundary component. | ||
| """ | ||
|
|
||
| message: str | ||
| """ | ||
| The error message. | ||
| """ | ||
|
|
||
| name: str | ||
| """ | ||
| The name/type of the error. | ||
| """ | ||
|
|
||
| stack: str | None | ||
| """ | ||
| The stack trace of the error, if available. | ||
| """ | ||
|
|
||
| componentStack: str | None | ||
| """ | ||
| The React component stack where the error occurred, if available. | ||
| """ | ||
|
|
Comment on lines
+257
to
+260
| { | ||
| "label": "error_boundary", | ||
| "path": "components/error_boundary.md" | ||
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Throwaware branch of testing copilot review