indiewebring.ws icon indicating copy to clipboard operation
indiewebring.ws copied to clipboard

The next & previous links just link to a random site on the ring

Open zaguragit opened this issue 2 years ago β€’ 2 comments

Is this expected behaviour? I tested it with some random sites aswell as mine, I clicked next, and then previous, and almost never went back to the original site.

Also, maybe the ring should have a separate "see a random page" button?

zaguragit avatar Nov 05 '22 09:11 zaguragit

Thanks, @zaguragit ! It's true that this is not a true "ring". You can see in the code here that /next and /previous just pick a random site in the ring.

I'm open to making it work more like a ring but I also want to keep it simple and efficient. I'm open to ideas for implementing that!

A "see a random page" button could make sense. If you want to pursue that further, please open a separate issue for discussion. (For now folks can feel free to open the directory and choose a site at random. :smile: )

martymcguire avatar Nov 05 '22 14:11 martymcguire

When it comes to the implementation, when clicking on the previous/next buttons, the server is already aware of the index of the current website, so it would just look up the neighbouring indexes, right? Or it could pre-compute all of the urls every time a new website gets added, which happens far less often than link clicks, so it might be more efficient

zaguragit avatar Nov 05 '22 20:11 zaguragit