internetarchive / internetarchive/openlibrary
Add support for list "random" sorting
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
## Problem / Opportunity
Search results already support sorting randomly, but lists don't. A shareable link to a randomly-ordered list would be handy for e.g. book clubs that use a list to vote on the next read, where a fixed order biases the selection. Eg [Book Club 2026-08](https://openlibrary.org/people/ScarTissue/lists/OL341354L/Book_Club_2026-08).
## Proposal
Add a "random" option to the list sort control. Selecting it should add a seed as a URL parameter so that a given link always yields the same order, and we can then also offer the shuffle button we already have on other pages to re-roll the seed.
Implementation Details (for maintainers)
#### Related files
* `openlibrary/templates/type/list/view_body.html`
* `openlibrary/plugins/openlibrary/lists.py`
* `openlibrary/templates/search/sort_options.html` — existing random sort + shuffle button
#### Requirements Checklist
* [ ] List pages offer a "random" sort option
* [ ] Selecting random sets a seed URL param, so the same URL reproduces the same order
* [ ] A shuffle button re-rolls the seed
#### Instructions for Contributors
* **Before** [creating a new branch](https://docs.openlibrary.org/developers/tools/git.html#making-changes-and-creating-a-pull-request) or pushing up changes to a PR, please first [run these commands](https://docs.openlibrary.org/developers/tools/git.html#working-on-your-branch) to ensure your repository is up to date, as the pre-commit bot may add commits to your PRs upstream.
Contributor guide
Research direction
Start with openlibrary/templates/type/list/view_body.html and compare its sort control with the random sort and shuffle button in openlibrary/templates/search/sort_options.html. Then trace list sorting in openlibrary/plugins/openlibrary/lists.py. Done means list pages offer random sorting, preserve a seed in the URL for repeatable ordering, and provide a shuffle action that changes the seed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100