Skip to content

feat: live shelf ingest progress + shelf error feedback - #9

Draft
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/user-experience-and-testing-44f4
Draft

cursor[bot] wants to merge 4 commits into
mainfrom
cursor/user-experience-and-testing-44f4

Conversation

@cursor

@cursor cursor Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

Summary

Two UX improvements from a full user run-through of Kinora:

1. Live shelf ingest progress (large improvement)

The backend already exposed GET /api/books/events (SSE ingest_progress), but neither app subscribed. This wires it up end-to-end:

  • LibraryEventsSource in @kinora/core — EventSource client for the library SSE stream
  • useLibraryIngestEvents hook on desktop + mobile — patches the React Query shelf cache with live stage + percent, with a 12s fallback poll while any book is importing
  • BookCover / BookCard — progress bar + percent on importing books; block opening until ready

2. Shelf error feedback (from testing)

During testing, uploading Little Red Riding Hood failed ingest (invalid DashScope key) with only a dim "Import failed" chip and no guidance. Also, a backend outage reads as "bare shelves."

  • Upload failures now surface the API error message in a dismissible banner
  • Failed imports show an actionable banner (check backend/.env / API key)
  • Library load errors show "Can't reach Kinora" with retry instead of an empty shelf

New open-source book

Added Little Red Riding Hood (Brothers Grimm, public domain) as a second bundled demo PDF:

  • assets/books/build_little_red_riding_hood_pdf.py
  • assets/books/little_red_riding_hood.pdf
  • make demo-pdf now builds both Frog-King and LRRH

Other fixes

  • Mobile reading room: fix MetricsSheet typo, add Metrics button to header
  • Playwright library.spec.ts smoke test (login → shelf → open book)

Verification

make install && make demo-pdf
pnpm --filter @kinora/core test
make app-typecheck
# With stack up + seed_e2e:
VITE_KINORA_API_URL=http://localhost:8000 make app-desktop-dev
# Upload a PDF and watch the shelf progress bar update live

Manual run-through: logged in as e2e@kinora.test, opened The Frog-King (e2e seed), exercised reading room + crew activity. Uploaded LRRH as demo@kinora.local — ingest failed as expected with test API key; the new failed-import banner addresses that gap.

Open in Web View Automation 

Summary by cubic

Adds live ingest progress and clearer error feedback to the shelf on desktop and mobile, so users see import stages, percent, and actionable messages. Also bundles a second demo book and adds a desktop smoke test.

  • New Features

    • Live ingest progress over SSE: subscribe to /api/books/events via LibraryEventsSource in @kinora/core and useLibraryIngestEvents (desktop + mobile). Shows stage + percent with a progress bar, auto-refetches on completion, and falls back to a 12s poll.
    • Shelf error feedback: upload failures show the API message in a dismissible banner; failed imports show guidance (check backend/.env / API key); backend load errors show “Can’t reach Kinora” with a retry.
    • New demo book: adds little_red_riding_hood.pdf and assets/books/build_little_red_riding_hood_pdf.py; make demo-pdf now builds both demos.
    • Desktop E2E: Playwright smoke test for login → shelf → open seeded book.
  • Bug Fixes

    • Mobile reading room: fix MetricsSheet typo and add a Metrics button to the header.
    • Desktop: correct .gitignore to ignore apps/desktop/test-results/.

Written for commit 874406f. Summary will update on new commits.

Review in cubic

cursoragent and others added 4 commits June 23, 2026 23:07
Subscribe desktop and mobile shelves to GET /api/books/events so Phase-A
import shows stage labels and a progress bar instead of a static chip.
Add Little Red Riding Hood as a second bundled public-domain demo book.

Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
Show actionable banners when uploads fail, imports fail (e.g. bad API key),
or the library cannot reach the backend. Fix mobile reading-room typo and
add Metrics to the header. Add Playwright library smoke test.

Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
Co-authored-by: Rishabh Bansal <rishabhcli@users.noreply.github.com>
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