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

Virtualize beatmap listing #3001

Merged

Conversation

@notbakaneko
Copy link
Collaborator

@notbakaneko notbakaneko commented Apr 13, 2018

sort of fixes #2117

Virtualizes the beatmap listing to keep it fast after scrolling through many pages.

I gave up on using react-virtualized and opted to forkreact-virtual-list to make it work with our flexbox layout on the page instead, since:

  • it required way too many changes to work
  • didn't do a very good job of restoring the scroll position when navigating back in history.
  • this option turned out to be massively simpler ( ゚ ヮ゚)

It doesn't eject the already loaded data yet

@nanaya
Copy link
Collaborator

@nanaya nanaya commented Apr 16, 2018

This seems to work...?

https://0paste.com/20671-fae0f485.txt

@notbakaneko
Copy link
Collaborator Author

@notbakaneko notbakaneko commented Apr 16, 2018

kind of wanted to avoid the whole row wrapper element thing.

Also pushing the column count through as props to the virtual list causes it to render the correct height when the list is at the end and the window resizes wider; otherwise we'd have to store the chunked list somewhere or keep track of something to tell it to recalculate at that point

@notbakaneko
Copy link
Collaborator Author

@notbakaneko notbakaneko commented Apr 16, 2018

keeping columnCount in state should allow it to rerender, though, hmm...

@nanaya
Copy link
Collaborator

@nanaya nanaya commented Apr 16, 2018

Not sure if forking the thing is better idea though. The project itself doesn't seem to be completely dead either.

@notbakaneko
Copy link
Collaborator Author

@notbakaneko notbakaneko commented Apr 16, 2018

ok, apparently just changing items only isn't enough to make it update the height of the scroll area ಠ_ಠ

@notbakaneko notbakaneko added the WIP label Apr 16, 2018
@notbakaneko notbakaneko force-pushed the notbakaneko:feature/virtualize-beatmap-listing-smaller branch from 6e5b608 to 2a18231 Apr 17, 2018
@notbakaneko notbakaneko removed the WIP label Apr 17, 2018
@notbakaneko
Copy link
Collaborator Author

@notbakaneko notbakaneko commented Apr 17, 2018

rebased and sorta squashed whee

@@ -53,7 +53,7 @@
@input-color: @gray-dark;
@input-border-focus: @pink;

@screen-sm-min: 900px; // sync with osu.isDesktop
@screen-sm-min: 900px; // sync with osu.isDesktop, react/beatmaps/main.coffee

This comment has been minimized.

@notbakaneko

notbakaneko Apr 17, 2018
Author Collaborator

should probably figure out a way to import this into scripts

This comment has been minimized.

@nanaya

nanaya Apr 17, 2018
Collaborator

why not use the isDesktop function? ಠ_ಠ

This comment has been minimized.

@notbakaneko

notbakaneko Apr 17, 2018
Author Collaborator

owait :D

@notbakaneko notbakaneko force-pushed the notbakaneko:feature/virtualize-beatmap-listing-smaller branch from c6ab448 to 5f7b1a6 Apr 17, 2018
@nanaya
nanaya approved these changes Apr 17, 2018
@nanaya nanaya merged commit 8c94dcb into ppy:master Apr 17, 2018
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@notbakaneko notbakaneko deleted the notbakaneko:feature/virtualize-beatmap-listing-smaller branch Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

3 participants