Skip to content

Conversation

@matt-bernhardt
Copy link
Member

@matt-bernhardt matt-bernhardt commented Jan 20, 2026

This wraps our current availability statement in the same logic that we use to build the links for record titles - going to full record pages in Primo. As a side effect, we need to overwrite some CSS rules that try and turn this statement white when it's visited.

I have two questions for reviewers:

  1. Should we use a helper method for the link logic, now that we're repeating it in two locations? We are using helpers right now in both search and record files, so I'm not sure about the right location, if we choose to go that route.
  2. The results stylesheet partial has one block of rules for the availability statement, and another block of rules for links in the results-get block (which includes the availability statement) - I chose to put the rules here in the link-focused area, but am open to feedback about other ways to approach it.

Ticket: https://mitlibraries.atlassian.net/browse/use-318

Developer

Accessibility
  • ANDI or WAVE has been run in accordance to our guide.
  • This PR contains no changes to the view layer.
  • New issues flagged by ANDI or WAVE have been resolved.
  • New issues flagged by ANDI or WAVE have been ticketed (link in the Pull Request details above).
  • No new accessibility issues have been flagged.
New ENV
  • All new ENV is documented in README.
  • All new ENV has been added to Heroku Pipeline, Staging and Prod.
  • ENV has not changed.
Approval beyond code review
  • UXWS/stakeholder approval has been confirmed.
  • UXWS/stakeholder review will be completed retroactively.
  • UXWS/stakeholder review is not needed.
Additional context needed to review

E.g., if the PR includes updated dependencies and/or data
migration, or how to confirm the feature is working.

Code Reviewer

Code
  • I have confirmed that the code works as intended.
  • Any CodeClimate issues have been fixed or confirmed as
    added technical debt.
Documentation
  • The commit message is clear and follows our guidelines
    (not just this pull request message).
  • The documentation has been updated or is unnecessary.
  • New dependencies are appropriate or there were no changes.
Testing
  • There are appropriate tests covering any new functionality.
  • No additional test coverage is required.

** Why are these changes being introduced:

We want the "availability statements" which we generate in our search
results to be links to the full record in Primo. These links should
match the links already present in the title elements.

** Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/use-318

** How does this address that need:

This replicates the link logic from the title element in _result_primo
in the availability span.

As a result of this, we also need to tweak the styling of visited links,
because visited links in the result block (which includes this link)
are defined to be white text (on a white background, because these links
are not buttons).

** Document any side effects to this change:

I have two questions about this work, which I'd like review to address:

1. Should we create a helper method to handle the link-building logic
for the title and availability text? Any thoughts about where this
helper lives, as we currently have helpers in both record and search?

2. The styles I'm working with come from two locations in the results
partial stylesheet. I've chosen to make this change around the other
link rules, but there is also an availability-specific short batch of
rules around line 334 if that makes more sense.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 21181155442

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.014%

Totals Coverage Status
Change from base Build 21072127310: 0.0%
Covered Lines: 1234
Relevant Lines: 1259

💛 - Coveralls

@mitlib mitlib temporarily deployed to timdex-ui-pi-use-318-av-mjquus January 20, 2026 17:32 Inactive
@matt-bernhardt
Copy link
Member Author

@djanelle-mit I'm tagging you for review here because I'm specifically interested in your thoughts about the CSS strategy I'm using here. If you'd like, I'm happy to create a ticket for you to deal with any styling tweaks after this, but if it's faster for me just to make a few tweaks I'm also happy to take direction.

@djanelle-mit
Copy link
Contributor

@matt-bernhardt Hmm... I think this might be worth a quick refactor now that we have a clear picture of what could go in that links area between LibKey, availability, etc.

Why don't we create a ticket for that and I can pick it up. What's there now is fine to roll out as-is. I need some time to think about how to treat these "tertiary" links... should they have the same blue underline styles that our main links do, or should they be subtle and only obviously a link on hover? Should there be some lighter weight but still noticeable link affordance?

@JPrevost JPrevost self-assigned this Jan 20, 2026
@matt-bernhardt matt-bernhardt merged commit cf86647 into main Jan 20, 2026
5 checks passed
@matt-bernhardt matt-bernhardt deleted the use-318-availability branch January 20, 2026 20:20
@matt-bernhardt
Copy link
Member Author

matt-bernhardt commented Jan 20, 2026

The style refactoring work has been ticketed as USE-339 (please double-check this, as the ticket was initially created under the TSS space for unknown reasons - I've tried to move it)

@djanelle-mit
Copy link
Contributor

djanelle-mit commented Jan 20, 2026

The style refactoring work has been ticketed as USE-339 (please double-check this, as the ticket was initially created under the TSS space for unknown reasons - I've tried to move it)

Yep, I'm seeing it as I'd expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants