Commit Graph
8 Commits
Author SHA1 Message Date
pj 608ba2f21b fix(persist): schema-version guard and editor content check
A book file's declared schema was never read, so a file from a newer
app version would be opened, normalized and autosaved over in the old
format. Refuse to open books whose schema is newer than supported.
Enable the editor content check so chapters with unreadable content
warn the user instead of silently loading stripped content that the
next edit would persist.

Claude-Session: https://claude.ai/code/session_01RzTWrLiy4zGuw2hZSQGamk
2026-06-22 13:32:33 -04:00
pj c0da4c53db fix(editor): isolate undo history per chapter
Key the editor by chapter id so each chapter gets a fresh TipTap
instance with its own history. Previously a single instance was reused
across chapters, so the content swap entered the undo stack and Ctrl+Z
after switching restored the prior chapter's doc into the current one,
which autosave then persisted.

With remount, save the cursor/scroll position on unmount (from a ref,
not the editor, which is destroyed by then) and load it on mount,
replacing the in-place chapter-switch bookkeeping.

Claude-Session: https://claude.ai/code/session_01RzTWrLiy4zGuw2hZSQGamk
2026-06-22 13:13:12 -04:00
pj 8b83f80d52 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.
2026-06-22 12:09:34 -04:00
pj 19c4823d3d changes 2026-06-22 11:56:31 -04:00
pj 706db33792 changes 2026-06-22 11:45:21 -04:00
pj c4b69f3641 fix(editor): defer render and load content per chapter for WebKit 2026-06-20 13:28:25 -04:00
pj 6dc1aeb99b feat(editor): add floating formatting toolbar 2026-06-20 12:46:18 -04:00
pj 3cf07d4ef6 feat(editor): add TipTap semantic editor 2026-06-20 12:28:43 -04:00