feat(panes): a pane that throws shows its own error, not the whole workspace's
Why
A render error in one pane reached the dashboard's ContentBoundary, which replaced the whole workspace with "This view hit an error". The pane was saved in the layout, so both "Reload app" and reopening the workspace brought the same screen back. That is how a user got locked out of a workspace (the underlying duplicate-row bug was fixed in #7980).
What changes
PaneErrorBoundarywraps each pane body inpackages/panes. The pane keeps its header. The body shows "This pane hit an error", the message, Retry and Close pane. Close pane removes the pane from the saved layout. The boundary resets when the pane's data changes.PaneContentcallsrenderPaneitself, so a throw insiderenderPaneis caught too.WorkspacetakesonPaneError; the desktop passesreportRendererError, so these errors still reach Sentry.- A pane of an unknown kind uses the same
PaneFallback("This pane can't be shown" / "Unknown pane type: x") with a Close pane button, in place of a bare text line. Its header reads "Unknown pane". - Three new strings, translated in every locale.
Screenshots: https://app.superset.sh/page/pane-fallback-states-4evyq7
Verification
- Dev app over CDP, on the original duplicate-rename bug (host-service without #7980): the error stayed in the Changes pane, the terminal and sidebar kept working, a reload kept the workspace usable, Close pane removed the pane and it stayed removed after a reload, and
reportRendererErrorfired once. - Dev app, split tab with a DevTools pane holding
data: null(throws inrenderPane) and a pane of kindinbox-preview: both fallbacks render in their panes, including at 28% width; both Close pane buttons work. panestests 114/114,panesand desktop typecheck, lint,check:i18n.
Not covered: a throw in a pane's header (renderTitle, renderHeaderExtras, renderToolbar) still reaches ContentBoundary.
Summary by cubic
A render error in one pane no longer replaces the whole workspace with "This view hit an error", which previously locked users out of that workspace because the broken pane stayed in the saved layout. Each pane body is now wrapped in its own error boundary: the pane keeps its header, shows the error with Retry and Close pane, and Close pane removes it from the saved layout.
Bug Fixes
- Errors still reach Sentry through the new
onPaneErrorhandler; the desktop passesreportRendererError. - Unknown pane kinds now use the same fallback with a Close pane button instead of a bare text line.
- The boundary resets when the pane's data changes.
- A throw in a pane's header (
renderTitle,renderHeaderExtras,renderToolbar) is not covered and still hits the workspace content boundary.
Summary by CodeRabbit
- New Features
- Panes that encounter rendering errors now show a helpful message with options to retry or close them.
- Unknown pane types display a localized message and can be closed.
- Pane error messages are available in 17 languages.