Anki Forums

Propagating tag changes to the sidebar and to add-ons

Hey @dae,

@AnKingMed made me aware that tag updates are no longer live-propagated to the browser sidebar when adding tags through an editor session or “Add Tags” in the browser.

Digging through the commit log, it seems like the behavior changed with this 2.1.28 commit, which introduced a bulk tagging API to the backend, but also removed the tag_list_did_update hook (which the browser used to subscribe to).

I was wondering if you had a chance to rethink the communication between the backend and the UI in this area, yet. It’s a minor regression from a feature standpoint, and you had valid reasons to decouple the backend from the UI, but I could definitely see users being confused by this change (and attributing it to add-ons).

For instance, I briefly looked into adding a workaround in BetterTags, but there really doesn’t seem to be any good way to do so. Monkey-patching tags.TagManager seems like a bad idea, and editor_did_update_tags is not change-aware, so it fires way too frequently to be useful for this purpose.

1 Like

I haven’t had time for this, but am leaning towards the backend keeping a timestamp of the latest tag update, so the UI can cheaply poll for changes and refresh if necessary. The same approach could possibly be extended to the deck list and note types as well.