Implement "Badges" or "Medals", for annotating special users
Closed, ResolvedPublic

Tags
Tokens
"Like" token, awarded by spawnlt."Like" token, awarded by jollychang."Like" token, awarded by stevex."Like" token, awarded by johnny-bit."Like" token, awarded by hach-que."Like" token, awarded by gaconkzk."Like" token, awarded by sectioneight."Like" token, awarded by joshuaspence."Like" token, awarded by qgil.
Assigned To
Authored By
epriestley, Nov 12 2014

Description

This is completely speculative, but just writing it up since it's come up a couple of times.

It would be nice to be able to annotate special users in a way that shows up in the transaction logs (maybe a special icon, portrait border, etc.), similar to how the badge systems work on some forums. For example:

  • Administrators (could be hard-coded)
  • Employees
  • Contributors
  • "Phabricator Gold" Members
  • Verified celebrities

This could also just be an attribute on projects, like "members of this project get a specific badge". The main value of this would just be making these users easily identifiable without having to go dig around -- in the case of administrators/employees this helps users avoid confusion, and in the case of contributors/gold it could be a bit of a way to show off.

I'm not sure how useful this would be overall, but we can collect other use cases if any arise and scrap it otherwise.

Details

Differential Revisions
D13626: Badges v0.1
There are a very large number of changes, so older changes are hidden. Show Older Changes

Here's a rough sketch of this. This is a ton of work and should be split into like 300 revisions. See T6526#107028 for product details.

New Application: Create a new PhabricatorBadgesApplication which extends PhabricatorApplication.

New Storage: Create a PhabricatorBadgesDAO and add the badges database to PhabricatorBuiltinPatchList.

New Object: Create a PhabricatorBadgesBadge. This object should have something like:

  • phid
  • name
  • description
  • icon
  • color
  • editPolicy
  • dateCreated
  • dateModified

Add a .sql file and add edges. Implement all the related classes: Query, SearchEngine, Controller, Transaction, ListController, ViewController, EditController, PHIDType.

These aren't important enough to get a monogram or comments.

Create Capability: Add a new application Capability to let users create badges. Default it to administrators only. Anyone can view badges. Only users who can edit a badge can award it.

Award Workflow: From a badge detail page, add an "Award" workflow which lets you award the badge to a user. Write a new Edge type between the user and the badge when it is awarded.

Show on Timeline: Inside buildTransactionTimeline(), load all the badges that each user has, then have the timeline render them next to their profile image.

Automatic Badges: Figure out how to do automatic badges (administrator, task assignee, etc).

Badge Showcase: Put a badge showcase on profiles, and add management capabilities later.

qgil added a comment.Apr 29 2015, 9:17 PM

Can a single user be awarded several badges?

Yep. I personally intend to create hundreds of badges to award myself once this is built.

qgil awarded a token.Apr 29 2015, 9:19 PM

Could badges be used for policies? For example, Blessed Committers could be replaced with a badge potentially. This would (at least partially) solve T5602.

They could, yeah. We'd probably need a "List all users with badge X" UI to avoid losing functionality, but that seems pretty reasonable.

When I first read the title of this ticket, I thought that you were going to add gamification.

eadler added a subscriber: eadler.Apr 29 2015, 10:35 PM

Why not both? badges awarded manually for annotating special users + badges given automagically for gamification. Second part would propably depend on being able to write herald rules like "If commiter has 100 accepted revisions, award 'No Longer a Peasant' badge" ;-)

qgil added a comment.EditedApr 29 2015, 10:50 PM


7.546 posts

(posted just as memorabilia; no need to implement this) :)

sectioneight added a subscriber: sectioneight.
  • I assume this would also supersede how disabled user accounts are currently displayed ("handle-disabled" CSS adding a black bullet in front of user name). Not mentioned in the task summary; just pointing out for completeness.
  • I assume this would also be the way to go to indicate new Phabricator users (e.g. dateCreated within last 60 days) to be treated even friendlier / with more patience? Mozilla's Bugzilla has such a visual indicator. See their background discussions why this could be useful in communities, but could also discriminate new users.

I wouldn't plan for this to supersede the grey "disabled" dot or the red "away" dot in the general case (those show up in a lot of contexts where badges won't) but it would be reasonable to consider showing a special automatic "Disabled" or "Away" badge in timelines, like the proposed "Admin" badge.

I suspect the "automatic badge" stuff will be modular enough that it will be easy to add simple badges ("Disabled", "Away", "New for X Days") locally, even if we don't ultimately pursue them in the upstream.

jdloft added a subscriber: jdloft.Jun 10 2015, 11:10 PM
chad added a subscriber: chad.Jul 9 2015, 10:13 PM

My v0 or v-1 pass at this would be pretty basic (and I think like 98.5% aligned with @epriestley)

Badges would be granted by Project Membership or being an Admin. These would appear on your profile (I'm close to having PHUIBadge out for review). As part of editing your Profile, a user can choose to identify themselves with a Badge (if they have multiple badges, they can pick only one). In picking one Badge to identify with, we keep the feel of the product and it's use Authentic. So if I am an Administrator and part of Phacility High Command, I would choose one of these to be my primary identify around Phabricator. This should logically work well in most use cases. If you're a "Bug Team" member, "Design", or "Security", these associations would appear in Timeline and Hovercards adding to you're authenticity during the discussion. This would be a similar design direction to the "Author" tag we use on inline comment in Differential.

If we go this route, we should probably consider "Can be used as Badge" in Projects. Or at least, in this install, seeing someone with (Spaces) by their name might seem weird.

Show on Timeline: Inside buildTransactionTimeline(), load all the badges that each user has, then have the timeline render them next to their profile image.

This direction I think is my only concern, as it sounds like a lot of clutter without much real benefit. At least, I'd like to attempt a more dialed back approach for the first cut and see what's needed after that.

I don't want to do project/badge stuff yet, just an explicit "award this badge to this user" thing for now, but imagine maybe doing that in a future version.

I'd also like us to try to fit, like, 3-5 ish badges into timeline if possible? maybe? We definitely don't need 100 but it would be nice to be able to see more than one, I think. e.g., my first badge has to be either "Admin" or "Phacility", and then my budget is exhausted and I can't have anything fun/unique if it's limited to 1.

chad added a comment.Jul 9 2015, 10:19 PM

I'm fine slathering hovercards with tons of them, but am worried that more than 1 or 2 would make timeline cluttered. Though maybe you have a magical design for this I'm not able to envision.

I was imagining something like this:

+-------------+
|             |
|             |
|             |
|             |
|             |
+-(A) (*) (~)-+

...where the box is the profile picture, and (A), (*) and (~) are badges (white icon on colored circular field?) and we show details on hover. 5 might be hard to fit but seems like 3 is probably reasonable? They have to be pretty small but I don't think they need to be very big.

Oh, yeah. That huge treatment might be good for "Administrator", "Employee" or object relationships ("Task Owner", "Task Author"), but feels pretty big for the more achivement-like "Made 100 Commits", "Registered for 5 years", "Contributed", things.

chad added a comment.Jul 9 2015, 10:26 PM

I'd totally brag about my 1,000 commits. :)

We could let specific "Important" badges generate a text tag like that but I'd like to be able to, e.g., award everyone who reports a bug a badge for it without turning every timeline into "Reported a Bug" on each comment.

chad added a comment.Jul 9 2015, 10:27 PM

I'm fine trying both and seeing what shakes out in the long run (which may be both).

chad added a comment.Jul 9 2015, 10:41 PM

http://www.wowhead.com/guides/vanity-collections/the-entitled-a-guide-to-titles was a lot of my inspiration, haha.

I think at best we can fit 2 under there right now. 2 icons + 1 title...

chad added a comment.Jul 9 2015, 10:48 PM

pink maybe isn't a good choice. i'll tinker

gabe added a subscriber: gabe.Jul 10 2015, 2:17 AM

I always thought it would be cool to reward stuff like:

submitted 10 diffs in a row w/out bypassing `arc lint`
added x new unit tests
landed x changes that didn't need revisions

It would be neat to gamify best coding practices instead of just arbitrary stuff on the site like "1000 comments" or whatever.

And since *everything* is in scope for phabricator...

gabe added a comment.EditedJul 10 2015, 2:52 AM
In T6526#125777, @chad wrote:

So sexy!

Now I just have to figure out how to merge my two phabricator.com accounts together so that I get credit for my 2 commits (: Too bad I seem to have lost the password for the other one, and no longer work at that company so can't send myself a "reset password" link. Oh well, might just have to start submitting more diffs.

ftdysa added a subscriber: ftdysa.Jul 10 2015, 2:14 PM

I don't need this but I want it!

Hey @chad - badges look HUUUUUGE on what You propose... As for colour - sure pink is not perfect, but it would be even better to colour-code badges. For example:

- 10 Tasks done
- 1000 tasks done

- 10 successive difs with proper arc lint
- 100 diffs

- member of project with colour red

as seen here, rather small icons/badres are quire readable, so why not use base font size instead of huge one? Sorry for potato quality:

+ it would be awesome to hover over some bagde like and receive something like

</> - 10 successive accepted difs without modiffication
</> - 10 successive diffs without lint problems
</> - 10 successive diffs without unit problems
</> - 50 unit test
</> - 100 diffs club
</> - 500 commits club

or something like that :)

I just realized the examples use the WoW rarity scheme ❤️

Also do I get to showcase my favorite badges on my profile? Maybe something like:

chad claimed this task.Jul 11 2015, 8:54 PM
chad added a subscriber: lpriestley.

I'll see if I can skeleton out an application here. I don't think it will do much.

chad added a comment.Jul 11 2015, 8:55 PM

They don't let me program much, so it'll likely delete all your data.

hach-que rescinded a token.
hach-que awarded a token.
chad moved this task from Backlog to v0 on the Badges board.Jul 14 2015, 1:42 AM

A few pieces of feedback:

  • It would be really nice to be able to split "being able to award this badge" and "being able to edit this badge". You've already said that this isn't something that you're likely to consider but I wanted to mention it here
  • Another use case: in certain cases badges directly map to projects ("member of admin team" ~= "phacility high command" or "trusted contribute" ~= "trusted contributor" project)
  • It would be nice to be able to "bind badges to external things": for example: we've already had requests for "submitted the most diffs" or "closed the most tasks"
  • There is no way to go from a user's pokemon center to the list of other users with the badge. Clicking on it just flips it over.
  • The mini-badges don't show up when posting inline comments only or when updating a diff: see this for example: https://www.dropbox.com/s/zu97klycfzb7jtf/Screenshot%202015-07-25%2013.13.36.png?dl=0
chad moved this task from v0 to Backlog on the Badges board.Jul 26 2015, 12:17 AM
devurandom added a subscriber: devurandom.EditedJul 27 2015, 1:24 PM
  • Another use case: in certain cases badges directly map to projects ("member of admin team" ~= "phacility high command" or "trusted contribute" ~= "trusted contributor" project)

That would be our primary use-case, too.

stevex awarded a token.Sep 9 2015, 3:40 PM

Do it have notifications or hook for email or slack?

qgil removed a subscriber: qgil.Sep 23 2015, 8:05 AM
epriestley moved this task from Backlog to v0 on the Badges board.Jan 2 2016, 12:21 AM
spawnlt added a subscriber: spawnlt.
chad moved this task from v0 to v0 on the Badges board.Feb 6 2016, 5:54 AM
chad edited projects, added Badges (v0); removed Badges.
chad removed chad as the assignee of this task.Mar 28 2016, 7:36 PM

I'm struggling with how to think about the 'temporal' nature of some peer awards that might fit badges. For example, I'd like to give the team that won the popular vote at a hackathon, but it would not feel so special if after a year "everyone" had an Epic badge displayed all the time. I'm thinking more "you get celebrated for a month" and less "list of all the typos I found 3 year ago".

I think maybe something where a badge (or award?) could have a time limit attached after which it would still be in the trophy case, but no longer prominently displayed by each comment? Rescinding the badge feels too harsh.

chad added a comment.Apr 8 2016, 5:34 PM

I expect every user to have millions of participation badges. Yet they'll have to select just two to prominently display.

That's my expectation too -- the user cycles their "2012 Hackathon Winner" badge out for "2013 Easter Egg Finder" once they get bored of it, so badges are always fresh and lookin' fly.

We could maybe just add a [X] Do not show on timelines. option to the badge if this doesn't resolve itself down the road, after T9006 gives users power over which badges are shown.

samuelmantou moved this task from v0 to v1 on the Badges board.Apr 12 2016, 3:48 AM
samuelmantou edited projects, added Badges (v1); removed Badges (v0).
samuelmantou moved this task from v1 to v0 on the Badges board.
samuelmantou edited projects, added Badges (v0); removed Badges (v1).
eadler added a project: Restricted Project.Aug 7 2016, 8:11 PM
chad closed this task as "Resolved".Wed, Feb 15, 4:14 AM

This has been implemented and in use for a while, so closing and will finish up smaller tasks in backlog.