User Card Directory: message button should not show on mobile

AI-generated summary

The discussion revolves around the visibility of the message button in the User Card Directory on mobile devices. Moin highlights that the message button appears on mobile but is non-functional, while it is correctly hidden on desktop due to CSS rules. BrianC reports that clicking the button causes it to disappear without opening the message composer, and notes that the buttons should not appear for the active user. tobiaseigen clarifies that the issue is not functionality but visibility, as the buttons are not properly hidden on mobile despite being hidden on desktop. Moin confirms the CSS is being overridden on mobile, making the buttons visible. tobiaseigen agrees the buttons should be hidden entirely to avoid clutter, suggesting users can access them via full user cards. BrianC supports this and shares a CSS fix to hide the buttons on mobile.

Edit by Tobias to clarify the problem:

When the User Card Directory theme component is enabled, the message button on the usercard is shown in the user directory on mobile but is not clickable. The button is not shown on desktop and should not be shown on mobile either.

4 Likes

Hello everyone, I installed and found issue or bug when clicking the Message Button in the User Card Directory. Instead of loading the Message Composer the button disappears and the user card remains. I checked on the User Card Directory Demo on Discourse and same issue is present. Chat button works normally. It would be good if they did not appear on the active user who cannot message or chat with himself :slight_smile:

1 Like

I already started a topic about the buttons being visible in the directory on mobile: User Card Directory: message button should not show on mobile

By the way: you can message yourself. It’s helpful for drafts and notes.

2 Likes

I tested this and am also able to see a problem similar to that reported by @Brianc:

  1. when user card direcory enabled
  2. visiting user directory
  3. select Message button on a user card
  4. not taken to the new message composer, the avatar and username disappear from the card

@moin you haven’t provided enough information for me to understand what you are reporting in User Card Directory: message button should not show on mobile. Are you talking about something else?

1 Like

I think the message button shouldn’t be visible at all.

In desktop view you see this: open this in a new tab for desktop view

There is no message or chat button. It’s hidden by the component’s css:


But in mobile view, those are shown open this in a new tab for mobile view


The css is overwritten

So I think the problem is not that they do not work as expected, but that they aren’t hidden on mobile. You would not be able to click those buttons if they were hidden as expected.

1 Like

I assumed the chat/message buttons were intended to be there. If there are adjustments/enhancements made for this theme component perhaps an option to show or hide could be added. I like being able to message/chat with other users when looking through directory personally.

1 Like

I moved all the related posts into here.

Funny, when I was testing the buttons were showing on desktop too but they are no longer showing. I guess I had to do a hard refresh in my web browser.

I’m in favor of not showing the buttons at all - it clutters the view and if you want to send a message or chat you can click on a card to see the full user card with buttons.

1 Like

Sounds good. Thanks for reviewing. I popped this into the mobile css for the theme to remove.

.usercard-controls {
display: none!important;
}