fix(editor): persist per-chapter cursor and scroll across restarts

Positions were kept in an in-memory Map, so they were lost on quit and
the cursor jumped to the top on reopen. Store them in localStorage
(keyed by book + chapter, like theme/width) and restore on app open,
not just on in-session chapter switches. Also save the current chapter
continuously (debounced on selection + scroll) so closing the app
records where you left off, and re-apply scroll after fonts load.
This commit is contained in:
pj committed 2026-06-22 12:09:34 -04:00
1 parent 39609fbd09
commit 8b83f80d52
3 files changed
+67 -22

No files matched your search

+1
View File
@@ -263,6 +263,7 @@ export function EditorView() {
)}
</header>
<Editor
bookId={book.id}
chapterId={chapter.id}
content={chapter.content}
onChange={(content) => setChapterContent(chapter.id, content)}