Commit Graph
7 Commits
Author SHA1 Message Date
836061373 78a67b5f97 fix: reader blank viewport when scrolling into estimated spacer regions
Spacers are estimated from average paragraph height, so fast scrollbar
drags could land the viewport inside the blank bottom spacer where the
old append-at-document-bottom logic never reached. Now every scroll
event maps scrollTop back to a paragraph index; if it falls outside the
rendered window the window re-renders around it and re-anchors the
scroll position (self-healing), with edge-batching loops for large jumps.
2026-09-13 00:37:05 +08:00
836061373 24373e298a feat: implement TXT reader MVP per product/tech design
- Vite + Vue 3 + TS scaffold with hash router (bookshelf / reader)
- core/: encoding detection (UTF-8 strict, GBK fallback, gb18030 last resort),
  paragraph chunker with original-text offsets, offset utils, IndexedDB wrapper
- Reader: windowed paragraph rendering with estimated spacers (constant ~240 DOM
  paragraphs), font-size/line-height settings via CSS vars persisted to localStorage
- Progress: character-offset based, debounced save + flush on back/unload, exact
  restore via binary search; shelf shows percent
- 21 vitest unit tests for core modules
2026-09-13 00:28:06 +08:00
836061373 d009a14ca2 docs: add technical design for TXT reader MVP 2026-09-13 00:04:00 +08:00
836061373 c85f275b89 chore: remove hook state files and add .gitignore 2026-09-13 00:01:12 +08:00
836061373 f714d006b6 feat: add TXT reader demo with mock data (bookshelf, reader, progress restore) 2026-09-13 00:00:59 +08:00
836061373 555ee92eb8 docs: add MVP product design for TXT ebook reader 2026-09-12 23:42:50 +08:00
836061373 a034d4b22d docs: add AGENTS.md with commit and testing guidelines 2026-09-12 23:36:21 +08:00