Skip to content

feat: DH-22976: ui.table event handlers and read-only for filters/sorts - #1408

Draft
mofojed wants to merge 15 commits into
deephaven:mainfrom
mofojed:feat-DH-21841-fix-user-to-modify
Draft

feat: DH-22976: ui.table event handlers and read-only for filters/sorts#1408
mofojed wants to merge 15 commits into
deephaven:mainfrom
mofojed:feat-DH-21841-fix-user-to-modify

Conversation

@mofojed

@mofojed mofojed commented Sep 2, 2026

Copy link
Copy Markdown
Member
  • Add on_quick_filters_change, on_sorts_change, is_quick_filters_read_only and is_sorts_read_only props on ui.table
  • When the on_quick_filters_change prop is set, the ui.table is in "controlled" mode. When unset, it's in "uncontrolled" mode (like default value, same behaviour as before this change)
  • Can set is_quick_filters_read_only so user cannot change the filters after they are set

SimonVutov and others added 15 commits September 2, 2026 10:07
….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.
@mofojed
mofojed requested a balanced review from Copilot September 2, 2026 16:22
@mofojed mofojed self-assigned this Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

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.

🟡 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
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