-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add notifications when a badge is awarded #3442
Conversation
In this state, there is still an issue with differentiating between demotions and promotions for the Community Builder Badge, and awarding badges accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
As mentioned inline, I'd use a popup when the badge is awarded.
Looking into the Permission promotions bug.
Is this not working as expected then? Lines 125 to 136 in 8a16a65
|
Changed the confetti file to be the unminified version instead. This commit also has a broken implementation of the permissions count bug, where I attempted to self-correct permissions counts inside of user.py
This patch fixes the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I didn't actually test the code yet, but left some notes on things that stood out.
It seems like the badge popup HTML and CSS are not the same in preference page and the translate view?
pontoon/contributors/templates/contributors/widgets/notifications_menu.html
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
@mathjazz I've also changed the badge display order for the changes requested in documentation. Just curious, are you still planning to take a look at the CSS for the popup? |
Thanks! The code looks good now. I'll work on the CSS tomorrow. |
Known issues:1. Translation Champion badge and Review Master badge can be awarded at the same time
|
I noticed that confetti on the translate page appear behind the editor, editor menu and concordance search field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I feel like is_implicit_action
might be a better field choice? Most of the ActionLog items will now have is_explicit_action
set to True
, and I think it's more natural if the exceptional (minority) cases are True
. No strong opinions, leaving the decision to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good and I also didn't spot any issues on stage. \o/
Thanks for keeping up with this roller coaster, Harmit! And nice job with the solution you've proposed for tracking explicit review actions only!
I believe we should now focus on #3481 and #3482, but I wouldn't block a release on these two issues.
Fix #3412
This PR adds notifications to signal to a user that they received a new badge/badge level. Notifications will appear in both the "Notifications Menu" in the header (first image), and as a notification banner across the top of the page. Notification banners for new badge levels will trigger a confetti animation, imported from https://github.com/catdad/canvas-confetti.
The initial commit for this PR has a noticeable bug, in that demotions and promotions will both count towards the Community Builder Badge. This issue stems from how
assign_users_to_groups
will always update translators then managers, in that order. Thus, there is no way to distinguish if an action is promoting a user from Contributor -> Translator or if an action is demoting a user from Manager -> Translator, especially since multiple users can be demoted/promoted in the same action.TODO:
pontoon.messaging
(see this comment below). This includes moving_send_badge_notification
as well. We should remember to file an issue for this before this PR is merged.