Problem: Users worry about losing their reading position, font size, and theme preferences if their browser crashes or they accidentally close the tab. While settings are already saved on change, the reading position (current book and chapter) should also be preserved automatically.
Solution: A periodic auto-save (every 30 seconds) that captures the current reading position, font size, and theme to localStorage. On next visit, the app can restore exactly where the user left off.
Not included: Cloud sync of reading position or cross-device resume. This is localStorage only.
Expected behavior:
What's auto-saved:
bookId and chapterEdge cases:
TODO: Verify which settings are already saved on change vs which need periodic saving
No UI — auto-save is invisible to the user. They simply find their position restored on next visit.
Implementation:
setInterval in the reader page component, every 30,000ms{bookId, chapter} to localStorage under a lastPosition keyTODO: Check what's already implemented — the reader may already partially do this
Files:
apps/web/src/routes/(app)/read/[[book]]/[[chapter]]/+page.svelte (modify)apps/web/src/lib/stores/settings.svelte.ts (may already handle some of this)Current: PLANNED Milestone: Foundation Priority: Low — most settings already save on change, this is a safety net
History:
Dependencies: