fix: DH-22918: Pass ref through middleware chain, export createWidgetMiddleware helpers#2703
Conversation
…Middleware helpers
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2703 +/- ##
==========================================
- Coverage 50.72% 50.50% -0.23%
==========================================
Files 788 788
Lines 44923 44944 +21
Branches 11447 11643 +196
==========================================
- Hits 22789 22699 -90
- Misses 22115 22199 +84
- Partials 19 46 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the @deephaven/plugin middleware/panel chaining utilities to preserve Golden Layout’s state persistence by forwarding the Golden Layout ref through the panel middleware chain, and adds exported helper factories to make authoring ref-safe middleware easier.
Changes:
- Update
createChainedPanelComponentto beforwardRef-based and thread the Golden Layoutrefdown to the base panel component. - Tighten middleware panel typings to require ref-capable (
forwardRef) panel middleware components. - Add
createPanelMiddleware/createWidgetMiddlewarehelper factories plus unit tests for ref-forwarding and inject/wrap behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/plugin/src/PluginUtils.tsx | Forward Golden Layout refs through panel middleware; add exported middleware helper factories. |
| packages/plugin/src/PluginUtils.test.tsx | Add/adjust tests to cover ref forwarding and the new helper factories. |
| packages/plugin/src/PluginTypes.ts | Tighten middleware panel typings and document the Golden Layout ref/persistence requirement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Plugin package changes implementing
createWidgetMiddlewareandcreatePanelMiddlewarehelpers, passing ref through middleware chain.Split out of #2688