feat(library): real page-1 cover thumbnails and shelf search#38
Conversation
Render the first page of each PDF to a compact JPEG thumbnail at import time and store it on the cached doc, so the shelf shows actual book covers instead of a title-initial tile. Falls back to the letter tile for docs cached before covers shipped or whose render failed. Add a title/author search box to the populated shelf (shown once the library grows past a handful of books), with an empty-result message and the add-book tile hidden while filtering. https://claude.ai/code/session_01MJHpoe4dutMMAHVk78tt1F
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 53 minutes and 59 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a ChangesCover pipeline and shelf search
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant extractPdf
participant renderCover
participant ReaderStore
participant Library
User->>App: drop / import PDF file
App->>extractPdf: extractPdf(file)
extractPdf->>renderCover: renderCover(pdf)
renderCover-->>extractPdf: cover JPEG data URL (or undefined)
extractPdf-->>App: ExtractedDoc { cover, title, author, ... }
App->>ReaderStore: upsert CachedDoc { cover, title, author, ... }
User->>Library: view shelf
Library->>ReaderStore: read shelf items
Library-->>User: BookCover renders img thumbnail when cover present
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Address review findings on the covers + search change: - The search box was gated on items.length > 6 recomputed each render, so deleting books from a filtered shelf until <=6 remained hid the input while the query stayed active, stranding the filter with no way to clear it. Keep the box mounted whenever a query is present. - renderCover discarded a valid cover when toDataURL fell back to PNG (browsers without JPEG canvas export); accept any data:image/ URL. https://claude.ai/code/session_01MJHpoe4dutMMAHVk78tt1F
Render the first page of each PDF to a compact JPEG thumbnail at import
time and store it on the cached doc, so the shelf shows actual book
covers instead of a title-initial tile. Falls back to the letter tile
for docs cached before covers shipped or whose render failed.
Add a title/author search box to the populated shelf (shown once the
library grows past a handful of books), with an empty-result message and
the add-book tile hidden while filtering.
https://claude.ai/code/session_01MJHpoe4dutMMAHVk78tt1F
Summary by CodeRabbit