web-client-ui icon indicating copy to clipboard operation
web-client-ui copied to clipboard

IrisGrid `reverseType` is always treated as a post-sort reverse, even though there's a pre-sort option

Open mofojed opened this issue 7 months ago • 1 comments

Description

IrisGrid accepts a prop for sorts and a prop for reverseType: https://github.com/deephaven/web-client-ui/blob/58ee88dc92bfe9a283ebc789c93f23639a954ba3/packages/iris-grid/src/IrisGrid.tsx#L297 The reverseType prop accepts pre-sort or post-sort option: https://github.com/deephaven/web-client-ui/blob/58ee88dc92bfe9a283ebc789c93f23639a954ba3/packages/jsapi-utils/src/TableUtils.ts#L87 However, when it is actually applied in the IrisGridModelUpdater, we only apply it after sorts rather than pre-sort: https://github.com/deephaven/web-client-ui/blob/58ee88dc92bfe9a283ebc789c93f23639a954ba3/packages/iris-grid/src/IrisGridModelUpdater.tsx#L104

We should fix that reverseType pre-sort option so it works correctly.

Steps to reproduce

  1. Use an IrisGrid with some sorts and a reverseType="pre-sort" option

Expected results

  1. Reverse should be done before sorting

Actual results

  1. Reverse is done after sorting

Versions Engine Version: 0.36.0-SNAPSHOT Web UI Version: 0.84.0 Java Version: 11.0.23 Barrage Version: 0.6.0 Browser Name: Firefox 128 OS Name: Linux @deephaven/js-plugin-ui: 0.17.0 @deephaven/js-plugin-plotly-express: 0.9.0

mofojed avatar Jul 16 '24 18:07 mofojed