Hide badge when there are 0 new notifications
User
Translator
Feature description
When there are 0 new notifications, the badge at the upper right corner of the icon in the toolbar can be hidden to avoid distraction.
Hey.
Thanks for the suggestions. I have checked how other add-ons behave and it indeed seems I took a different approach here than the majority. To clarify, would you consider the following behavior adequate?
- [x] https://github.com/MikkCZ/pontoon-addon/pull/759 data loaded, one or more notifications: red badge with the number of notifications
- [x] https://github.com/MikkCZ/pontoon-addon/pull/759 data loaded, no notifications: no badge
- [x] https://github.com/MikkCZ/pontoon-addon/pull/759 no data available becuase of an error: red badge with exclamation mark
- [x] https://github.com/MikkCZ/pontoon-addon/pull/880 data being loaded: gray badge with 🗘 indicator (more detailed ideas in https://github.com/MikkCZ/pontoon-addon/pull/759#issuecomment-1723582025)
NOTE: there is currently an options to remove the badge completely. That should still be applicable and when the badge is configured not to be displayed, it should never show up regardless the conditions mentioned here.
Thanks for considering it! The behavior you listed above are exactly what I would expect.
i can do that where should i start working?
Hi @bhavuk2002 . The code for the toolbar button and its badge lives in https://github.com/MikkCZ/pontoon-addon/blob/master/src/background/toolbarButton.ts. You can specifically look for browser.browserAction. ... calls to see where the current behavior is set. Documentation on this API can be found on https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserAction.
okay go it thanks. Can you please assign me to this task?