Skip to content

fix: DH-22918: Pass ref through middleware chain, export createWidgetMiddleware helpers#2703

Merged
vbabich merged 2 commits into
deephaven:mainfrom
vbabich:vlad-DH-22918
Jun 17, 2026
Merged

fix: DH-22918: Pass ref through middleware chain, export createWidgetMiddleware helpers#2703
vbabich merged 2 commits into
deephaven:mainfrom
vbabich:vlad-DH-22918

Conversation

@vbabich

@vbabich vbabich commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Plugin package changes implementing createWidgetMiddleware and createPanelMiddleware helpers, passing ref through middleware chain.

Split out of #2688

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.50%. Comparing base (ab2439a) to head (6390f9c).

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     
Flag Coverage Δ
unit 50.50% <100.00%> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 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 createChainedPanelComponent to be forwardRef-based and thread the Golden Layout ref down to the base panel component.
  • Tighten middleware panel typings to require ref-capable (forwardRef) panel middleware components.
  • Add createPanelMiddleware / createWidgetMiddleware helper 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.

Comment thread packages/plugin/src/PluginTypes.ts
Comment thread packages/plugin/src/PluginUtils.tsx

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread packages/dashboard-core-plugins/src/WidgetLoaderPlugin.test.tsx
Comment thread packages/plugin/src/PluginUtils.test.tsx
Comment thread packages/plugin/src/PluginUtils.test.tsx
Comment thread packages/plugin/src/PluginUtils.test.tsx
Comment thread packages/plugin/src/PluginUtils.tsx
@vbabich vbabich merged commit 0427362 into deephaven:main Jun 17, 2026
10 of 11 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants