Archived
- add uv configuration for the backend - update frontend to make auth work - add new auth endpoints - add bookmars feat - add reader feat
1.7 KiB
1.7 KiB
014 — Library reading progress badges
Status: Implemented
Created: 2026-06-04
Objective
Show accurate reading state on library book cards using saved EPUB progress instead of always displaying "Want to Read" (Quiero leer).
Data source
GET /api/books/ebooks/returnsprogress(0–100) fromReadingProgress.current_positionviaEBookListSerializer.get_progress.- Progress is updated by the web reader (
useEpubReader→PATCH .../progress/).
Display rules
| Progress | opened |
Badge | Cover extra |
|---|---|---|---|
null or 0 |
false | Want to Read | — |
0 |
true | Opened | — |
1–98 |
— | Reading · N% | Green progress bar on cover |
≥ 99 |
— | Finished | — |
Opened is set when the reader first displays (CFI saved, 0% progress). Turning pages moves to Reading.
Threshold constant: FINISHED_PROGRESS_THRESHOLD = 99 in frontend/src/utils/libraryStatus.ts.
Frontend changes
| File | Change |
|---|---|
utils/libraryStatus.ts |
deriveReadingStatus, normalizeProgressPercent |
pages/Library.tsx |
Map API progress → status; badge labels; client-side status filter |
locales/en-US.ts, es-ES.ts |
library.readingStatus.readingWithProgress |
pages/Library.module.css |
Cover progress bar styles |
Status filter
The reading-status filter in the library panel now filters client-side by derived status (want_to_read, reading, finished).
Verification
- New upload → Want to Read / Quiero leer
- Partial read → Reading · N% + progress bar
- Near end (≥ 99%) → Finished / Terminado
- Filters by Leyendo / Terminado work as expected