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 commented Apr 16, 2018

This seems to work...?

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

@notbakaneko
Copy link
Collaborator Author

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

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

@nanaya
Copy link
Collaborator

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

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

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

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 was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@notbakaneko notbakaneko force-pushed the feature/virtualize-beatmap-listing-smaller branch from c6ab448 to 5f7b1a6 Compare April 17, 2018 05:08
@nanaya nanaya merged commit 8c94dcb into ppy:master Apr 17, 2018
@notbakaneko notbakaneko deleted the feature/virtualize-beatmap-listing-smaller branch April 17, 2018 10:26
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.

Beatmap listings should be unloaded at some point
3 participants