CodingNic

Persist Reading Progress

Add Resume and Completion Behavior

Persist Reading Progress 18 min read

Add Resume and Completion Behavior

Add Resume and Completion Behavior

Task

Use the stored percentage to improve the Library and Reader behavior.

Treat a book as complete when its persisted progress reaches the completion threshold used by the application.

For example:

ts
const isComplete = percentage >= 0.98;

Keep the exact threshold centralized so the Library and Reader use the same rule.

Display a Resume action when progress exists and a Start Reading action when it does not.

When a completed book is opened again, allow the user to continue reading rather than forcing the position back to the beginning.

Test

Verify:

  • a new book shows Start Reading
  • a partially read book shows Resume
  • progress survives reloads
  • a nearly finished book becomes complete
  • opening a completed book still works

Checkpoint

Readly now has a complete read/resume workflow backed by persistent book-wide progress.

Module Complete

The Reader remembers where each user stopped. Module 8 builds the annotation system on the same authenticated Book boundary.