Retort - a reaction-style plugin for Discourse


#188

We use:
:+1: :astonished: :relaxed: :grinning: :rofl: :cry: :hugs: :rage: :nauseated_face:

The :relaxed: and :grinning: are kinda redundant. I like the :star_struck: and :tada: so I might see about adding those. We’ve opted to not allow the thumbs down or anything like it.

EDIT: As a side note, I’d love to see the plugin evenly split the emojis when there’s more than can fit on one line. With 10 emojis, we wind up with 8 on the top and 2 on the bottom.


(Stephen Chung) #189

Maybe a placeholder emoji that triggers a line-break?

@gdpelican?


(Stephen Chung) #190

OK, guys. Pull my fork instead:

An empty emoji string in the limited set translates to a line-break.


(James Kiesel) #191

Hmm, I’d rather not go with this approach. I’ve pushed up a fix to master which displays the icons sensibly for up to 25 custom emojis (so, for example, 24 emojis will be 6 rows of 4, while 25 emojis will be 5 rows of 5). Hopefully that should cover most use cases :slight_smile:


(James Kiesel) #192

Reactions is completely separate from likes, which still function as normal (this is, in fact, quite a tiny plugin all told). It would be possible to do some metrics on reactions (which are stored completely separately from likes) with some custom SQL queries, but the plugin does not ship with this functionality.


(Tobias Eigen) #193

thanks @gdpelican for these fixes. It might be a small plugin but it’s a good one that many people in my community love. :heart_eyes_cat:

This idea of doing metrics on reactions is interesting, or at least fun. It could also help identify which emojis are the most popular and worth including in a limited list. Or which users might be using emoji in a positive, community-building way or in a counter-productive way.

Maybe a data explorer query that lets admins pull data sitewide, by category, by topic, by post? Or by user, by group?


(James Kiesel) #194

It’ll be a query to run using the data explorer plugin; let me see if I can cook up a couple queries that might be interesting

EDIT: Here’s the raw data:

SELECT REPLACE(key, '|retort', '') as retort, post_details.post_id, posts.user_id
FROM post_details
INNER JOIN posts on posts.id = post_details.post_id
INNER JOIN topics on topics.id = posts.topic_id
INNER JOIN users ON users.id = posts.user_id;

which you could add further columns like users.name, topics.title, etc. to.

and grouped by number of emojis total on the instance:

SELECT REPLACE(key, '|retort', '') as retort, count(key) as c
FROM post_details
WHERE extra = 'retort'
GROUP BY key
ORDER BY c DESC;

(Stephen Chung) #195

I think the automatic behavior is best WITHOUT any explicit formatting instructions from the user. If there is, however, it is best to follow the user’s format.

That’s because line-breaks, placed correctly, can be used to split the limited set into logical groups, each row being one type of emoji’s. The numbers may differ from row to row.

For example:

image

So there is a use for explicit formatting. Convention-over-Configuration still allows for configuration if the convention is not suitable.


#196

I can see your point @schungx. The update is almost what I was hoping for. Except now with 11 emojis, there are two rows of 5 and one row with just 1. I was hoping it would be more like 6 on top, 5 on bottom. In this case having the ability to split it myself might work better.

And another thing… :wink: I may be the only person who cares about this, but I think it’d be nice to be able to see a full list of who had what reaction—much like the way you can click on “X Likes” and see who liked the post. Is there a way to do this? Clicking obviously won’t work, since it adds you to the count of people who reacted that way. Listing out everyone every time you hover over it would probably be impractical, especially with reactions with large numbers. Maybe some sort of delay so that if you hover long enough it shows the full list? I’m not familiar with JS, so if this is something we can do on our side, I’ll talk to our admin. He’s much more likely to be able to work it out.


(Stephen Chung) #197

Right now on hover it will show a tooltip of up to two users.

If you pull my fork instead, it shows up to 10 users as a condensed list. I changed it in order to remove the English texts hardcoded into the tooltip.

More than 10 then it just reverts back to two names plus the total count.


(Stephen Chung) #198

In my fork, put an empty string in the list and you get a line break.


(Carson) #199

Hi, this is a really cool plugin!

Some questions related to both this plugin and Data Explorer:

  1. Can someone confirm that the Data Explorer queries can be set up to provide information on how many times [specific reaction] has been used in [specified category] in response to [these users]?
  2. Can those queries be run automatically and be sent to a group on a daily basis?

Another question:

  1. Can CSS be added to sit next to the Retort Button that says “Tone” or “Tone Feedback”?

If these are #marketplace questions, let me know!


(James Kiesel) #200

Hey Carson,

I can confirm this. I’ve posted some starter queries a bit earlier in this thread, which you can tweak to taste as you like

I could imagine a plugin which takes some sql query, runs it periodically, and sends the results out in an email, but I’m not sure if it exists yet and is likely beyond the scope of Data Explorer, and definitely beyond the scope of Retort.

As a side note, I wonder if anyone’s had luck linking up a metabase instance to their Discourse forum for extra analytic superpowers.

You could likely achieve this with a little custom CSS on your instance, with a ::before selector. Something like this:

.post-controls .widget-button:first-child::before {
  content: 'Tone';
  margin-right: 8px;
}

09 PM
Although… you’ll probably want to figure out a better selector there.


(Diego Barreiro) #201

Is possible to notify the author of the post when a new user reacts on the post?
As if it were a Like :heart:


(Diego Barreiro) #202

It seems like multilanguage isn’t fully supported:


(Stephen Chung) #203

Nope. It isn’t. If you’re talking about the popup tooltip texts, they are hard-coded English.

If you pull my fork, I’ve removed most of the English words – a couple remains. That should make it usable for other languages.


(Diego Barreiro) #204

I talk about the ‘emoji’ that shows :olhos do corazao: instead of :heart_eyes:


(James Kiesel) #205

Hrm, I wouldn’t expect emojione to be translating their emoji shortnames, and haven’t been able to come up with steps to repro.

I tried making a portuguese user on that forum and reacting with heart eyes, but as expected the emoji shortnames remain in English, which is also true for the core discourse emoji picker.

The only possibility I could think of would be that a forum could add a custom emoji, someone reacts with it, and then the custom emoji is removed, which would result in just the shortname being displayed. I don’t really have a good response to that use case other than ‘Don’t do that.’ :slight_smile:


(Stephen Chung) #206

Is it me or everybody else is having this problem:

The Retort emoji picker no longer closes when you click on the page background. In fact, there appears to be no way to dismiss the emoji picker except to actually click on an emoji.

I remember before it closes when clicked outside of the picker dialog.


(James Kiesel) #207

Hrm, yeah it looks like the emoji picker’s event listeners have changed a little recently. I’ve updated so the retort window goes away on an outside click or pressing ‘escape’. :frog: