Skip to content

Redesign Locate button as "Check Options" with on-site anchor navigation#12191

Draft
mekarpeles wants to merge 2 commits intomasterfrom
12105/redesign/locate-btn
Draft

Redesign Locate button as "Check Options" with on-site anchor navigation#12191
mekarpeles wants to merge 2 commits intomasterfrom
12105/redesign/locate-btn

Conversation

@mekarpeles
Copy link
Member

Closes #12105

Summary

  • Renames the "Locate" CTA button to "Check Options" across all render contexts (search results, carousels, edition page)
  • Changes the destination from an off-site WorldCat redirect (/books/{key}/-/borrow?action=locate) to an on-site anchor (/books/{key}#check-options) that scrolls to the edition page's vendor/library section
  • Adds id="check-options" to both .panel.desktop-vendor (sidebar, shown on desktop) and .panel.mobile-vendor (main content, shown on mobile) so the anchor works at all breakpoints
  • Adds a 3s glow animation (:target + @keyframes) using var(--primary-blue) to visually highlight the section on arrival — same pattern as PR Clicking Book Page Star Ratings summary goes to ratings section #7125 (star ratings)
  • Removes the now-dead action == 'locate' → WorldCat server-side redirect in borrow.py

Files Changed

File Change
openlibrary/macros/LocateButton.html Rename label, new anchor URL, drop target="_blank" / cta-btn--external, update analytics key
openlibrary/macros/databarWork.html Add id="check-options" to .desktop-vendor
openlibrary/templates/type/edition/view.html Add id="check-options" to .mobile-vendor
static/css/components/read-panel.css Glow keyframe animation + :target rules + smooth scroll
openlibrary/plugins/upstream/borrow.py Remove action=locate WorldCat redirect

Test plan

  • On a book page, click "Check Options" — page should smooth-scroll to the vendor/library panel, which briefly glows blue
  • From search results, click "Check Options" — should navigate to the edition page and scroll/highlight the vendor panel
  • Verify on mobile (< 960px) — .mobile-vendor is the visible target and also receives the glow
  • Confirm data-ol-link-track="CTAClick|CheckOptions" fires on click
  • Confirm the old /books/{key}/-/borrow?action=locate URL no longer redirects to WorldCat (404 or falls through to borrow handler)
  • Editions without ISBN/OCLC: vendor panel renders gracefully (WorldcatLink absent, affiliate links absent — section still present as anchor target)

Reference

…ion (#12105)

Replaces the "Locate" CTA button (which sent patrons off-site to WorldCat)
with a "Check Options" button that keeps patrons on Open Library by navigating
to the edition page's vendor/library section via an anchor link.

Changes:
- LocateButton.html: rename label to "Check Options", update href from
  `/books/{key}/-/borrow?action=locate` to `/books/{key}#check-options`,
  remove `target="_blank"` and `cta-btn--external` class, update analytics
  tracking attribute to `CTAClick|CheckOptions`
- databarWork.html: add `id="check-options"` to `.panel.desktop-vendor`
  so the sidebar vendor/library section is a named anchor target
- view.html: add `id="check-options"` to `.panel.mobile-vendor` so the
  responsive mobile equivalent is also reachable as an anchor target
- read-panel.css: add `@keyframes check-options-highlight` glow animation
  (uses `var(--primary-blue)`, fades out over 3s) and `:target` rules for
  `.desktop-vendor` and `.mobile-vendor` with `scroll-margin-top: 80px` to
  clear the sticky header; add `scroll-behavior: smooth` to `html`
- borrow.py: remove the dead `action == 'locate'` → WorldCat redirect

Approach follows the pattern established in PR #7125 (star ratings scroll/highlight).
@mekarpeles mekarpeles force-pushed the 12105/redesign/locate-btn branch from 5ca4d7a to fd45cd1 Compare March 25, 2026 04:58
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.

Update Locate Button to navigate to Book Page section

1 participant