Sort the list carousel by last_modified#11607
Merged
mekarpeles merged 2 commits intomasterfrom Dec 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds sorting by last_modified to list carousels, maintaining the pre-Solr behavior for list ordering. The changes ensure that when lists are displayed in carousels or accessed via search URLs, they are sorted by their most recent modification date in descending order.
- Adds
last_modified descsorting to the Solr query inget_lists()function - Appends
&sort=last_modifiedparameter to the list search URL for consistency
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| openlibrary/plugins/openlibrary/lists.py | Adds sort='last_modified desc' parameter to the run_solr_query call in the get_lists() function |
| openlibrary/plugins/openlibrary/partials.py | Appends &sort=last_modified to the URL query string for the "View All Lists" link |
After thoroughly reviewing the code changes, I found no issues to report. The implementation is consistent and correct:
- Both changes correctly implement sorting by
last_modifiedin descending order - The URL parameter
sort=last_modifiedinpartials.pyis automatically normalized tolast_modified descby theListSearchScheme(as defined in line 42 ofschemes/lists.py) - The direct parameter
sort='last_modified desc'inlists.pyis the proper format for therun_solr_queryfunction - Both approaches achieve the same result: sorting lists by most recently modified first
The changes successfully restore the pre-Solr behavior as intended.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addendum to #11187 . Maintains previous, pre-solr behaviour.
Technical
Testing
Screenshot
Stakeholders