Show username menu instead of notification menu in user menu?

AI-generated summary

In a UX-focused discussion titled ‘Show username menu instead of notification menu in user menu?’, oneflydown asks if it’s possible to display the username/profile menu instead of the notifications menu when clicking the username icon — primarily to allow one-click logout for clients. ondrej confirms this isn’t currently an option and questions the need, while codinghorror suggests using the keyboard shortcut (? then logout) as an alternative. oneflydown explains the request comes from a client with traditional expectations. pfaffman recommends creating a theme component to add a logout link, especially for public computer use. zcuric provides a working JavaScript solution by reopening the user-menu widget and setting currentQuickAccess: 'profile', which oneflydown praises as simple and effective. saba builds on this, asking how to visually mark the profile tab as active (greyed) — noting the markAsActive function exists but struggling with syntax to implement it in a theme component. The thread demonstrates community-driven UX customization via theme components and widget overrides.

Is it possible that I show the username menu and not the notification menu, when I click on the username icon as shown in below pic?

This is because I want my users to have access to logout in one click.

Thanks
Oneflydown

1 Like

Hello and welcome to meta @oneflydown


No, currently not an option. Also why is ‘one-click logout’ important?

1 Like

Press ? to see the keyboard shortcuts. There is a keyboard shortcut to log out.

1 Like

Thanks for reply, I personally don’t logout, but I have used Discourse for a client, and he is persistently asking for the same: may be from old school of thought.

Great, I have seen it ZZ. But, I have used Discourse for a client, and he wants it that way. May be I can post this in marketplace, as I am looking for few more customisation’s. Thanks

Btw, Is it not a change of default tab index, that I could achieve through, may be JavaScript?

You should create a theme component that puts a logout link…somewhere. I did this for a client whose community members are likely to be using public access computers.

4 Likes

You can do it by reopening the user-menu widget and change it’s default state. Simply change: currentQuickAccess: 'profile',, like this

<script type="text/discourse-plugin" version="0.8.20">
  api.reopenWidget("user-menu", {
    defaultState() {
      return {
        currentQuickAccess: 'profile',
        hasUnread: false,
        markUnread: null
      };
    }
  });
</script>

More details on user-menu widget, here:
https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/user-menu.js#L168

8 Likes

Wow, such a simple tweak. Thanks @zcuric

1 Like

This worked great! But how can I mark the profile tab as “isActive”, meaning that this tab will be greyed instead of the notifications tab.

I see a markAsActive function already available but I’m struggling to build the correct syntax to call this function on the profile tab as part of my theme component.

1 Like