Skip to content

Testing co-pilot review#1375

Open
mofojed wants to merge 1 commit into
deephaven:copilot/add-copilot-instructionsfrom
mofojed:copilot-testing-review
Open

Testing co-pilot review#1375
mofojed wants to merge 1 commit into
deephaven:copilot/add-copilot-instructionsfrom
mofojed:copilot-testing-review

Conversation

@mofojed

@mofojed mofojed commented Jun 24, 2026

Copy link
Copy Markdown
Member

Throwaware branch of testing copilot review

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.

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.

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 ErrorBoundary element 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 new ErrorInfo event type for the on_error callback.
  • 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"
},
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.

2 participants