Skip to content

fix: Scrolling horizontally in Linker mode renders empty cells#1160

Merged
emilyhuxng merged 3 commits intodeephaven:mainfrom
emilyhuxng:bug-1146-scrolling-in-linker-mode-renders-empty-cells
Mar 22, 2023
Merged

fix: Scrolling horizontally in Linker mode renders empty cells#1160
emilyhuxng merged 3 commits intodeephaven:mainfrom
emilyhuxng:bug-1146-scrolling-in-linker-mode-renders-empty-cells

Conversation

@emilyhuxng
Copy link
Copy Markdown
Contributor

@emilyhuxng emilyhuxng commented Mar 17, 2023

Fixes #1146

Changed assertNotNull to getOrThrow and update hoverSelectColumn on scroll so the highlighted column will change on scroll.

@emilyhuxng emilyhuxng added this to the March 2023 milestone Mar 17, 2023
@emilyhuxng emilyhuxng requested a review from mofojed March 17, 2023 18:40
@emilyhuxng emilyhuxng self-assigned this Mar 17, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 17, 2023

Codecov Report

Merging #1160 (a3bf053) into main (76b3bd5) will increase coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head a3bf053 differs from pull request most recent head 0405851. Consider uploading reports for the commit 0405851 to get more accurate results

@@           Coverage Diff           @@
##             main    #1160   +/-   ##
=======================================
  Coverage   44.13%   44.13%           
=======================================
  Files         447      447           
  Lines       33266    33266           
  Branches     8356     8357    +1     
=======================================
+ Hits        14681    14682    +1     
+ Misses      18536    18535    -1     
  Partials       49       49           
Flag Coverage Δ
unit 44.13% <0.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
packages/iris-grid/src/IrisGridRenderer.ts 24.75% <0.00%> (+0.04%) ⬆️
.../mousehandlers/IrisGridColumnSelectMouseHandler.ts 5.97% <0.00%> (-0.19%) ⬇️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Copy Markdown
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update the PR description to link it to the ticket it fixes (#1146).
I'd also like an investigation how we're getting into this state, as it indicates there are possibly other issues.

const columnWidth = allColumnWidths.get(hoverSelectColumn);
assertNotNull(x);
assertNotNull(columnWidth);
if (x == null || columnWidth == null) return;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned how we got into this state. The reason there were asserts there is it should never be the case that we have a hoverSelectColumn but no matching columnX/columnWidth in the metrics. How are we getting into this state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onWheel in IrisGridColumnSelectMouseHandler doesn't update hoverSelectColumn so if you were hovering column 0 for example, as you scroll, hoverSelectColumn stays 0 but eventually allColumnXs and allColumnWidths will not have 0 as a key anymore as column 0 isn't in view. Should hoverSelectColumn be updated in onWheel as well? This would result in it highlighting while the user is scrolling rather than needing to move cursor afterwards.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - we're updating the cursor, we should update the hover column as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should leave this assertion here (or just use getOrThrow instead):

const x = getOrThrow(allColumnXs, hoverSelectColumn);
const columnWidth = getOrThrow(allColumnWidths, hoverSelectColumn);

This isn't an exceptional case we should have error handling before; we expect the metrics for the hoverSelectColumn to always exist, otherwise there is a problem with our code. In this case, the assertion helped us catch the root cause of the issue (not updating the column while wheeling).

@emilyhuxng emilyhuxng requested a review from mofojed March 20, 2023 16:53
const columnWidth = allColumnWidths.get(hoverSelectColumn);
assertNotNull(x);
assertNotNull(columnWidth);
if (x == null || columnWidth == null) return;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should leave this assertion here (or just use getOrThrow instead):

const x = getOrThrow(allColumnXs, hoverSelectColumn);
const columnWidth = getOrThrow(allColumnWidths, hoverSelectColumn);

This isn't an exceptional case we should have error handling before; we expect the metrics for the hoverSelectColumn to always exist, otherwise there is a problem with our code. In this case, the assertion helped us catch the root cause of the issue (not updating the column while wheeling).

@emilyhuxng emilyhuxng requested a review from mofojed March 20, 2023 18:06
Copy link
Copy Markdown
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description will need to be updated before merging (it no longer matches the actual change).

@emilyhuxng emilyhuxng merged commit e314be6 into deephaven:main Mar 22, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrolling table horizontally in the Linker mode renders empty cells

2 participants