feat: Consolidate sidebar buy options into unified Buy button dropdown#13113
Open
Sadashii wants to merge 5 commits into
Open
Conversation
Sadashii
force-pushed
the
12826/feat/consolidate-sidebar-buy-options-into-buy-button
branch
from
July 17, 2026 07:19
b59e86d to
a36b303
Compare
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull request overview
Consolidates “Buy” affordances into the unified Buy popover on edition pages by removing the legacy sidebar vendor panels and restyling affiliate link options for a flatter, full-row-clickable dropdown list. This aligns the edition page CTA area with the newer popover-based UI patterns.
Changes:
- Removes the legacy mobile/desktop vendor panels from the edition page and renders affiliate links inside an
<ol-popover>Buy dropdown. - Refactors affiliate links markup (loading indicator + store list) to use
<div>containers and a flat list layout with prices aligned right. - Adds CSS for the Buy popover (trigger + content) and makes the left “editionCover” column sticky on desktop.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| static/css/components/work.css | Makes the edition cover/tool column sticky on desktop for persistent CTAs. |
| static/css/components/read-panel.css | Adds styling for the Buy popover dropdown and custom Buy button layout. |
| openlibrary/templates/type/edition/view.html | Removes the legacy mobile vendor panel from the edition page layout. |
| openlibrary/macros/LoanStatus.html | Removes the post injection point previously used for rendering the lists widget within LoanStatus. |
| openlibrary/macros/databarWork.html | Adds the Buy <ol-popover> and relocates the lists widget rendering after the CTA area. |
| openlibrary/macros/AffiliateLinksLoadingIndicator.html | Switches the async loading wrapper from <span> to <div>. |
| openlibrary/macros/AffiliateLinks.html.jinja | Refactors affiliate link items into full-row clickable blocks with name/price alignment and updated disclaimer styling hook. |
| openlibrary/i18n/messages.pot | Updates extracted string references and reintroduces “Buy this book” for the new popover aria-label. |
| docker/Dockerfile.olbase | Touches node_modules before make to avoid rebuild churn during image build. |
| bundlesize.config.json | Adjusts bundlesize max for admin CSS bundle. |
Comment on lines
+5
to
+8
| $# Buy button is primary (blue) only when no digital access and a WorldCat URL exists | ||
| $ availability = (page.availability or {}) if hasattr(page, 'availability') else {} | ||
| $ _has_digital = bool(page.get('ocaid') or availability.get('is_readable') or availability.get('status') == 'open' or availability.get('is_lendable') or availability.get('is_previewable')) | ||
| $ buy_is_primary = editions_page and not _has_digital and bool(worldcat_url) |
|
|
||
| $if editions_page: | ||
| <ol-popover class="buy-popover" aria-label="$_('Buy this book')"> | ||
| <button slot="trigger" type="button" class="cta-btn cta-btn--w-icon cta-btn--buy"> |
Comment on lines
+336
to
+350
| .cta-btn--buy { | ||
| position: relative; | ||
| background-color: var(--grey-464646); | ||
| color: var(--white); | ||
| margin-top: 0; | ||
| height: 37px; | ||
| padding: 0 var(--spacing-inset-sm); | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| .cta-btn--buy:hover { | ||
| background-color: var(--dark-grey); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12867
Consolidates the sidebar WorldCat/library locate links and purchase/affiliate options into the unified "Buy" split-popover button on the edition and work pages, and removes the legacy sidebar vendor panels completely on desktop and mobile.
Technical
databarWork.htmlto render the "Buy" button popover containing asynchronous store options.AffiliateLinks.html.jinjaandAffiliateLinksLoadingIndicator.htmlto use div containers and render a flat list of stores with full-row clickability.width: 100%) and240pxon desktop..editionCoverleft column sticky on desktop to keep actions visible during scroll.Testing
uv run --with-requirements requirements_test.txt pytest openlibrary/tests/test_templates.pyScreenshot
screen-capture.webm
Stakeholders
@mekarpeles @lokesh