feat(desktop): live ingest progress on library shelf + demo book

Draft
CU
5mo ago
+987-55

Summary

Improves the core library → ingest → open funnel, adds a second public-domain demo book, and addresses issues found during a full user walkthrough.

Primary UX improvement: live ingest progress on the shelf

  • Subscribe to GET /api/books/events for real-time Phase A ingest updates
  • Patch the shelf cache as stages/progress arrive; poll as a fallback while books are importing
  • Show upload errors, an adapting banner, per-cover progress bars, and block opening non-ready books
  • Add IngestProgressView in the reading room when a book is still importing/failed
  • Shared helpers in @kinora/core: parseIngestProgress, applyIngestProgress, uploadBook

New open-source book

  • Little Red Riding Hood (Brothers Grimm, public domain)
  • Builder: assets/books/build_red_riding_hood.py
  • PDF: assets/books/little_red_riding_hood.pdf
  • make demo-pdf now builds both demo books
  • make seed-demo SEED_ARGS="--all" seeds Frog-King + Red Riding Hood

Second improvement (from user testing)

  • Dismissible banner when clicking a failed-import book with re-upload guidance
  • Book count hint on the shelf; clearer upload format guidance
  • Better demo-login error message when seed-demo has not been run
  • backend/scripts/user_walkthrough.py for manual API QA

Verification

make install
make demo-pdf
make app-typecheck
pnpm --filter @kinora/core test
pnpm --filter @kinora/desktop typecheck

# Full stack (needs DashScope key for real ingest)
make stack-up
make seed-demo SEED_ARGS="--all"
make app-desktop-dev

Manual walkthrough performed against local API + Vite renderer with e2e seed data.

Open in Web View Automation 

Summary by cubic

Live ingest progress is now shown on the desktop shelf with real-time updates, and the reader blocks early opens with a friendly progress screen. Adds a second public-domain demo book and improves upload and demo-login feedback.

  • New Features
    • Live ingest on the shelf: subscribe to GET /api/books/events (SSE) with a polling fallback; @kinora/core helpers (parseIngestProgress, applyIngestProgress, useLibraryEvents) keep the shelf cache fresh, with tests added.
    • UI updates: per-cover progress bars and shimmering “working” state; opening is disabled until ready; clicking a failed-import cover shows guidance; a banner summarizes importing books; the reader shows IngestProgressView with stage and percent.
    • Upload UX: switched to @kinora/core uploadBook for typed errors and clearer messages; inline error banner on failure; newly uploaded books get a temporary highlight; shelf shows book count and adds PDF/EPUB guidance.
    • Demo content and tooling: new “Little Red Riding Hood” book + builder; make demo-pdf builds both demos; make seed-demo SEED_ARGS="--all" seeds Frog-King + Red Riding Hood; improved demo-login error with seeding steps; added backend/scripts/user_walkthrough.py for manual API QA.