feat: live shelf ingest progress + import gate for non-ready books
Summary
Two UX improvements from a full user walkthrough of the Kinora desktop app:
1. Live shelf ingest progress (large improvement)
The backend already exposes GET /api/books/events (SSE) for ingest_progress, but the shelf never subscribed — import status chips froze until manual refresh.
- Added
LibraryEventStreamin@kinora/corewith cache patching helpers - Desktop shelf subscribes via EventSource + polls every 3s while any book is
importing - Mobile shelf polls while importing (no EventSource on RN)
- Status chips now show stage + percent (e.g.
Canon · 42%)
2. Import gate for non-ready books (from testing feedback)
Walkthrough found that books with IMPORT FAILED opened into a normal reading room with no error — users couldn't tell anything was wrong.
- Block opening
importing/failedbooks from the shelf with a clear dialog (desktop + mobile) - Reading room route also shows a gate if navigated directly
- Shared copy in
@kinora/core(importGateMessage)
Bonus
- Added Little Red Riding Hood as a second bundled public-domain demo PDF (
assets/books/little_red_riding_hood.pdf) - Fixed Linux Electron startup crash by loading
electron-liquid-glassvia dynamicrequire(graceful skip when native module unavailable)
Verification
make demo-pdf
pnpm --filter @kinora/core test
pnpm --filter @kinora/desktop typecheck
make stack-up && make seed-demo && make app-desktop-dev
Manual walkthrough: login as e2e@kinora.test, confirm live import chips, tap failed Little Red Riding Hood → import gate dialog instead of reading room.
New book
Public-domain Grimm tale built with assets/books/build_little_red_cap_pdf.py (5 pages, 3 characters for canon lock).


Summary by cubic
Adds live import progress to the shelf and blocks opening books that aren’t ready. Users see real-time stage and percent, and get a clear gate for importing or failed books.
-
New Features
- Live shelf progress: desktop subscribes to
GET /api/books/eventsviaLibraryEventStreamin@kinora/corewith a 3s poll fallback; mobile polls while importing. Status chips show “Stage · %”. - Import gate: block opening
importing/failedbooks on the shelf and in the reading room. Desktop dialog and mobile sheet use shared copy viaimportGateMessagein@kinora/core. - Demo content: adds “Little Red Riding Hood” PDF;
make demo-pdfnow builds it.
- Live shelf progress: desktop subscribes to
-
Bug Fixes
- Prevent Linux Electron startup crash by loading
electron-liquid-glasswith dynamicrequirewhen the native module isn’t available.
- Prevent Linux Electron startup crash by loading