Archived
- add uv configuration for the backend - update frontend to make auth work - add new auth endpoints - add bookmars feat - add reader feat
3.6 KiB
3.6 KiB
016 — Bookmark reading anchor
Status: Implemented
Created: 2026-06-04
See also: 015 — EPUB bookmarks and notes
Objective
Let users jump to a bookmark to review a passage without overwriting their true reading position. While peeking, show a high-visibility control to return to where they were reading.
Definitions
| Term | Meaning |
|---|---|
| Reading anchor | EPUB CFI (+ optional %) captured immediately before a bookmark peek |
| Peek mode | Temporary view at a bookmark location; server ReadingProgress is not updated |
| Resume | Jump back to the reading anchor and re-enable progress persistence |
Problem (before)
“Go to passage” called jumpToCfi, which triggered locationChanged and debounced PATCH /books/ebooks/{id}/progress/, replacing epub_location and current_position with the bookmark. Library progress and the next reading session started at the bookmark instead of the real position.
Triggers (enter peek mode)
- In-reader: Go to passage in
BookMarkersPanel - Global: Go to passage on
/bookmarks-notes→/read/:idwithstate.epubLocation(bookmark CFI)
Non-triggers
- Table of contents navigation
- Prev / next page buttons
- Creating a new bookmark from text selection
- Opening the book normally from the library (no
epubLocationin router state)
UX
Resume control
- Component:
ResumeReadingButton - Visible only when
isBookmarkPeekActive && readingAnchor != null - Position: right edge, above the next-page chevron (
.reader-page-nav--next) - Style: warm accent (
#ea580c/#f97316), white label/icon; distinct from muted gray nav buttons - Action:
resumeReadingAnchor()— hides control, returns to anchor CFI - i18n:
reader.resumeReading,reader.resumeReadingAria
Anchor policy
- First anchor is captured when peek starts; additional “Go to passage” clicks while peeking do not replace the anchor until the user resumes or leaves the reader.
Progress rules
| Mode | PATCH .../progress/ |
|---|---|
| Normal reading | Yes (debounced on locationChanged, sync after locations ready) |
| Bookmark peek | No — flushProgress / scheduleProgress no-op |
| After resume | Yes — flush anchor CFI and percentage once |
Load from bookmarks page
- Fetch saved
ReadingProgressfrom API. - If
state.epubLocationis set and savedepub_locationexists → store saved location as anchor, set peek mode, open at bookmark CFI. - Do not persist bookmark location as progress during peek.
In-reader peek
- Capture current
location(CFI) as anchor (if valid). - Enter peek mode, jump to bookmark CFI.
API
No backend changes in v1. Anchor is session-only in useEpubReader.
Verification
- Read to ~30%, open markers, Go to passage on an early bookmark → jumps; after debounce, library/API progress still reflects ~30% (not bookmark).
- Orange Back to reading appears above the next chevron only during peek.
- Tap resume → returns to ~30%; button hides; progress saves resume.
- From
/bookmarks-notes, Go to passage → peek + resume using saved progress as anchor. - TOC / prev / next do not show the resume button.
- EN/ES strings present.
Out of scope
- PDF reader
- Multiple anchor history stack
- Backend
resume_epub_locationfield - Peek mode for TOC jumps