glutanimate / review-heatmap

Anki add-on to help you keep track of your review activity
https://ankiweb.net/shared/info/1771074083
Other
1.2k stars 90 forks source link

Add-on not showing under decks after update from 2.1.35 to 2.1.49 #137

Closed skywalkercode closed 2 years ago

skywalkercode commented 2 years ago

Add-on still works perfectly fine under the main screen; however, it has stopped appearing under any deck when I click them when I have finished the cards under them. The heatmap still appears under decks when there are cards still available to do for the day.

Disabled all other add-ons with just heatmap on and nothing changes. I can easily toggle the main screen heatmap on and off under the config settings, but the deck toggle on or off doesn't seem to do anything. Only thing I changed was updating to 2.1.49 from 2.1.35

Is this a known issue or unique to me?

Any ideas?

AriaMoradi commented 2 years ago

The same issue on ArchLinux, and downgrading doesn't work either

ryloric commented 2 years ago

I think it has something to do with python 3.10.1 changing imports, I use ArchLinux too and saw the same issue after updating. A stack trace showed up before anki started saying something about not finding MutableSequence in collections.

I went to the file ~/.local/share/Anki2/addons21/review_heatmap/libaddon/gui/basic/interface.py and changed the line from from collections import MutableSequence, MutableSet, MutableMapping to from collections.abc import MutableSequence, MutableSet, MutableMapping and eveything seems to be working fine now.

I don't know enough python to make a PR but this change should probably fix the issue.

smartlitchi commented 2 years ago

@ryloric your solution fixed the addon not showing on the main screen (I had the same error message under archlinux and python 3.10.1) but I still don't get a review heatmap under each separate deck

AriaMoradi commented 2 years ago

I did these changes in ~/.local/share/Anki2/addons21/review_heatmap and everything works now:

1- heatmap.py and libaddon/anki/configmanager.py -> replace from anki.utils import json with import json 2- libaddon/gui/basic/interface.py -> replace from collections import MutableSequence, MutableSet, MutableMapping with from collections.abc import MutableSequence, MutableSet, MutableMapping

explanation: 1- This is a new requirement that was introduced in recent anki releases. 2- This is an API change in Python 3.10+

smartlitchi commented 2 years ago

After applying the fixes mentionned previously, there is still a scenario where the heatmap doesn't appear. It's after finishing all the reviews for the day for a given deck.

review-heatmap-done-deck

glutanimate commented 2 years ago

Hey everyone, it looks like the main issue described here was resolved with the v1.0.0 release (available on AnkiWeb).

@smartlitchi I've created a separate issue to track progress on the congrats screen integration, to make it easier to keep an overview: https://github.com/glutanimate/review-heatmap/issues/152. Let's move the discussion there