Conversation
Why these changes are being introduced: There are two uncaught edge cases in the full-text link logic: 1. Full-text options are removed when libkey links exist. 2. I a PNX record as an empty links object (rather than omitting it altogether), then full-text options will not display. Relevant ticket(s): - [USE-663](https://mitlibraries.atlassian.net/browse/USE-663) How this addresses that need: This addresses the edge cases noted above. Side effects of this change: This change was prompted by full-text links not appearing in staging, despite working properly in local development environments. It's unclear whether this change is what's required to fix staging.
❌ 4 blocking issues (4 total)
|
Coverage Report for CI Build 33194305177Coverage remained the same at 98.3%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
|
I'm not totally sure this addresses the problem in stage that's preventing these links from showing, but at the very least it's an improvement to the logic. The feature does seem to work properly in this PR build, but that was the case with the initial implementation. |
There was a problem hiding this comment.
🟡 Changes recommended
The PR checklist/description states there are no view-layer changes, but the ERB partial was modified and the checklist should be corrected to avoid misleading review and a11y process steps.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adjusts Primo full-text link handling so “Full-text options” is only added when no direct PDF/HTML links exist, and ensures it isn’t removed when LibKey results load (fixing edge cases seen with empty pnx.links objects and LibKey link injection).
Changes:
- Update
NormalizePrimoRecord#linksto add “Full-text options” whenAlma-Eis present and no direct Primo PDF/HTML links exist (including whenpnx.linksis{}). - Preserve the “Full-text options” link in the Primo result UI even when LibKey links are present (hide/remove other Primo links only).
- Add/adjust tests to cover the new normalization behavior.
File summaries
| File | Description |
|---|---|
app/models/normalize_primo_record.rb |
Refines “Full-text options” link inclusion logic based on presence of direct PDF/HTML links. |
app/views/search/_result_primo.html.erb |
Adds a preservable CSS class to keep “Full-text options” visible when LibKey results exist. |
app/javascript/controllers/content_loader_controller.js |
Updates link-removal selector to exclude preservable Primo links. |
test/models/normalize_primo_record_test.rb |
Updates/adds tests for the new full-text options edge cases. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Why these changes are being introduced:
There are two uncaught edge cases in the full-text link logic:
options will not display.
Relevant ticket(s):
How this addresses that need:
This addresses the edge cases noted above.
Side effects of this change:
This change was prompted by full-text links not
appearing in staging, despite working properly in
local development environments. It's unclear
whether this change is what's required to fix
staging.
Developer
Accessibility
New ENV
Approval beyond code review
Additional context needed to review
"Sea otters" is an example of a search that will return a top result with a "full-text options" link.
Code Reviewer
Code
added technical debt.
Documentation
(not just this pull request message).
Testing