feat: DH-21476 Configurable TableOptions sidebar#2688
Conversation
Codecov Report❌ Patch coverage is 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
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:
|
…nents for plugins
There was a problem hiding this comment.
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+ pluginconfigPagesupport for the IrisGrid Table Options sidebar, including ordering, duplicate detection, and an error boundary for plugin pages. - Add
transformModelsupport so middleware/hosts can wrap or replace the builtIrisGridModel(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
hastrap + 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.
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.
…to create middleware
| transformTableOptions, | ||
| transformModel, | ||
| irisGridProps, | ||
| onModelChanged, |
There was a problem hiding this comment.
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
IrisGridModelWidgetPropsandIrisGridTableOptionsWidgetPropsas 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
GridWidgetPlugincan depend onPartial<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.
| transformTableOptions?: ( | ||
| defaults: readonly OptionItem[] | ||
| ) => readonly OptionItem[]; | ||
|
|
There was a problem hiding this comment.
Use TableOptionsTransform type. Or just & IrisGridTableOptionsWidgetProps?
| model.removeEventListener( | ||
| IrisGridModel.EVENT.MODEL_CHANGED, | ||
| this.handleModelChanged | ||
| ); |
There was a problem hiding this comment.
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.
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:
transformTableOptions+ pluginconfigPagesupport for the IrisGrid Table Options sidebar, including ordering, duplicate detection, and an error boundary for plugin pages.transformModelsupport so middleware/hosts can wrap or replace the builtIrisGridModel(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.