You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why these changes are being introduced:
Navigation past page 2 in search results is broken due to Turbo Frame
state management issues. Pagination controls were outside the Turbo
Frame, causing full page reloads that lost tab context and broke the
pagination flow.
Additionally, Primo API has practical limits around 960 records (or
thereabouts), despite claiming millions of results and a recommended
offset limit of 2,000 and a hardcoded limit of 5,000. This leads to
inconsistent behavior at high page counts (errors, timeouts, etc).
Relevant ticket(s):
- [USE-95](https://mitlibraries.atlassian.net/browse/USE-95)
- [USE-110](https://mitlibraries.atlassian.net/browse/USE-110)
How this addresses that need:
- Moves pagination controls inside the `search-results` Turbo Frame to
maintain state during navigation.
- Adds `data-turbo-action='advance'` to pagination links for proper URL
updates and browser history management.
- Adds `rel='nofollow'` to pagination links to prevent bot crawling.
- Set PRIMO_MAX_OFFSET at 960 based on real-world API testing.
- Implement continuation page for Primo results beyond pagination
limits.
- Consolidates result count display logic to show `10,000+` for all
sources when appropriate.
- Adds a `First` affordance for users to return quickly to the first
page.
Side effects of this change:
- Pagination now uses AJAX updates instead of full page reloads,
providing faster navigation. (This is marginal given how slow the Primo
API is.)
- Users will see a "Continue in Search Our Collections" page when
reaching Primo's practical pagination limits. It's notable that Primo UI
has the same bug as the Search API, so they will continue to experience
frustration at higher page counts regardless of which interface they
use.
- The URL updates provided by `data-turbo-action='advance'` also fixes
USE-110 (ensuring consistent browser state).
- Some autoformatting applied by VSCode around integers (e.g., 10000
becomes 10_000).
- I have serious concerns about the Primo Search API performance. It is
so slow that it times out occasionally after 60 seconds. This makes
pagination an inherently poor user experience, as the problem seems to
get worse at higher page numbers. I strongly urge us to reconsider
making Primo the default tab. If that is not an option, we should
evaluate creative workarounds. (E.g., perhaps a higher per-page count
would dissuade users from using pagination.) Caching alone is unlikely
to help in this case.
0 commit comments