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
Create VirtualizedGrid component for catalog view #5795
Create VirtualizedGrid component for catalog view #5795
Conversation
b6c67b7
to
8785b64
Compare
8785b64
to
21a8be5
Compare
239fbc5
to
e4512b9
Compare
/assign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sahil143 I haven't gone into reviewing code in depth yet, but noticed a few issues by just running your branch locally. To start off with the performance really seems to be slow and the frame rates are dropping too much with the new implementation. While scrolling the screen feels janky due to very low frame rates.
Below is a gif of dev catalog on your branch, notice the low frame rate shown in the top left corner. Its almost always below 10fps.
Below is a dev catalog on master, notice how the frame rate goes up to 60fps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, except for the key prop missing. Key Prop is provided on both CellMeasurer and wrapper div but somehow it's being removed in react-virtualized.
height of the container is being set by the window scroller and the tiles are not cut it's just that their box shadow is hidden. i tried adding margin which adds the space but the shadow is still hidden for the last row of tiles.
I wasn't able to reproduce this while scrolling. Is there any particular step that needs to be followed here?
yes, the frame rate seems to be very low, Investigating this issue. |
/retest |
Scrolling is a bit janky it seems because the scrollbar grows and shrinks in size as your scroll down and up. I would expect the scrollbar to remain relatively the same size. After scrolling through the entire list, I would expect the cache to have a precise measurement on the scrollbar and to no longer adjust the sizing. But that's not the case here. |
The tiles rendered to screen seem to be re-rendering on every scroll. I'd expect them to not have to re-render unless data changes. edit: the items are actually being unmounted and remounted on scroll |
frontend/packages/console-shared/src/components/virtualized-grid/const.ts
Outdated
Show resolved
Hide resolved
frontend/packages/console-shared/src/components/virtualized-grid/Cell.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/console-shared/src/components/virtualized-grid/GroupByFilterGrid.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/console-shared/src/components/virtualized-grid/utils.ts
Outdated
Show resolved
Hide resolved
The last row in the grid disappears prematurely when scrolling up. |
/hold |
ae61e0d
to
0327ee4
Compare
the scrollbar is growing and shrinking because of dynamic row/cell height, I tried making the row height fixed and the scrollbar remained the same size.
I guess that's more or less expected, this issue talks about the same bvaughn/react-virtualized#416
fixed. |
/hold cancel |
/retest |
Shouldn't we be able to assume a certain height per row? |
This is not expected. Components should be unmounted and remounted on scroll. |
Initial implementation add scss and resolve styling issues finish implementation cleanup
fix imports and add comments add unit tests for cell
css and test fix utils tests
remove cache from cell tests
0327ee4
to
150685a
Compare
yes, I missed a prop
As discussed, Added
fixed this. used padding for each cell instead of subtracting a constant from height and width to create space between tiles |
… to use padding instead of subtracting the height width to create spacing fix unit tests
2e77f80
to
5c9ae93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frontend/packages/console-shared/src/components/virtualized-grid/Grid.tsx
Show resolved
Hide resolved
frontend/packages/console-shared/src/components/virtualized-grid/Grid.scss
Outdated
Show resolved
Hide resolved
frontend/packages/console-shared/src/components/virtualized-grid/VirtualizedGrid.tsx
Outdated
Show resolved
Hide resolved
@christianvogt fixed both the issue. |
…eys to cell component fix unit tests
732e210
to
12d1bbd
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, sahil143 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@sahil143 It would also be good if you could squash your commits into better explanatory commit messages around the feature. |
Fixes: https://issues.redhat.com/browse/ODC-4027
Analysis: Virtualize Developer Catalog to support very large number of items
Solution: Created a VirtualizedGrid component which is used in catalog
NOTE: this also affects the operator hub because same component is shared between the catalog page and operator hub
Screenshots:
Unit tests:
Browser: