BlueGreenMagick / Edit-Field-During-Review-Cloze

Code for the Anki addon Edit Field During Review Cloze
https://ankiweb.net/shared/info/385888438
Other
18 stars 3 forks source link

Anki "twitching" when opening cloze cards #65

Open ankidoc opened 3 years ago

ankidoc commented 3 years ago

Hello!

So I noticed that my Anki "twiches" when I use this add on. Meaning, that when I'm reviewing and opening cloze cards (doesn't occur on front/back) it quickly "moves" for a millisec from right to left (no big movement but it's really annoying).

I nailed it down to this add on by disabling everything else but this. I heavily use this add on so I really hope you can help.

Here is with enabled add on: https://user-images.githubusercontent.com/81517565/139289206-aa48fde1-e485-4c9d-8add-c9f977210ce1.mp4

here without: https://user-images.githubusercontent.com/81517565/139289312-03a95f7e-be74-4310-a0b8-188550186dd7.mp4

Greetings!

P.S.: if it is any help here are my installed add ons:

CleanShot 2021-10-29 at 08 38 27@2x
BlueGreenMagick commented 3 years ago

Thanks for the detailed video evidence!

From your video, it looks like the twitching happens right after the underline appears. so I suspect it's because of the interaction between this and that add-on.

Could you check if my guess is correct by disabling only that add-on/script and see if the twitch still happens?

ankidoc commented 3 years ago

Hello!

So when I disable "edit during review cloze" add on the twitchting is in fact not present.

I've also noticed, that this twitching is present in other cloze add ons like cloze overlapper, even when I did not add the :edit in the template of the back/front cards.

Does this help in any way?

I hope this was the requested information.

Greetings

BlueGreenMagick commented 3 years ago

From your screenshot video, the "twitch" seems to happen just before certain words like "Adenosin" is underlined. I'm not sure which add-on that does that (Maybe it's the Amboss add-on?) but I suspect that add-on may be the actual cause.

My guess is that the 'underlining add-on' makes some words move a little, but it happens instantaneously so you only see the word after it moved. But with add-ons like Edit Field and Cloze Overlapper makes it take longer to load the card, so you can see the word before the move, and after the move. And thus the "twitching".

Can you try disabling the add-on that underlines those words and see if the "twitch" still happens?

ankidoc commented 3 years ago

Ah thanks for clearing that up. So well what can I say the suspect amboss caused the problem! Thank you so much. So in fact I run a Macbok Pro mid 2015 with 16 gb and i7 with 2,2 GHz. So it's a bit older right. Does that mean that it's not capable of processing those two add ons at the same time? Or is there another possibility where one can "delay" the loading of the amboss add on (because it's just secondary). Just asking because in another add on I think it is the "no distraction full screen" add on you can set times for transition into the mode and for "rendering" too. So basically I have no idea about Anki and add ons, just wanted to give my input.

Thank you so much!

BlueGreenMagick commented 3 years ago

Since you can't see the twitch with this add-on disabled, I think it means this add-on is taking a lot of time to load. You might be able to make this add-on run a little faster by removing edit: on fields you don't actually edit while reviewing.

Also, I can't produce the script off the top of my head, but if you have some JavaScript and CSS knowledge, it should be possible to utilize fadein/fadeout to reduce twitching.

I'll look into trying to make this add-on faster. Although because it's not a critical bug, I'll likely do it when this add-on has some other bugs to fix. So I can do them all at the same time.

ankidoc commented 3 years ago

thanks so much!