yiekheng cd1fd6ad64 Reader: make position tracking accurate to sub-200ms
- Throttled write inside the scroll rAF tick (every 200ms during active
  scroll) captures mid-page ratio changes. Previously only page-boundary
  crossings triggered writes, so refreshing mid-page restored to top of
  that page instead of exact position.
- pagehide + visibilitychange + unmount flush captures the final 0-200ms
  before tab close / bfcache / nav.
- hasScrolledRef guards writes so opening a chapter without scrolling
  doesn't clobber a prior deep-progress bookmark for a different chapter.
- getBoundingClientRect replaces offsetTop/offsetHeight for subpixel
  precision and positioning-ancestor independence.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 22:05:35 +08:00
..
2026-03-25 22:20:37 +08:00