feat: DH-21344: Dropdown for input table enums#2704
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2704 +/- ##
==========================================
+ Coverage 50.72% 50.76% +0.03%
==========================================
Files 788 792 +4
Lines 44923 45069 +146
Branches 11447 11684 +237
==========================================
+ Hits 22789 22878 +89
- Misses 22115 22145 +30
- 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 introduces column-restriction–driven cell editors for input tables by adding a registry-based mechanism to @deephaven/grid, wiring that registry through @deephaven/iris-grid via context, and providing a default dropdown editor for string-list (enum-like) restrictions.
Changes:
- Add
ColumnRestrictionsupport and acellInputRendererRegistryto@deephaven/gridto render custom cell editors based on restriction type. - Add
IrisGridContextProvider+ default registry plumbing in@deephaven/iris-grid, including a dropdown editor (CellDropdownField) for string-list restrictions. - Add an IrisGrid key handler to preserve existing values for restriction-backed editors when editing is initiated by typing.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/iris-grid/src/key-handlers/RestrictedEditKeyHandler.ts | Intercepts printable-key edits to open restriction-backed editors without overwriting existing values. |
| packages/iris-grid/src/key-handlers/index.ts | Exports the new key handler. |
| packages/iris-grid/src/IrisGridModel.ts | Adds getColumnRestriction and defines string-list restriction type helpers. |
| packages/iris-grid/src/IrisGridContextProvider.tsx | Combines theme + renderer registry into a single context IrisGrid can consume. |
| packages/iris-grid/src/IrisGrid.tsx | Switches IrisGrid to the combined context and passes the registry down to Grid. |
| packages/iris-grid/src/IrisGrid.scss | Adds styling so dropdown editors get a visible focus/outline treatment. |
| packages/iris-grid/src/index.ts | Exposes new context/provider and dropdown/editor context exports. |
| packages/iris-grid/src/CellInputRendererContext.tsx | Defines default renderer registry and maps string-list restrictions to the dropdown editor. |
| packages/iris-grid/src/CellDropdownField.tsx | Implements the dropdown cell editor using Spectrum Picker wrapper. |
| packages/iris-grid/src/CellDropdownField.scss | Styles dropdown editor to fit within grid cell geometry and visuals. |
| packages/grid/src/key-handlers/EditKeyHandler.ts | Adds Enter-to-start-editing behavior for editable cells. |
| packages/grid/src/index.ts | Re-exports CellInputField, renderer types, and GridModel types. |
| packages/grid/src/GridRendererTypes.ts | Adds CellInputRendererFn and CellInputRendererRegistry types. |
| packages/grid/src/GridModel.ts | Adds ColumnRestriction type and getColumnRestriction hook on models. |
| packages/grid/src/Grid.tsx | Uses cellInputRendererRegistry to render custom editors and sets CSS vars for editor styling. |
| packages/app-utils/src/components/AppBootstrap.tsx | Wraps app tree with IrisGridContextProvider to supply the combined context. |
💡 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>
Consumes the new Column Restriction JS API to add an dropdown cell renderer for input tables. The renderer is pass to Grid via a function in a registry in a context around IrisGrid. This will allow Enterprise to register more input table cell renderers.