Quick Messages Plugin

Looks like there’s a snazzy new emoji selector :slight_smile:

I’ve updated quick messages to support the new emoji selector. Update to the latest, and it will work again.

https://github.com/angusmcleod/discourse-quick-messages/commit/e8072fea9a6a7e1074d0db00648af0a4a36c0112

I have fixed the selector in the center of the screen to deal with the scenario of when there are multiple composers open at the same time. Ideally the selector would appear next to the composer it is associated with (i.e. from which the user clicked the emoji button). However the new selector logic assumes there is only one composer open on the screen, so I’ll have to modify that logic directly to handle this issue, and right now I don’t have the time. The fixed positioning will suffice for now.

4 Likes

Hi!
After activation of QM Plugin performance on my forum drastically dropped…
My Discourse is installed on quite good VM
4 vCores x 2.3 GHz / 15 GB RAM / 100 GB SSD RAID Local
But still after activation of QM when few peoples are typing, all CPU’s are 100% and forum starts get really slow…
Do you know what need to be fixed/adjusted to get rid of that performance issues?
Thanks!

Thanks for the quick fix. It is working perfectly now

Yes, there are definitely optimizations that can be made here.

Keep in mind that this plugin is effectively a different front-end for the same topic-based pm system that Discourse has. I’m not surprised that it may not perform well if you are carrying on multiple conversations at once. This is not a separate pm system.

The benefit of using the same PM system as Discourse is that it allows you to switch between normal Discourse PMs and quick messages. It is not a separate chat system. If you’re after a chat system try Babble.

Every time you make a message it sends it to the server like a normal post, going through all the same processes a normal post goes through, but with a significantly simpler UI.

But it has a cost…

So, the question is where to start when optimizing this.

From my relatively un-trained perspective, here is how I think of the possibilities:

  • slimming down the client. Easier. I can do this and will do some.
  • slimming down the server. Harder. Also something I can attempt, but the result won’t be amazing.
  • batching on the client (probably not wise)
  • batching on the server (probably the best place to tackle the problem, but someone more familiar with ruby and rails should do this)

The next question is how we go about executing on one of these approaches. As mentioned, I can probably get some performance gains, but I’m hardly the most technically savvy person around here.

It depends how much it matters to you. Optimizing the performance of quickly posting PMs is not a simple problem, as you’re dealing with functionality that is core to Discourse itself.

Someone like @gdpelican or @joebuhlig could probably get significant performance improvements for a fee.

6 Likes

Sidekiq is your friend. :wink:

My first go at this would likely be to instantly post the message to the sending users UI and create a background job via sidekiq to create the real message that populates for other users. That way the load is handled by a single client and distributes the load on the server a bit more. Yes, there may be a lag between posts but I wouldn’t expect it to be more than a few seconds at most and would likely go unnoticed.

3 Likes

Im having a problem with this plugin now. To recreate I have two messages open. I respond to message A. then I respond to message B. The user on Message A replies back. That text is now in the box as me typing to Message B. When I close the box it asks if I was discard the message so it is active.

This is the third time this is occurring to me.

I think this is expected behavior. In discourse, you can’t have more than one message or post going at a time.

2 Likes

This plugin can be seen in action in my new sandbox.

2 Likes

My Main menu gets hidden if I receive the message. Here is the console error.

TypeError: Cannot create property 'className' on number '1'
at i (_vendor-057c8aaf728aa3bc264d5ff93a70e003efe4f4ecdc16ba0a02d452e6e3ef4402.js:19687)
at i (_vendor-057c8aaf728aa3bc264d5ff93a70e003efe4f4ecdc16ba0a02d452e6e3ef4402.js:19527)
at t.html (_application-223b038256358c50f3c1cd8d4ed0e8484a9137cd8862a2e348d7fbe358d5b575.js:48539)
at t.p [as draw] (_application-223b038256358c50f3c1cd8d4ed0e8484a9137cd8862a2e348d7fbe358d5b575.js:52743)
at t.value (_application-223b038256358c50f3c1cd8d4ed0e8484a9137cd8862a2e348d7fbe358d5b575.js:52887)
at r (_vendor-057c8aaf728aa3bc264d5ff93a70e003efe4f4ecdc16ba0a02d452e6e3ef4402.js:19723)
at i (_vendor-057c8aaf728aa3bc264d5ff93a70e003efe4f4ecdc16ba0a02d452e6e3ef4402.js:19710)
at i (_vendor-057c8aaf728aa3bc264d5ff93a70e003efe4f4ecdc16ba0a02d452e6e3ef4402.js:19079)
at i (_vendor-057c8aaf728aa3bc264d5ff93a70e003efe4f4ecdc16ba0a02d452e6e3ef4402.js:19102)
at i (_vendor-057c8aaf728aa3bc264d5ff93a70e003efe4f4ecdc16ba0a02d452e6e3ef4402.js:19102)

Thank you. I will try this to see by myself. :grinning:

Thanks for reporting this. Fixed.

2 Likes

Hi. Are you aware of this issue in Chrome?
image
The input-textfield keeps extending, but i’m typing “out of the window”, so basically i can’t see what i’m writing after line 4 in the screenshot.

2 Likes

Thanks. Will fix this this arvo.

Fixed.
https://github.com/angusmcleod/discourse-quick-messages/commit/3ae0795de9f23e3e278fe8445723c2563f40e820

48 PM

4 Likes

Awesome - and fast job! Thanks :slight_smile:

Do you prefer issues/suggestions/improvements mentioned here, or raised at GitHub?


I’m thinking of the possibilities to listen/use the colors from the selected theme, rather than fixed colors if it’s even possible?(assets/stylesheets/quick.scss) I have not look into this kind of solution before.

1 Like

Hi again, @angus.

Any news regarding the theme-colors? As i know, it’s pretty easy to follow the main color-values, for a nice result.

I’m also wonder if it’s possible to add a “Open PM”-button to the quick-message window, making it possible to open up the PM in the normal view. Will you be able to make this? :slight_smile:

As always, i really appreciate your help and plugins :slight_smile:

I missed that one entirely! Sorry. If I take longer than a couple of days to respond it probably means I missed it somehow.

Done.

https://github.com/angusmcleod/discourse-quick-messages/commit/e8a3180e02f261eb288ba81f0439356baf5ed224

3 Likes

No problem! :slight_smile: Thanks!
What about:

Sure. A button with text on it like that won’t fit, but an icon will. Added.

Screenshot at Sep 30 21-12-42

https://github.com/angusmcleod/discourse-quick-messages/commit/23152504ae6d140155edf10d93e8bef27cf28ffa

4 Likes

Thanks so much for this @angus - just getting around to installing it now.

Not only does it work really well, but it adds that envelope icon so that I can finally get to previous message history easily!

The thing I’m noticing at the moment is that the uploading indicator (from a forum post elsewhere) is ending up in the message window. It actually posts the text from that post in there and you have to cancel the uploading waiting bar thing.

53 am

3 Likes