feat(core): live shelf ingest progress + Little Red Riding Hood demo book

Draft
CU
5mo ago
+1011-84

Summary

Implements live shelf ingest progress (the largest UX gap: users could upload a book and see a frozen "Preparing" chip with no feedback) and adds a second public-domain demo book.

Primary improvement: live ingest progress on the shelf

  • LibraryEventStream subscribes to GET /api/books/events (SSE) for ingest_progress events
  • Poll fallback every 5s while any book is importing
  • Progress bars + stage labels on desktop BookCover and mobile BookCard
  • Import gate prevents opening non-ready books with a clear dialog
  • Upload error messages on the desktop shelf toolbar

New open-source book

  • Little Red Riding Hood (Brothers Grimm, public domain) — assets/books/little_red_riding_hood.pdf + build_little_red_riding_hood_pdf.py
  • make demo-pdf builds both fairy tales; make seed-demo-books seeds both through the real ingest flow

Second improvement (from user walkthrough)

  • displayBookTitle() strips internal (e2e seed) suffixes from shelf UI
  • Shelf metrics button hidden outside dev builds (was exposing §13 eval tooling to readers)
  • Sign-out confirmation on desktop library
  • Mobile demo login aligned with demo@kinora.local credentials

Verification

make install && make demo-pdf
pnpm --filter @kinora/core test
make app-typecheck
make stack-up && make seed-demo-books   # full stack
make app-desktop-dev                    # walkthrough at :5173

Walkthrough tested

  • Onboarding → demo login → library with two books → reading room (PDF + cinema) → Director tab → back to shelf
Open in Web View Automation 

Summary by cubic

Adds live ingest progress to the library shelf with SSE and a 5s poll fallback, showing progress bars and stage labels on desktop and mobile. Also adds the public‑domain “Little Red Riding Hood” demo book and polishes shelf UX.

  • New Features

    • Live ingest: LibraryEventStream subscribes to /api/books/events (SSE) with a 5s poll fallback; shelf shows progress bars and stage labels on desktop BookCover and mobile BookCard.
    • Import gate: blocks opening non‑ready books with a clear dialog/alert; upload errors appear in the desktop shelf toolbar.
    • Core helpers/events: added displayBookTitle, stageLabel, progressPercent, importGateMessage; extended ingest_progress payload to include stage and pct; added tests.
    • Demo content: added “Little Red Riding Hood” PDF and builder; make demo-pdf builds both demos; make seed-demo-books seeds both via the real ingest flow.
    • UX polish: hides shelf metrics outside dev; adds sign‑out confirmation on desktop; aligns mobile demo login to demo@kinora.local.
  • Migration

    • Build demo PDFs: make demo-pdf
    • Seed both demos (optional): make seed-demo-books
    • Mobile demo login: demo@kinora.local / demo-password-123