internetarchive/openlibrary
Allow `view` URL parameter for list page display mode
Ouverte
#13 327 ouverte le 13 août 2026
Affects: UIGood First IssueLead: @RayBBModule: JavaScriptNeeds: HelpTheme: DesignTheme: ListsType: Feature Request
Métriques du dépôt
- Stars
- (6 610 étoiles)
- Métriques de merge PR
- (Merge moyen 6j 2h) (126 PRs mergées en 30 j)
Description
Feature Request
Problem / Opportunity
Right now, when you share a link to an Open Library list, the recipient sees whatever view they last used. There is no URL parameter to enforce a specific display mode (list or grid), unlike the existing sort parameter (e.g. ?sort=last_modified). This makes it harder to share lists with a specific visual context in mind.
Proposal
Add a view URL parameter to list pages, accepting list or grid as values.
Example URLs
-
Grid view (default-like): https://openlibrary.org/people/raybb/lists/OL341399L/Automation_for_the_People_Residency_Scifi_book_recs_2026?sort=last_modified&view=grid
Behavior
?view=list— forces the list to render in list mode.?view=grid— forces the list to render in grid mode.- If the parameter is omitted, the page falls back to the user’s last selected preference (current behavior).
- The existing sort parameter (
sort=last_modified) should continue to work in conjunction withview. - I'm not sure if we should make the url switch from grid/list when someone clicks on a different mode but I lean towards yes.
Breakdown
Related files
openlibrary/templates/type/list/view.htmlopenlibrary/plugins/openlibrary/js/lists/index.js- https://github.com/internetarchive/openlibrary/pull/10878
Requirements Checklist
- URL parameter
viewis parsed on list page load. - Valid values (
list,grid) are accepted and applied. - Invalid or missing values fall back to existing behavior.
- Sort parameter continues to work correctly alongside
view.
Stakeholders
- @cdrini @lokesh
Instructions for Contributors
- Before creating a new branch or pushing up changes to a PR, please first run these commands to ensure your repository is up to date, as the pre-commit bot may add commits to your PRs upstream.