pontoon-addon icon indicating copy to clipboard operation
pontoon-addon copied to clipboard

Hide badge when there are 0 new notifications

Open Olvcpr423 opened this issue 2 years ago • 5 comments

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.

Olvcpr423 avatar Jul 30 '23 15:07 Olvcpr423

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.

MikkCZ avatar Jul 30 '23 15:07 MikkCZ

Thanks for considering it! The behavior you listed above are exactly what I would expect.

Olvcpr423 avatar Jul 30 '23 15:07 Olvcpr423

i can do that where should i start working?

bhavuk2002 avatar Sep 15 '23 16:09 bhavuk2002

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.

MikkCZ avatar Sep 16 '23 07:09 MikkCZ

okay go it thanks. Can you please assign me to this task?

bhavuk2002 avatar Sep 16 '23 07:09 bhavuk2002