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

feat: Make rollup group behaviour a setting in the global settings menu

Open AkshatJawne opened this issue 1 year ago • 9 comments

Closes #2128

AkshatJawne avatar Aug 08 '24 20:08 AkshatJawne

@mofojed I tried experimenting with trying to have the IrisGridModelUpdater listen for the COLUMNS_CHANGED event, and then accordingly set the modelColumns in the event handler, but that was not working (it also effectively does the same hack, if it were to work, where we set to the model.columns anyways).

I am going to push the "hacky" code that we discussed yesterday, and then we can continue the conversation on finding a cleaner way to do this.

AkshatJawne avatar Aug 13 '24 16:08 AkshatJawne

Codecov Report

Attention: Patch coverage is 63.47826% with 42 lines in your changes missing coverage. Please review.

Project coverage is 46.64%. Comparing base (336e1f3) to head (f10645a).

Files Patch % Lines
packages/iris-grid/src/IrisGridTreeTableModel.ts 24.24% 25 Missing :warning:
packages/iris-grid/src/IrisGridModelUpdater.tsx 84.84% 10 Missing :warning:
...e-studio/src/settings/FormattingSectionContent.tsx 16.66% 5 Missing :warning:
packages/iris-grid/src/IrisGrid.tsx 66.66% 2 Missing :warning:
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2183    +/-   ##
========================================
  Coverage   46.64%   46.64%            
========================================
  Files         692      693     +1     
  Lines       38571    38606    +35     
  Branches     9647     9839   +192     
========================================
+ Hits        17992    18009    +17     
+ Misses      20568    20544    -24     
- Partials       11       53    +42     
Flag Coverage Δ
unit 46.64% <63.47%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 14 '24 15:08 codecov[bot]

For the image mismatches, will need to have new images taken, to replace the rollup-rows-and-aggregate-columns images, where the group column is shown by default (given that the setting will be activated by default)

AkshatJawne avatar Aug 15 '24 16:08 AkshatJawne

@mofojed Adjusted logic according to your review, e2e tests may still fail because of the rollup images. How can we update those?

AkshatJawne avatar Aug 15 '24 20:08 AkshatJawne

@AkshatJawne Run npm run e2e:update-ci-snapshots to update the snapshots: https://github.com/deephaven/web-client-ui/blob/main/README.md#e2e-tests

mofojed avatar Aug 15 '24 20:08 mofojed

@mofojed Ran command, appears the snapshots were not updated?

AkshatJawne avatar Aug 15 '24 21:08 AkshatJawne

Screenshot 2024-08-16 at 10 26 03 AM

Tried running npm run clean then npm i, and then also restarted my computer and TS server, keep getting the above

AkshatJawne avatar Aug 16 '24 16:08 AkshatJawne

I don't understand why this is going on the formatter and not as a prop to IrisGrid or something like that. The value is only used in IrisGridTreeTableModel, so why pass it through the formatter? To me it doesn't feel like it belongs on formatter since that's for "how to display a cell based on its value and column type".

mattrunyon avatar Aug 21 '24 16:08 mattrunyon

So I think my proposal is to remove this from the formatter settings and instead in componentDidUpdate where it checks the settings, add a separate check for if this value changed. If it did, then update the model. That way should work without the worry of useEffect

Or you could add showExtraGroupColumn to the IrisGridModelUpdater as a prop and then you would still need the change from useEffect I think. Or columns would need to be updated at the end possibly. Either way shouldn't need useEffect and if you remove the usePrevious hook and use a ref instead in the useOnChange hook (so that the value is always up to date even if the render is discarded so effects don't run), then that should be fine

mattrunyon avatar Aug 21 '24 16:08 mattrunyon