jkomoros / card-web

The web app behind thecompendium.cards
Apache License 2.0
53 stars 8 forks source link

Figure out a way to handle collections with very large number of cards #547

Closed jkomoros closed 2 years ago

jkomoros commented 2 years ago

If there are thousands of cards in a collection (which happens in production in the working notes collection), the rendering of the card-collection in the left rail becomes a significant performance bottleneck.

Anecodtaly I've found that adding limit/500 the the working-notes card collection makes a huge difference. Maybe make that the default?

Also, add an affordance at the end of a card-list that has a limit filter that offers to extend it "Next n cards...", where n is set by taking the largest of {100, 50, 25, 10, 5} that cleanly divides the collection length.

Also, add an offset/n dynamic filter, that works basically like limit except it offsets into the collection, removing the given amount from the front. So then when you hit that Next n cards... it would add a offset/n basically (or increment it by n). Offset would have to work specially like limit does, but it would be similar to limit. And then if the offset is non zero, there should be an affordance at the top, like at the bottom for 'Next n cards..." for "Previous n cards..."

jkomoros commented 2 years ago
jkomoros commented 2 years ago

Actually, maybe it's better for the rendering offset and limit to be set as parameters on the card-thumbnail list and not actually use real filtering. Then there's no funky stuff in the URL, it's just a thing controlled with rendering offset

jkomoros commented 2 years ago

551 has the remaining todo so this is done