Skip to content

feat: live shelf ingest progress + import gate for non-ready books - #5

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/user-experience-and-testing-ebc0
Draft

cursor[bot] wants to merge 2 commits into
mainfrom
cursor/user-experience-and-testing-ebc0

Conversation

@cursor

@cursor cursor Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

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 LibraryEventStream in @kinora/core with 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 / failed books 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-glass via dynamic require (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).

Open in Web View Automation 

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/events via LibraryEventStream in @kinora/core with a 3s poll fallback; mobile polls while importing. Status chips show “Stage · %”.
    • Import gate: block opening importing/failed books on the shelf and in the reading room. Desktop dialog and mobile sheet use shared copy via importGateMessage in @kinora/core.
    • Demo content: adds “Little Red Riding Hood” PDF; make demo-pdf now builds it.
  • Bug Fixes

    • Prevent Linux Electron startup crash by loading electron-liquid-glass with dynamic require when the native module isn’t available.

Written for commit 647b83e. Summary will update on new commits.

Review in cubic

cursoragent and others added 2 commits June 23, 2026 19:08
Subscribe desktop shelf to GET /api/books/events for real-time ingest
stage/pct updates, with polling fallback until books reach ready/failed.
Mobile polls while importing (no EventSource). Add Little Red Riding Hood
as a second bundled public-domain demo PDF.

Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
Walkthrough showed failed imports opened into a normal reading room with
no explanation. Gate importing/failed books on the shelf with a clear
dialog; show the same message if the reading-room route is hit directly.
Load electron-liquid-glass via dynamic require so Linux builds start.

Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant