tvhong/incremental-reading

Up and Down arrow keys scroll too far if the IR note is long

Closed this issue · 2 comments

Describe the bug
If the IR note is long enough, the Up and Down arrow keys scroll too far and this makes the keys unusable for reading.

To Reproduce
Steps to reproduce the behavior:

  1. Import a very long note (e.g. https://super-memory.com/help/read.htm)
  2. Read it in Incremental Reading add-on
  3. Press "Down" key
  4. See that it scrolls much further than a single page

Expected behavior
Up and Down arrow keys should only scroll half a page to a full page.

Hm.. I can't reproduce this on Anki on my Mac.

  • OS: MacOS Ventura, Version 13.2.1
  • Anki Version ⁨2.1.57 (6b7d372c)⁩
  • Python 3.9.15 Qt 6.3.2 PyQt 6.3.1
  • Incremental Reading Version 4.11.4

The logic of scrolling is:

let movementSize = window.innerHeight * getMovementFactor(e.code);

https://github.com/tvhong/incremental-reading/blob/main/ir/web/scroll.js#L40

window.innerHeight is the height of the view window, and the movementFactor are configurable via the add-on's configuration:
Screenshot 2023-02-20 at 11 33 04 AM

So, scrolling by 5% of view window should be consistent across articles of different length. So, the behavior on my Mac makes sense.

Maybe I made a mistake when reporting this issue?