Skip to content

feat: DH-21476 Configurable TableOptions sidebar#2688

Open
vbabich wants to merge 29 commits into
deephaven:mainfrom
vbabich:vlad-DH-21476-table-options
Open

feat: DH-21476 Configurable TableOptions sidebar#2688
vbabich wants to merge 29 commits into
deephaven:mainfrom
vbabich:vlad-DH-21476-table-options

Conversation

@vbabich

@vbabich vbabich commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Pre-requisite for Pivot Builder.

Summary:

This PR introduces new extension seams for @deephaven/iris-grid (configurable Table Options sidebar + model transforms) as a prerequisite for Pivot Builder, and includes related grid/model robustness improvements (pending-operation scrim signaling, proxy-model swap handling, header separator behavior, and shared remote-module re-exports for plugins).

Changes:

  • Add transformTableOptions + plugin configPage support for the IrisGrid Table Options sidebar, including ordering, duplicate detection, and an error boundary for plugin pages.
  • Add transformModel support so middleware/hosts can wrap or replace the built IrisGridModel (sync/async), plus new model events to support swap/loading workflows.
    Improve grid behavior for pivot-like scenarios (runtime swapping of renderer/metric calculator, model-changed signaling).

Testing:

The plugins have not been released yet, so they have to be served via Vite proxy in dev mode for testing. Use this branch to test in DHE - https://github.com/deephaven-ent/iris/pull/4525.

@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.72289% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.71%. Comparing base (ab2439a) to head (ac5cbbd).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/iris-grid/src/IrisGrid.tsx 65.21% 24 Missing ⚠️
packages/grid/src/Grid.tsx 50.00% 2 Missing ⚠️
packages/iris-grid/src/IrisGridModel.ts 0.00% 2 Missing ⚠️
packages/grid/src/GridRenderer.ts 0.00% 1 Missing ⚠️
packages/grid/src/GridUtils.ts 93.33% 1 Missing ⚠️
packages/iris-grid/src/IrisGridProxyModel.ts 90.00% 1 Missing ⚠️
packages/iris-grid/src/IrisGridTextCellRenderer.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2688      +/-   ##
==========================================
- Coverage   50.72%   50.71%   -0.02%     
==========================================
  Files         788      789       +1     
  Lines       44923    45070     +147     
  Branches    11447    11677     +230     
==========================================
+ Hits        22789    22855      +66     
- Misses      22115    22196      +81     
  Partials       19       19              
Flag Coverage Δ
unit 50.71% <80.72%> (-0.02%) ⬇️

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.

@vbabich vbabich marked this pull request as ready for review June 15, 2026 13:45
@vbabich vbabich requested a review from mofojed June 15, 2026 13:45

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 new extension seams for @deephaven/iris-grid (configurable Table Options sidebar + model transforms) as a prerequisite for Pivot Builder, and includes related grid/model robustness improvements (pending-operation scrim signaling, proxy-model swap handling, header separator behavior, and shared remote-module re-exports for plugins).

Changes:

  • Add transformTableOptions + plugin configPage support for the IrisGrid Table Options sidebar, including ordering, duplicate detection, and an error boundary for plugin pages.
  • Add transformModel support so middleware/hosts can wrap or replace the built IrisGridModel (sync/async), plus new model events to support swap/loading workflows.
  • Improve grid behavior for pivot-like scenarios (column header separators based on group identity, runtime swapping of renderer/metric calculator, proxy-model has trap + model-changed signaling).

Reviewed changes

Copilot reviewed 29 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/plugin/src/PluginUtils.tsx Ref-forwarding implementation for chained panel middleware.
packages/plugin/src/PluginTypes.ts Make middleware panel Component ref-capable via ForwardRefExoticComponent.
packages/iris-grid/src/sidebar/PluginTableOptionsErrorBoundary.tsx New error boundary for plugin-supplied sidebar pages.
packages/iris-grid/src/sidebar/OptionType.ts Add OptionItemKey type for built-in vs plugin sidebar keys.
packages/iris-grid/src/sidebar/IrisGridTableOptionsWidgetProps.ts New TableOptionsTransform + prop interface for threading transforms.
packages/iris-grid/src/sidebar/IrisGridSidebarItems.test.tsx Tests for transform behavior, ordering, duplicate warnings, and plugin-page fallback.
packages/iris-grid/src/sidebar/index.ts Export new sidebar-related types (OptionItemKey, widget props/transform type).
packages/iris-grid/src/RemoteComponentModules.ts Re-export @dnd-kit/* namespaces for remote component module sharing.
packages/iris-grid/src/IrisGridUtils.ts Extract totals/aggregation helpers (getOperationMap/order, totals config hydration).
packages/iris-grid/src/IrisGridTextCellRenderer.ts Guard against missing column metadata before string-type checks.
packages/iris-grid/src/IrisGridProxyModel.ts Add has trap for proxy duck-typing, emit MODEL_CHANGED, avoid closing originalModel, refine select-distinct capability check.
packages/iris-grid/src/IrisGridModelWidgetProps.ts New transformModel type + prop interface for hosts/middleware.
packages/iris-grid/src/IrisGridModel.ts Add MODEL_CHANGED, PENDING, PENDING_CLEARED events + dispatchPending helper.
packages/iris-grid/src/IrisGrid.tsx Implement transformTableOptions, plugin page rendering, pending scrim handlers, model swap handling, metric calculator rebuild path, and menu ordering weights.
packages/iris-grid/src/index.ts Re-export remote component modules + IrisGridModelWidgetProps.
packages/iris-grid/src/CommonTypes.tsx Extend OptionItem to support plugin keys, ordering, and configPage; add pending-operation detail typing.
packages/iris-grid/README.md Document Table Options customization + model transforms and middleware composition guidance.
packages/grid/src/GridUtils.ts Improve header separator logic using group identity + empty-band semantics.
packages/grid/src/GridUtils.test.ts Add tests for pivot/group-identity and empty-band separator behaviors.
packages/grid/src/GridRenderer.ts Use GridUtils.hasColumnSeparatorAtDepth for separator highlight behavior.
packages/grid/src/Grid.tsx Sync renderer/metricCalculator props into instance fields for runtime swapping.
packages/dashboard-core-plugins/src/useIrisGridModel.ts Add optional transformModel application + base-model close-on-transform-failure.
packages/dashboard-core-plugins/src/useIrisGridModel.test.ts Add tests for transformModel application and rejection cleanup.
packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx Thread transformTableOptions, transformModel, irisGridProps, onModelChanged; apply model transform during load.
packages/dashboard-core-plugins/src/panels/IrisGridPanel.test.tsx Add tests for forwarding table-options transform and applying/cleaning up model transform.
packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx Accept/thread transformTableOptions, transformModel, irisGridProps, onModelChanged; notify on model changes.
packages/dashboard-core-plugins/src/GridWidgetPlugin.test.tsx Add tests for forwarding table-options transform and applying model transform.
packages/components/src/RemoteComponentModules.ts Re-export FontAwesome namespaces for remote component module sharing.
packages/components/src/index.ts Export the new components RemoteComponentModules entry point.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/grid/src/Grid.tsx Outdated
Comment thread packages/plugin/src/PluginUtils.tsx Outdated
vbabich and others added 3 commits June 15, 2026 13:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…aven#2699)

Mouse Up handler in the `Grid` component wasn't resetting the
`isDragging` flag, this was blocking hover effects on column separators.

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 32 out of 38 changed files in this pull request and generated 3 comments.

Comment thread packages/iris-grid/src/IrisGridModelWidgetProps.ts Outdated
Comment thread packages/iris-grid/src/sidebar/IrisGridTableOptionsWidgetProps.ts Outdated
Comment thread packages/plugin/src/PluginTypes.ts

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 33 out of 39 changed files in this pull request and generated 2 comments.

Comment thread packages/plugin/src/PluginUtils.tsx
Comment thread packages/iris-grid/src/IrisGrid.tsx

@mofojed mofojed left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, just split it into a couple PRs as discussed and then I have a few comments about typing and suggest how it could be clearer? Take a look, let me know what you think.

Comment thread packages/components/src/RemoteComponentModules.ts
Comment on lines +37 to +40
transformTableOptions,
transformModel,
irisGridProps,
onModelChanged,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I'm reading this correctly, GridWidgetPlugin now requires a middleware plugin to be registered to pass in these functions? I do like the option of Middleware and I think it will actually be useful for what David is working on with the cell renderer right now... not sure it should require registering a middleware plugin though, the GridWidgetPlugin should work on it's own I think.

EDIT: On re-reading, the GridWidgetPlugin does stand on it's own, and all these props are optional. Hmm.

I think what might make it clear is a few type refactors:

  • Define the IrisGridModelWidgetProps and IrisGridTableOptionsWidgetProps as requiring those types rather than having them optional...
  • Add a type GridWidgetPluginMiddlewareProps, where the props are required e.g.
export type GridWidgetPluginMiddlewareProps = IrisGridTableOptionsWidgetProps & IrisGridModelWidgetProps & {
  irisGridProps: Partial<IrisGridViewProps;
  onModelChanged: (model) => void;
}
  • Then GridWidgetPlugin can depend on Partial<GridWidgetPluginMiddlewareProps>, e.g.
export function GridWidgetPlugin({
  fetch,
  transformTableOptions,
  transformModel,
  irisGridProps,
  onModelChanged,
}: WidgetComponentProps<DhType.Table> & Partial<GridWidgetPluginMiddlewareProps>

Thoughts? Something to that effect. I think either way it makes sense to group the middleware props all together. Since those are props that can only be set by middleware, since all plugins will just load the WidgetComponentProps by default.

Comment on lines +331 to +334
transformTableOptions?: (
defaults: readonly OptionItem[]
) => readonly OptionItem[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use TableOptionsTransform type. Or just & IrisGridTableOptionsWidgetProps?

Comment on lines +2639 to +2642
model.removeEventListener(
IrisGridModel.EVENT.MODEL_CHANGED,
this.handleModelChanged
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... it feels weird to call it a model change, because the top model that IrisGrid references isn't changing... it is more like the columns are changing, or the schema is changing? Bit of a nitpick... I guess it is effectively like the model is changing and a full refresh is pretty much in order.

Comment thread packages/iris-grid/src/RemoteComponentModules.ts
vbabich added a commit that referenced this pull request Jun 17, 2026
…Middleware helpers (#2703)

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

Split out of #2688
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.

3 participants