Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
2106cfc
feat: DH-9378: Web Keyed Selection
dgodinez-dh Aug 5, 2026
09ba3ad
Selection object and RangeSelection
dgodinez-dh Aug 5, 2026
dfe92ab
update comment
dgodinez-dh Aug 5, 2026
16177d1
initial renderer update
dgodinez-dh Aug 5, 2026
17f6e70
more renderer changes
dgodinez-dh Aug 5, 2026
f606fef
fix isRowSelected bug
dgodinez-dh Aug 6, 2026
60edaf0
pass in model to selection
dgodinez-dh Aug 6, 2026
8dc5b14
remove toRanges from render
dgodinez-dh Aug 6, 2026
63ee435
refactor
dgodinez-dh Aug 6, 2026
987ca7f
fix out of date reference
dgodinez-dh Aug 6, 2026
775178f
keyed model
dgodinez-dh Aug 6, 2026
598aa74
initial KeyedSelection
dgodinez-dh Aug 6, 2026
02fed5b
use KeyedSelection
dgodinez-dh Aug 6, 2026
0e76963
mouse overlay
dgodinez-dh Aug 6, 2026
5cf4cff
fix comments
dgodinez-dh Aug 6, 2026
d568375
in progress try to simplifly mouse overlay code
dgodinez-dh Aug 6, 2026
8ee56e6
active ranges
dgodinez-dh Aug 6, 2026
2699321
fix bugs with click on selected
dgodinez-dh Aug 6, 2026
c4034db
shift click
dgodinez-dh Aug 6, 2026
52d32c2
ctrl click deselect
dgodinez-dh Aug 6, 2026
926dc8c
select all
dgodinez-dh Aug 7, 2026
cbb7777
Use keyed selection for mouse overlay
dgodinez-dh Aug 7, 2026
fb534db
remove mouse overlay
dgodinez-dh Aug 7, 2026
e7b39e3
add comments
dgodinez-dh Aug 7, 2026
b6efec2
remove old plan file
dgodinez-dh Aug 7, 2026
511b715
clean up comments
dgodinez-dh Aug 7, 2026
d400684
clean up
dgodinez-dh Aug 7, 2026
8ec2086
remove toRanges from commit selection
dgodinez-dh Aug 7, 2026
230c958
getSelection
dgodinez-dh Aug 7, 2026
120f838
onSelectionChange
dgodinez-dh Aug 7, 2026
d7e245e
single selected row
dgodinez-dh Aug 7, 2026
d9c1655
deprecate
dgodinez-dh Aug 7, 2026
bc2f0ba
merge latest
dgodinez-dh Aug 11, 2026
e04e2a6
better name
dgodinez-dh Aug 11, 2026
3d44aad
remove toRanges from interface
dgodinez-dh Aug 11, 2026
39efc80
keyed snapshot functions
dgodinez-dh Aug 11, 2026
e9d2af4
copy using selection
dgodinez-dh Aug 11, 2026
b08c2c4
flatten filters
dgodinez-dh Aug 11, 2026
7160a3a
fix non-inverted empty bug
dgodinez-dh Aug 11, 2026
e440494
add comment
dgodinez-dh Aug 11, 2026
822df66
always fetch key columns
dgodinez-dh Aug 11, 2026
81083fb
check isKeyModel inside memo
dgodinez-dh Aug 11, 2026
99a2dce
keyed selection warning
dgodinez-dh Aug 11, 2026
6d35347
context menu handler
dgodinez-dh Aug 11, 2026
832045d
remove dead code
dgodinez-dh Aug 11, 2026
90a304e
fix right click selection
dgodinez-dh Aug 11, 2026
472ff03
remove more ranged selection
dgodinez-dh Aug 11, 2026
1f388ef
fix for plugins
dgodinez-dh Aug 11, 2026
cad4457
remove selectedRanges
dgodinez-dh Aug 11, 2026
44af5f6
initial csv download
dgodinez-dh Aug 12, 2026
b747dff
refactor
dgodinez-dh Aug 12, 2026
6a55d83
merge latest
dgodinez-dh Aug 12, 2026
ca2131e
add truncate to Selection
dgodinez-dh Aug 12, 2026
0af3eff
snapshot util
dgodinez-dh Aug 12, 2026
f57625d
use selection for getFilterActions
dgodinez-dh Aug 12, 2026
64b9e7e
fix filterchanged timeout bug
dgodinez-dh Aug 12, 2026
6bc95bc
unique keys row count
dgodinez-dh Aug 12, 2026
52decf8
inverted unique row count
dgodinez-dh Aug 12, 2026
d60b242
pending selection for shift click out of viewport
dgodinez-dh Aug 12, 2026
259f5cd
add selection to context menu event
dgodinez-dh Aug 13, 2026
51ab05a
Update table plugin props
dgodinez-dh Aug 13, 2026
76f1382
fix Grid unit test
dgodinez-dh Aug 13, 2026
bc538e4
fix IrisGrid unit test
dgodinez-dh Aug 13, 2026
138588d
fix copy handler unit test
dgodinez-dh Aug 13, 2026
3e33bc3
RangedSelection test
dgodinez-dh Aug 13, 2026
1fd6e8e
KeyedSelection test
dgodinez-dh Aug 13, 2026
68ef59e
IrisGridSelectionUtils
dgodinez-dh Aug 13, 2026
41f93df
keyed grid model test
dgodinez-dh Aug 13, 2026
193b94c
backwards compat for QM
dgodinez-dh Aug 13, 2026
b3d3fab
set deprecated state correctly
dgodinez-dh Aug 14, 2026
7ad96bb
merge latest
dgodinez-dh Aug 17, 2026
01669b3
e2e tests
dgodinez-dh Aug 17, 2026
47bb425
fix check createEmtpySelection update
dgodinez-dh Aug 18, 2026
9cc327b
viewport bound
dgodinez-dh Aug 18, 2026
0826f75
prevent flashing on large selection
dgodinez-dh Aug 18, 2026
8e19d79
fix null filter
dgodinez-dh Aug 18, 2026
31521e9
guard zero rows in csv export
dgodinez-dh Aug 18, 2026
7a3819b
fix withUpdateRanges
dgodinez-dh Aug 18, 2026
023c6cf
fix moved columns for filter by values
dgodinez-dh Aug 18, 2026
0c3c995
fix moved columns filter by value
dgodinez-dh Aug 18, 2026
cb1dada
make selection optional for TablePlugin
dgodinez-dh Aug 18, 2026
e75da7d
gracefull tree key handler
dgodinez-dh Aug 18, 2026
39bc633
empty non-inverted edge case
dgodinez-dh Aug 18, 2026
0dfe96c
fix unit test
dgodinez-dh Aug 18, 2026
d2bbdd3
fix other unit test
dgodinez-dh Aug 18, 2026
359b970
commit keyboard selection
dgodinez-dh Aug 18, 2026
a20447d
update renderer test
dgodinez-dh Aug 18, 2026
1f3b3a9
serialze NaN, Infinity, and -Infinity for keys
dgodinez-dh Aug 18, 2026
0e5612a
handle pending rows for copy and error case
dgodinez-dh Aug 18, 2026
b4e4b40
fix stale selection for backards compat
dgodinez-dh Aug 18, 2026
151fe47
fix go to behavior
dgodinez-dh Aug 18, 2026
809ea81
fix center on go to
dgodinez-dh Aug 18, 2026
60b16a3
jsdoc onSelectionChange
dgodinez-dh Aug 26, 2026
e47dedb
keyed anchor handler
dgodinez-dh Aug 26, 2026
2377dd2
Revert "keyed anchor handler"
dgodinez-dh Aug 26, 2026
531acdc
mouse selection by keys
dgodinez-dh Aug 26, 2026
298c8e3
seek row for out of viewport
dgodinez-dh Aug 26, 2026
ad24e1f
fix non-unique shift click
dgodinez-dh Aug 26, 2026
b48409f
tests
dgodinez-dh Aug 26, 2026
74626e6
Fix mouse drag select
dgodinez-dh Aug 26, 2026
2d5d282
use empty array
dgodinez-dh Aug 26, 2026
6bd4fc6
getModel
dgodinez-dh Aug 26, 2026
19a5357
jsdocs
dgodinez-dh Aug 26, 2026
d13ba4c
KeySelectionOptions
dgodinez-dh Aug 26, 2026
dbd30a4
refactor selectionToRanges
dgodinez-dh Aug 26, 2026
571dceb
remove unused import
dgodinez-dh Aug 26, 2026
37e06e0
createEmptySelection
dgodinez-dh Aug 26, 2026
5aef215
reuse empty selection
dgodinez-dh Aug 26, 2026
844d491
jsdocs
dgodinez-dh Aug 26, 2026
93c1286
merge latest
dgodinez-dh Aug 27, 2026
a384e09
fix unit test
dgodinez-dh Aug 27, 2026
26d82a1
mouse gesture options
dgodinez-dh Aug 27, 2026
7e4a735
rename withCommittedRanges
dgodinez-dh Aug 27, 2026
45e8e9e
split interface
dgodinez-dh Aug 27, 2026
51dc31d
fix out of viewport withComittedRanges
dgodinez-dh Aug 27, 2026
80101f1
fix call to deprecated selection change
dgodinez-dh Aug 27, 2026
4116bfc
fix csv download table close handling
dgodinez-dh Aug 27, 2026
d69f114
fix close copy table on error
dgodinez-dh Aug 27, 2026
a8cf2e4
remove seekRow for out of viewport anchor
dgodinez-dh Aug 27, 2026
062d703
avoid allocating array for commit
dgodinez-dh Aug 27, 2026
8305e06
sync last selection on set selection
dgodinez-dh Aug 27, 2026
322b975
fix comment
dgodinez-dh Aug 27, 2026
b953d68
fix right bound
dgodinez-dh Aug 27, 2026
6cf7e94
fix programtic selection
dgodinez-dh Aug 28, 2026
7d289a5
grid selection for memoized js plugin
dgodinez-dh Aug 28, 2026
1678e20
fix commit only on key
dgodinez-dh Aug 28, 2026
0ff79de
fix rendering for single cell selection
dgodinez-dh Aug 28, 2026
0b03d7b
unit tests
dgodinez-dh Aug 28, 2026
5c985df
combinde full and partial row render coalescer
dgodinez-dh Aug 31, 2026
7094aad
refactor key lookup logic into model
dgodinez-dh Aug 31, 2026
b5b6f5d
revers args isCellSelected
dgodinez-dh Aug 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions packages/dashboard-core-plugins/src/GridWidgetPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import {
} from '@deephaven/dashboard';
import { assertNotNull, getErrorMessage } from '@deephaven/utils';
import { useApi } from '@deephaven/jsapi-bootstrap';
import { type GridRange, type GridState } from '@deephaven/grid';
import {
type GridRange,
type GridState,
type Selection,
} from '@deephaven/grid';
import { useIrisGridModel } from './useIrisGridModel';
import useDashboardColumnFilters from './useDashboardColumnFilters';
import { InputFilterEvent } from './events';
Expand Down Expand Up @@ -155,7 +159,10 @@ export function GridWidgetPlugin({
handleClearAllFilters
);

const [selection, setSelection] = useState<readonly GridRange[]>([]);
const [selectedRanges, setSelectedRanges] = useState<readonly GridRange[]>(
[]
);
const [selection, setSelection] = useState<Selection | null>(null);

const {
Plugin,
Expand All @@ -166,7 +173,8 @@ export function GridWidgetPlugin({
model,
irisGridRef,
irisGridUtils,
selectedRanges: selection,
selectedRanges,
selection,
});

const alwaysFetchColumns = useMemo(() => {
Expand Down Expand Up @@ -201,7 +209,8 @@ export function GridWidgetPlugin({
model={model}
settings={settings}
onStateChange={handleIrisGridChange}
onSelectionChanged={setSelection}
onSelectionChanged={setSelectedRanges}
onSelectionChange={setSelection}
onContextMenu={onContextMenu}
inputFilters={inputFilters}
customFilters={customFilters}
Expand Down
3 changes: 3 additions & 0 deletions packages/dashboard-core-plugins/src/TablePluginWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const TablePluginWrapper = forwardRef(
filter,
fetchColumns,
selectedRanges,
selection,
irisGridRef,
pluginState,
onStateChange,
Expand All @@ -28,6 +29,7 @@ export const TablePluginWrapper = forwardRef(
| 'filter'
| 'fetchColumns'
| 'selectedRanges'
| 'selection'
| 'pluginState'
| 'onStateChange'
> & {
Expand Down Expand Up @@ -72,6 +74,7 @@ export const TablePluginWrapper = forwardRef(
table={model.table}
tableName={panelName}
selectedRanges={selectedRanges}
selection={selection}
onStateChange={onStateChange}
pluginState={pluginState}
// Mimic the panel containing `irisGrid.current` for backwards compatibility
Expand Down
24 changes: 21 additions & 3 deletions packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ import {
import { type ResolvableContextAction } from '@deephaven/components';
import type { dh } from '@deephaven/jsapi-types';
import {
selectionToRanges,
type GridState,
type ModelIndex,
type ModelSizeMap,
type MoveOperation,
type Selection,
} from '@deephaven/grid';
import type {
TablePluginComponent,
Expand Down Expand Up @@ -244,6 +246,9 @@ interface IrisGridPanelState {
frozenColumns?: readonly ColumnName[];
columnHeaderGroups?: readonly ColumnHeaderGroup[];

// Current grid selection for memoization in getPluginContent
gridSelection: Selection | null;

// eslint-disable-next-line react/no-unused-state
panelState?: PanelState | null; // Dehydrated panel state that can load this panel
irisGridStateOverrides: Partial<DehydratedIrisGridState>;
Expand Down Expand Up @@ -294,6 +299,7 @@ export class IrisGridPanel extends PureComponent<
this.handleDataSelected = this.handleDataSelected.bind(this);
this.handleError = this.handleError.bind(this);
this.handleGridStateChange = this.handleGridStateChange.bind(this);
this.handleGridSelectionChange = this.handleGridSelectionChange.bind(this);
this.handlePluginStateChange = this.handlePluginStateChange.bind(this);
this.handleCreateChart = this.handleCreateChart.bind(this);
this.handleShow = this.handleShow.bind(this);
Expand Down Expand Up @@ -363,6 +369,7 @@ export class IrisGridPanel extends PureComponent<
isStuckToRight: false,
conditionalFormats: [],
selectDistinctColumns: [],
gridSelection: null,
};
}

Expand Down Expand Up @@ -469,7 +476,8 @@ export class IrisGridPanel extends PureComponent<
(
Plugin: TablePluginComponent | undefined,
model: IrisGridModel | undefined,
pluginState: unknown
pluginState: unknown,
gridSel: Selection | null
) => {
if (
!model ||
Expand All @@ -485,6 +493,8 @@ export class IrisGridPanel extends PureComponent<
panel: this,
};

const selectedRanges = selectionToRanges(gridSel);

return (
<div className="iris-grid-plugin">
<Plugin
Expand All @@ -494,7 +504,8 @@ export class IrisGridPanel extends PureComponent<
model={model}
table={model.table}
tableName={this.getTableName()}
selectedRanges={this.irisGrid.current?.state.selectedRanges}
selectedRanges={selectedRanges}
selection={gridSel ?? null}
onStateChange={this.handlePluginStateChange}
pluginState={pluginState}
// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down Expand Up @@ -703,6 +714,10 @@ export class IrisGridPanel extends PureComponent<
onStateChange?.(irisGridState, gridState);
}

handleGridSelectionChange(selection: Selection): void {
this.setState({ gridSelection: selection });
}

handlePluginStateChange(pluginState: unknown): void {
const { irisGridState, gridState } = this;
this.pluginState = pluginState;
Expand Down Expand Up @@ -1247,8 +1262,10 @@ export class IrisGridPanel extends PureComponent<
error != null ? `Unable to open table. ${error}` : undefined;
const description = model?.description ?? undefined;
const pluginState = panelState?.pluginState ?? null;
const { gridSelection } = this.state;
const childrenContent =
children ?? this.getPluginContent(Plugin, model, pluginState);
children ??
this.getPluginContent(Plugin, model, pluginState, gridSelection);
const { permissions } = user;
const { canCopy, canDownloadCsv } = permissions;
const widgetPanelDescriptor = this.getWidgetPanelDescriptor(
Expand Down Expand Up @@ -1328,6 +1345,7 @@ export class IrisGridPanel extends PureComponent<
onDataSelected={this.handleDataSelected}
onError={this.handleError}
onStateChange={this.handleGridStateChange}
onSelectionChange={this.handleGridSelectionChange}
onContextMenu={this.handleContextMenu}
onAdvancedSettingsChange={this.handleAdvancedSettingsChange}
customFilters={pluginFilters}
Expand Down
11 changes: 9 additions & 2 deletions packages/dashboard-core-plugins/src/useTablePlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
type IrisGridType,
type IrisGridContextMenuData,
} from '@deephaven/iris-grid';
import { type GridRange } from '@deephaven/grid';
import { type GridRange, type Selection } from '@deephaven/grid';
import { TablePluginWrapper } from './TablePluginWrapper';

interface UseTablePluginProps {
Expand All @@ -30,8 +30,13 @@ interface UseTablePluginProps {
irisGridUtils: IrisGridUtils | undefined;
/**
* The currently selected ranges in the grid.
* @deprecated Use `selection` instead.
*/
selectedRanges: readonly GridRange[] | undefined;
/**
* The current grid selection, including keyed selections.
*/
selection: Selection | null | undefined;
}

/**
Expand All @@ -48,6 +53,7 @@ export function useTablePlugin({
irisGridRef,
irisGridUtils,
selectedRanges,
selection,
}: UseTablePluginProps): {
Plugin: JSX.Element | null;
} & Pick<
Expand Down Expand Up @@ -89,12 +95,13 @@ export function useTablePlugin({
filter={setPluginFilters}
fetchColumns={setAlwaysFetchColumns}
selectedRanges={selectedRanges}
selection={selection}
irisGridRef={irisGridRef}
pluginState={pluginState}
onStateChange={setPluginState}
/>
) : null,
[model, selectedRanges, irisGridRef, pluginState, setPluginState]
[model, selectedRanges, selection, irisGridRef, pluginState, setPluginState]
);

const onContextMenu = useCallback(
Expand Down
Loading
Loading