Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiDataGrid] Virtualization #4170

Merged

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Oct 22, 2020

Summary

( Fixes #4365 in 5328347 )

Added a new docs page, Data grid virtualization, to demonstrate the effect of virtualization & how to configure a grid's dimensions through props or DOM layout.

Need to write actual documentation for using/configuring the virtualization, everything else is ready for review.

Issues needing a fix:

  • Control column cells are too tall
  • Columns can have a gap between them
  • Unit tests are not happy with the virtualized setup
  • verify (and fix?) detected height resets after a new rowCount is provided (00ed696)
  • Header / row height needs to be calculated dynamically through an observer (8b4ed63 52798b3)
  • Double click issue on row header popover (5328347)
  • Footer cells are not getting widths (check version with styled footer border) (458d25f)
  • Cell widths are not updating on observable or on column width change from user

Items for follow up PRs:

Props

Added optional height and width props that accept valid CSS values.

virtualized_props

Constrained layout

virtualized_constrained

  • implement virtualization with react-window
  • fix cell focus management
  • fix header row focus & content updates
  • resolve tab key navigating through cells
  • fix on-datagrid-focus forgetting what the previously focused cell was
  • optional height/width props
  • documentation
  • performance & moving more internal values to contexts
  • test keyboard accessibility
  • test screen reader

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs
  • Added documentation
  • [ ] Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@snide
Copy link
Contributor

snide commented Dec 2, 2020

Pushed some fixes. Still have the following todo:

  • need to figure out first/last columns in "row" so i can apply border styling
  • need to get height for header / footer from JS rather than a hard coded size
  • need to figure out why the width for the grid body cells is not updating
  • add a class to cell for striping

@chandlerprall
Copy link
Contributor Author

flaky network, jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4170/

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Well, I accidentally loaded the old DataGrid and was testing that one, and it immediately kicked my Chrome up to 100% CPU... Now that I got this one running, my fans are quiet as a mouse. 🐭 So fantastic job there! 🎉

The only thing that I wish was a bit snappier is when changing any sort of client-side display of the datagrid like sorting, or changing of the rows per page, or the density (at a high number of rows). It's less that the grid itself takes a long time to make that change, but that the selection itself does. For instance the button group button doesn't show selected until the data grid has completely re-rendered. Not sure really what can be done there.

Also it's actually quite sluggish in Full Screen mode when scrolling 100 rows. This may have to do with the fact that it's no longer using the browser's page scroll but an internal overflow.


Some other things I noticed:

1. The density adjustments no longer seem to be changing the overall height of the cells.
There seems to be some calculations going that always come out to make the cells 34px high.

image

2. In full screen mode, the initial calculation doesn't take the scrollbar into account
Screen Shot 2021-01-21 at 15 07 33 PM

3. Visually I think we need more borders especially around the scrollbars

image

4. It would be great if while scrolling with virtualization which shows a white background while the cells load, we could have either add in some light gray like $euiPageBackgroundColor, or even some sort of pattern indication "loading".

5. It looks like we also need a smarter pagination display on skinny screens/containers.
Screen Shot 2021-01-21 at 15 42 10 PM

6. In full screen, the bottom row is still getting cutoff by the fixed pagination and it's hiding the horizontal scrollbar.

Screen Shot 2021-01-21 at 15 49 17 PM


A few of these items could be quick follow ups. Just wasn't sure what is known.

@@ -191,7 +192,7 @@ const trailingControlColumns = [
ownFocus={true}>
<EuiPopoverTitle>Actions</EuiPopoverTitle>
<div style={{ width: 150 }}>
<button onClick={() => {}} component="span">
<button onClick={() => {}}>
Copy link
Contributor

Choose a reason for hiding this comment

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

This has been bugging me a bunch in our docs. Why do we have a button (icon) within a <button> instead of just using a context menu?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's also a whole bunch of console error because of the nested <button>s.

@snide
Copy link
Contributor

snide commented Jan 21, 2021

@chandlerprall I can do a pass on some of that feedback. The only one I might skip @cchaos is the border one. Usually we have some sort of container in these cases that requires extra css (for example, discover). I think it's better to leave it more neutral and leave the css layer as additive based on the implementation.

image

@cchaos
Copy link
Contributor

cchaos commented Jan 21, 2021

The only one I might skip @cchaos is the border one.

I still think it's important to add borders to the scrollbars or something. The white space is jarring when it just cuts off the content or looks like odd spacing between in and the pagination.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4170/

@chandlerprall
Copy link
Contributor Author

chandlerprall commented Jan 26, 2021

I'll let Dave take a pass at those items, but I'll add that performance is largely addressed by a PR Joe put up against my branch. It moves a number of things around which makes reviewing the virtualization effort harder, so I've opted to keep it separate - though it is ready to follow this one quickly. EDIT: that PR has been merged into this branch

@chandlerprall chandlerprall changed the title [WIP] datagrid virtualization [EuiDataGrid] Virtualization Jan 26, 2021
@chandlerprall
Copy link
Contributor Author

Since the main virtualization changes have been reviewed, as has @flash1293's awesome performance changes, I've merged those additional optimizations in to ease testing & further review/conversation.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4170/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4170/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4170/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

This is great 🙌
Confirmed the upgrade path in Kibana (aside from unit tests)
The noted follow-up tasks cover the remaining functional issues

@chandlerprall chandlerprall merged commit 1176832 into elastic:master Jan 28, 2021
@chandlerprall chandlerprall deleted the feature/virtualized-datagrid branch January 28, 2021 19:17
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4170/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4170/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EuiDataGrid] Clicking a column header twice prevent closing the popover
7 participants