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

Add post shuffling #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

jrstrunk
Copy link
Contributor

@jrstrunk jrstrunk commented Feb 8, 2023

This pull request implements the features requested in #23 and #48. Buy adding a shuffle button to the top of the page that shuffles the currently displaying posts, feature request #48 is implemented. By allowing the user to adjust in the menu how many posts are shown after a shuffle, feature request #23 is implemented.

As an additional improvement, I add the ability to choose between using true randomness posts and unique randomness when shuffling a certain number of posts. True randomness shuffles the posts with a true random number generator, so each time the user presses the shuffle button, new random posts will appear. Unique randomness shuffles the posts using a seed so that it can guarantee that every time the user shuffles the posts, no post is shown twice before every other post in the set has been shown. This is nice when the user is shuffling many posts but only wants to see a few at a time so they do not keep getting repeats.

This pull request also adds some deferring to the post rendering. This is to provide the user with the first 100 posts immediately upon first page render and when changing settings that change the posts displayed. It is a simple solution, but if further performance optimizations need to be done later, the deferring logic is not hard to rip out and replace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant