feat: DH-22976: ui.table event handlers and read-only for filters/sorts - #1408
Draft
mofojed wants to merge 15 commits into
Draft
feat: DH-22976: ui.table event handlers and read-only for filters/sorts#1408mofojed wants to merge 15 commits into
mofojed wants to merge 15 commits into
Conversation
…ters prop actually differs
…ilters. Breaking change implemented
….table Adds read-only states for ui.table quick filters and sorts so users can tell that controlled `quick_filters` and `sorts` are owned by the server. Implemented entirely in the plugin by overriding `isFilterable`, `isColumnSortable`, and `getClearFilterRange` on UITableModel. IrisGrid already gates all filter/sort interactions on those model methods, so this disables the interactions and applies the disabled styling without changes to @deephaven/iris-grid. `getClearFilterRange` needs its own override because the base implementation calls `isFilterable` on the wrapped model. Also blocks the two clear-filter paths that bypass the model: the Ctrl+E shortcut (via a key handler ordered ahead of IrisGrid's ClearFilterKeyHandler) and the dashboard CLEAR_ALL_FILTERS event. Updates the default/controlled prop tests and docstrings to match the removal of the mutual-exclusivity validation, and bumps @deephaven/* packages.
…back presence Merge default_quick_filters/default_sorts into the single quick_filters and sorts props. The props are controlled when the matching on_quick_filters_change/on_sorts_change callback is provided; otherwise they set the initial state and user changes are retained and persisted.
|
ui docs preview (Available for 14 days) |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Callback-only tables are not marked controlled, and persisted state can override controlled values during initial rendering.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds controlled sort/filter state and read-only controls to ui.table.
Changes:
- Adds change callbacks and controlled-state synchronization.
- Adds read-only filtering and sorting behavior.
- Adds Python, JavaScript, E2E, and documentation coverage.
File summaries
| File | Description |
|---|---|
tests/utils.ts |
Adds grid interaction helpers. |
tests/ui_table.spec.ts |
Tests controlled updates and persistence. |
tests/app.d/ui_table.py |
Adds E2E table fixtures. |
plugins/ui/test/deephaven/ui/test_ui_table.py |
Tests Python props and normalization. |
plugins/ui/src/js/src/elements/UITable/UITableUtils.ts |
Adds callback-state conversion utilities. |
plugins/ui/src/js/src/elements/UITable/UITableUtils.test.ts |
Tests state conversions. |
plugins/ui/src/js/src/elements/UITable/UITableModel.ts |
Enforces read-only behavior. |
plugins/ui/src/js/src/elements/UITable/UITableModel.test.ts |
Tests read-only model behavior. |
plugins/ui/src/js/src/elements/UITable/UITableClearFilterKeyHandler.ts |
Blocks filter-clearing shortcuts. |
plugins/ui/src/js/src/elements/UITable/UITable.tsx |
Implements controlled state and read-only integration. |
plugins/ui/src/js/src/elements/UITable/UITable.test.tsx |
Tests controlled IrisGrid props. |
plugins/ui/src/js/package.json |
Updates Deephaven dependencies. |
plugins/ui/src/deephaven/ui/components/table.py |
Exposes the new Python API. |
plugins/ui/docs/snapshots/74d3276deb61d890485c9528425404e6.json |
Adds read-only example snapshot. |
plugins/ui/docs/snapshots/5be53133b01169b03ce3116c0274173f.json |
Updates quick-filter snapshot. |
plugins/ui/docs/snapshots/43147ace5cee510f96e24cc6a3275935.json |
Updates sort snapshots. |
plugins/ui/docs/components/table.md |
Documents controlled and read-only state. |
package-lock.json |
Locks updated dependencies. |
Review details
- Files reviewed: 17/30 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+452
to
+454
| const isSortsControlled = sorts !== undefined && onSortsChange != null; | ||
| const isQuickFiltersControlled = | ||
| quickFilters !== undefined && onQuickFiltersChange != null; |
Comment on lines
+668
to
+672
| sorts: hydratedControlledSorts, | ||
| isSortsControlled, | ||
| onSortsChange: onSortsChange == null ? undefined : handleSortsChange, | ||
| quickFilters: hydratedControlledQuickFilters, | ||
| isQuickFiltersControlled, |
Comment on lines
823
to
827
| The `sorts` prop accepts: | ||
|
|
||
| - A single column name string (ascending sort) | ||
| - A `ui.TableSort` object | ||
| - A list mixing column names and `ui.TableSort` objects |
Comment on lines
+321
to
+322
| Accepts a column name, TableSort, or list containing column names and | ||
| TableSort instances. If `on_sorts_change` is not provided, these are the |
mofojed
marked this pull request as draft
September 2, 2026 19:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
on_quick_filters_change,on_sorts_change,is_quick_filters_read_onlyandis_sorts_read_onlyprops onui.tableon_quick_filters_changeprop is set, theui.tableis in "controlled" mode. When unset, it's in "uncontrolled" mode (like default value, same behaviour as before this change)is_quick_filters_read_onlyso user cannot change the filters after they are set