Currently, the #kudos element at the bottom of works contains a list of all users who have ever given kudos to the work. In AO3-2176, the wall of kudos was hidden using CSS, but the list is still there in the source, even though only the first 50 are shown. At ~40-50 bytes per kudo, that can in some cases result in a kudos list that is multiple megabytes.
Let's change that. The work page should only list the first 50 kudos, and the link to show more kudos should be a remote link that retrieves a list of kudos from the server, instead of the source.
View the kudos list at the bottom.
Click on the "and X more users" link.
It should load some more user names, but not all of them. At the end of the list of kudos loaded, there should be another "and X more users" link. The number in the link should have decreased by 50.
Click on the new "and X more users" link to make sure it behaves as expected, too.
Go to the /works/ID/kudos page for the same work. Make sure that it's only showing the first 50 kudos, and that the page links to show more kudos seem to be working properly.
https://test.archiveofourown.org/works/494729/kudos shows 24 pages, which would fit with 1173 users at 50/page. Interestingly, it’s in reverse order from the kudos list on the main works page, which seems backwards.
The change was deliberate, so someone going through the pages one-by-one won't see duplicates as new kudos are added.
Everything seems to work as expected! Tested on Firefox for Windows 10.
After some discussion, we decided to switch the order of the kudos on the /kudos page – they’ll now go from newest to oldest, as they do on the bottom of the work, to avoid people expecting to see their kudos on the first page and getting confused when it’s not there.
That change is merged and ready for testing.
It is newest to oldest now; /kudos page 1 shows the same 50 names that appear initially on the work page. Leaving kudos (either in another tab or as someone else) while flipping through the pages pushes a name from the previous page to the next page.
I noticed that if I left kudos after loading all the names, it collapsed again, which doesn’t seem ideal, but we can live with it at least for the time being.