Epic: #13256 — "Continue Reading" Flow & Auto-Add Prompts (open)
This is Phase 3 of that epic. Check the epic issue for overall status and the dependency graph.
Dependencies
The following issues must be merged before work begins on this phase:
Feature Request
Problem / Opportunity
After Phase 1 (#13272) merges active CDL loans and loan history into a single carousel, and Phase 2 (#13273) captures open-access and browse interactions in localStorage, the two data sources still live in isolation. Patrons who read open-access books (which produce no server-side loan record) still see an empty dashboard when all their reading was done through "Read" or "Browse" links.
Success: After this ships, the "My Loans" carousel on My Books surfaces all three reading contexts — active loans, past loan history, and locally tracked open-access reads — so every patron who has touched at least one book sees a populated, personalized dashboard.
Proposal
Extend the unified Loans carousel (built in Phase 1) to also incorporate the client-side localStorage.ol_read_history store (built in Phase 2) as a third, lowest-priority data source:
- On page load, read
localStorage.ol_read_history entries in the frontend.
- Merge them with the server-rendered active loans + history list, deduplicating by OLID (server-side records take priority).
- Sort the final merged list by last-access timestamp descending.
- Render local-storage-only entries as lightweight cards (cover + title only; no loan action buttons since they are not active borrows).
This closes the gap for logged-out patrons and privacy-opt-out patrons: even if they have no server-side reading history, their locally tracked books appear in the carousel as a fallback.
Depends on: #13272 (Phase 1) and #13273 (Phase 2) being merged first.
This is Phase 3 of Epic #13256.
Breakdown
Implementation Details (for maintainers)
Related files
Refer to this map of common Endpoints:
openlibrary/plugins/openlibrary/js/my-books/store/readingHistory.js — Phase 2 local storage store (read getHistory())
openlibrary/templates/account/mybooks.html — carousel template, needs a JS hook to merge local entries post-render
openlibrary/plugins/upstream/mybooks.py — server-side carousel data assembly (Phase 1)
openlibrary/plugins/openlibrary/js/my-books/ — JS entry point for carousel augmentation logic [NEW file likely needed]
Requirements Checklist
Stakeholders
Instructions for Contributors
- Before creating a new branch or pushing up changes to a PR, please first run these commands to ensure your repository is up to date, as the pre-commit bot may add commits to your PRs upstream.
- JS must be ESLint-compliant, use single quotes, and contain no jQuery.
- Run
npm run test:js to validate merge/dedup logic unit tests pass.
Dependencies
The following issues must be merged before work begins on this phase:
Feature Request
Problem / Opportunity
After Phase 1 (#13272) merges active CDL loans and loan history into a single carousel, and Phase 2 (#13273) captures open-access and browse interactions in
localStorage, the two data sources still live in isolation. Patrons who read open-access books (which produce no server-side loan record) still see an empty dashboard when all their reading was done through "Read" or "Browse" links.Success: After this ships, the "My Loans" carousel on My Books surfaces all three reading contexts — active loans, past loan history, and locally tracked open-access reads — so every patron who has touched at least one book sees a populated, personalized dashboard.
Proposal
Extend the unified Loans carousel (built in Phase 1) to also incorporate the client-side
localStorage.ol_read_historystore (built in Phase 2) as a third, lowest-priority data source:localStorage.ol_read_historyentries in the frontend.This closes the gap for logged-out patrons and privacy-opt-out patrons: even if they have no server-side reading history, their locally tracked books appear in the carousel as a fallback.
Depends on: #13272 (Phase 1) and #13273 (Phase 2) being merged first.
This is Phase 3 of Epic #13256.
Breakdown
Implementation Details (for maintainers)
Related files
Refer to this map of common Endpoints:
openlibrary/plugins/openlibrary/js/my-books/store/readingHistory.js— Phase 2 local storage store (readgetHistory())openlibrary/templates/account/mybooks.html— carousel template, needs a JS hook to merge local entries post-renderopenlibrary/plugins/upstream/mybooks.py— server-side carousel data assembly (Phase 1)openlibrary/plugins/openlibrary/js/my-books/— JS entry point for carousel augmentation logic [NEW file likely needed]Requirements Checklist
getHistory()from the Phase 2 store to retrievelocalStorage.ol_read_historymybooks.htmland any associated i18n stringsStakeholders
Instructions for Contributors
npm run test:jsto validate merge/dedup logic unit tests pass.