Repository navigation
feat(apps): live shelf import progress, bundled Red Riding Hood, remove failed books - #8
Draft
cursor[bot] wants to merge 4 commits into
Draft
cursor[bot] wants to merge 4 commits into
cursor[bot] wants to merge 4 commits into
Conversation
- Add LibraryEventsClient in @kinora/core for /api/books/events SSE - Wire desktop and mobile shelves with live progress + polling fallback - Block opening books until ready; show upload errors on desktop - Add Little Red Riding Hood public-domain book + seed-library script Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
- Add DELETE /api/books/{id} with ownership check and progress cleanup
- Show remove affordance on failed book covers (desktop + mobile)
- Add API test for shelf deletion
Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
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.
Summary
This PR delivers three user-facing improvements discovered from a full walkthrough of the Kinora desktop app:
1. Live import progress on the shelf (large UX improvement)
The backend already exposed
GET /api/books/events(SSEingest_progress) and bookprogress/stagefields, but neither desktop nor mobile subscribed. This wires the existing infrastructure end-to-end:LibraryEventsClientin@kinora/core— SSE client with reconnect + cache patching helpersuseLibraryEventshook on both shelves — live progress updates + 4s polling fallback while any book is importingBookCover/BookCard(e.g. "Analyze · 45%")status === ready(failed/importing books cannot be opened)POST /api/booksfails/api/books/events)2. New public-domain book: Little Red Riding Hood
assets/books/build_little_red_riding_hood_pdf.py— 5-page Grimm tale with text layer + vector artmake demo-pdfbuilds both Frog-King and Red Riding Hood PDFsmake seed-libraryuploads both bundled books via the live API (idempotent — skips titles already on shelf)3. Remove failed imports from shelf (second improvement from testing feedback)
Walkthrough showed failed imports cluttering the shelf with no recourse. Added:
DELETE /api/books/{book_id}— ownership-checked removal with progress key cleanuptest_delete_book_removes_from_shelfVerification
Manual walkthrough (desktop @ :5173, demo@kinora.local / demo-password-123):
Notes
DASHSCOPE_API_KEY; withtestplaceholder, books reachfailedquickly — the new UX surfaces that state clearly and lets users clean up.KINORA_LIVE_VIDEO=falseunless intentionally testing live video spend.Summary by cubic
Show live import progress on the shelf across desktop and mobile, with progress bars and stage labels; books only open when ready, and failed imports can be removed. Also bundles Little Red Riding Hood and adds a script to seed both demo books.
New Features
LibraryEventsClientin@kinora/coreplususeLibraryEventshooks (desktop + mobile) with a 4s polling fallback.status=ready; desktop shows an upload error banner on failed POSTs.DELETE /api/books/{book_id}with ownership and progress cleanup; remove affordance on failed covers (desktop ✕, mobile “Remove”).make demo-pdfbuilds both Frog‑King and Red Riding Hood;seed_library.pyandmake seed-libraryupload both idempotently.Bug Fixes
Written for commit f3e8e78. Summary will update on new commits.