Skip to content

"Continue Reading" Phase 1: Merge Active Loans & Loan History Carousel #13272

Description

@Sadashii

Epic: #13256 — "Continue Reading" Flow & Auto-Add Prompts (open)
This is Phase 1 of that epic. Check the epic issue for overall status and the dependency graph.


Feature Request

Problem / Opportunity

New patrons land on an empty My Books page — the Loans carousel just says "No books are on this shelf," with no path back to value. Most CDL loans are ~1hr; once expired, they vanish from the active dashboard with no "pick up where you left off" surface. Patrons who borrowed a book yesterday return to an empty dashboard with nothing to engage with.

The measurable impact is patron retention: populated shelves correlate strongly with retention, and today we have no mechanism to preserve short-term borrow history on the dashboard.

Success: After this ships, a patron who borrowed any book in the past will see it in their "My Loans" carousel even after the loan has expired, providing an immediate "continue reading" path.

Proposal

Replace the legacy active-only Loans carousel on the My Books page with a unified carousel that merges:

  1. Active CDL loans (books currently checked out).
  2. Past loan history (returned/expired borrows, sourced from user_borrow_history).

Books will be deduplicated by OLID (active loan takes priority) and sorted by last-access timestamp descending.

This is Phase 1 of Epic #13256.


Breakdown

Implementation Details (for maintainers)

Related files

Refer to this map of common Endpoints:

  • openlibrary/plugins/upstream/mybooks.py — loans data marshalling and carousel data assembly
  • openlibrary/templates/account/mybooks.html — carousel template rendering
  • openlibrary/core/lending.pyget_loans_of_user, _get_ia_loans_of_user, IA_Lending_API
  • openlibrary/plugins/upstream/account.pyget_loan_history_data for user_borrow_history

Requirements Checklist

  • Fetch active loans via get_loans_of_user in mybooks.py
  • Fetch historical loans via the user_borrow_history action on the lending API
  • Deduplicate merged list by OLID (active loan wins)
  • Sort merged list by last-access timestamp descending
  • Limit to a sensible maximum (e.g. 18 books)
  • Update mybooks.html to render the unified list in the carousel
  • Ensure cards correctly handle redirect keys (/books/ia:xxx → /books/OLxxx) for covers

Stakeholders


Instructions for Contributors

Activity

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

Metadata

Metadata

Assignees

Labels

Lead: @mekarpelesIssues overseen by Mek (Staff: Program Lead) [managed]Metric: RetentionSurface the value we have and give patrons reason(s) to stick aroundPriority: 2Important, as time permits. [managed]Theme: My Books

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions