Chat button on profile page

AI-generated summary

A discussion about adding a chat button to the profile page in Discourse has been initiated by ranjeet. twofoursixeight agrees it could be useful, but points out that an alternative is to click on the chat button in the usercard.

Akshine offers a theme component solution, which is later adopted as part of the core Discourse code by davidb. The button has been added to the profile page with the addition of a commit to the Discourse GitHub repository.

Moin suggests that the button should be hidden for users who have opted out of receiving chat messages. davidb acknowledges this point and plans to investigate further.

A follow-up fix has been made by davidb to address the issue of the button appearing despite users opting out of chat, and to correct the scenario where chat is enabled but the target user has disabled chat. A meta-specific issue with the CSS not updating for the button is also being looked into.

can we add chat button on the profile page?

3 Likes

I see now:

Perhaps it can be useful it one wants to start a chat from the profile page.

Users can also click chat on the usercard as an alternative:

3 Likes

Here is a theme component for that. :+1:

https://github.com/Arkshine/discourse-chat-button-in-profile

8 Likes

Thank you for reporting this, I agree that the chat button should be included on the user profile. It also feels like it should be there by default.

I think @Arkshine did a great job on working up a solution for this :rocket:

We had a quick discussion internally and decided to include this as part of core/chat, since it’s an expected feature and we also have it for the user card already.

I went ahead and added it with this commit:
https://github.com/discourse/discourse/commit/d5b944f1def75281b9845babf70e545d7552a95f

4 Likes

Maybe the button should be hidden on the profiles of users who have opted out of receiving chat messages, similar to the implementation of the personal message button.

And is the smaller button on the usercard related to that change too?

3 Likes

That’s a fair point, thank you for highlighting. I will have a look into this.

This style change is related to the user-card theme, I’ve opened a PR on the theme with a fix for this, which should hopefully get merged soon.

3 Likes

I think it is merged, but the button is still smaller

I’ve made a follow up to fix the issues experienced with the button appearing despite opting out of chat. The opposite scenario was also true (chat enabled but target user disabled chat). Both scenarios should now be fixed with this change:

https://github.com/discourse/discourse/pull/26237

The issue of the CSS still not updating for the button is a meta specific issue, we are using an older version of the user card theme component at the moment so the style changes aren’t reflected, but I will follow up on that and have it corrected soon.

4 Likes