Make WordPress Core

Opened 8 weeks ago

Closed 5 weeks ago

Last modified 3 weeks ago

#66157 closed enhancement (fixed)

Toolbar: free horizontal space on the right side

Reported by: lucasmdo Owned by: mcsf
Priority: normal Milestone: 7.2
Component: Toolbar Version:
Severity: normal Keywords: has-patch needs-dev-note
Cc: Focuses: ui, css, administration, ui-copy

Description

This ticket proposes to make the account menu item narrower, so the right side of the Toolbar has more space. The panel underneath stays the same.

Current behavior

The account item on the right side of the Toolbar is the widest text element in the bar. It shows a full sentence with the display name, plus the avatar.

The right side is also where plugins and hosts add their own items (notifications, site status, account links). As more items land there, the space gets tight. Long display names and long translations make it tighter.

On small screens Core already reduces this item to the avatar only. So the bar works well with a narrower account item.

Proposal

Show only the display name and the avatar in the bar. The ful l sentence moves inside the panel, next to the avatar, the username and the profile links.

Toolbar

Why

  • More space on the right side. The account item gets around 50px narrower in English and more in many languages. That space goes to the items that need it.
  • Clearer control. I believe the name and the avatar are enough to read as "your account". It is the same pattern used by most products.
  • Better fit for long names and long translations. Less truncation and wrapping in the bar.
  • Consistent with small screens, where Core already narrows this item.

Accessibility

  • The accessible name of the account control becomes the display name. Shorter and clearer for screen reader users.
  • Keyboard and focus behavior does not change. Same menu, same items.
  • The full sentence is still available to everyone who opens the panel.
  • RTL: no change, the text mirrors as today.

Backward compatibility

  • Existing strings and translations stay in place.
  • Node IDs and the menu structure stay the same. Plugins that add items to the account panel keep working.
  • Sites that customize the account item text with the gettext filter keep working.
  • #48894 improvements to the account panel.
  • #61615 crowding on the right side of the Toolbar.

Attachments (1)

toolbar-proposed-crop.png​ (31.4 KB ) - added by lucasmdo 8 weeks ago.
Toolbar

Download all attachments as: .zip

Change History (15)

#1 @lucasmdo
8 weeks ago

  • Summary Toolbar: free horizontal space on the right side by repositioning the account greeting → Toolbar: free horizontal space on the right side

We can also free more space for plugins when it's needed. This is a very common use case for developers as well.

On the top of that, we also have plugins that do the same or similar job.

This ticket was mentioned in ​PR #13681 on ​WordPress/wordpress-develop by ​@fushar.


8 weeks ago
#2

  • Keywords has-patch added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/66157

Summary

As discussed in the ticket, the top-right side of the admin bar can be crowded with plugin nodes. This PR attempts to free up some horizontal space by relocating the "Howdy," greeting into the user dropdown.

Please check the linked Trac ticket above for more rationale behind this change.

Display name is username:

| Before | After |

https://github.com/user-attachments/assets/191e6b12-bd51-4c13-b3bb-da8cafe50501 https://github.com/user-attachments/assets/0b687546-19d7-4faf-b27d-1c54a5241156

Display name is different from username:

| Before | After |

https://github.com/user-attachments/assets/8d565e25-a23d-4bab-a59a-dc374ddd0b2f https://github.com/user-attachments/assets/7176f455-658e-4eda-b739-e33c64b28c40

Testing

  1. Log in and view any admin or front-end page.
  2. Verify that the top-right of the admin bar shows just the display name and avatar.
  3. Hover to open the user dropdown, and confirm it shows "Howdy, {name}" beside the large avatar.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 5.5
Used for: Code generation. Verified and tested by me.

#3 @abcd95
8 weeks ago

  • Keywords needs-design-feedback added

Thank you for the ticket and the patch. The problem this addresses is real, and freeing ~50 px on the right side is a meaningful improvement.

One concern still remains is "Howdy" is a greeting, and a greeting placed behind a hover/click barrier is no longer functioning as a greeting. A greeting by definition lands the moment you arrive and it should be ambient and immediate, not discoverable. If a user has to open a panel to read "Howdy, Alex," the word "Howdy" has lost its semantic purpose. What is left is just the name, which is already shown in the panel by the existing display-name span.

This isn't a reason to block the ticket, the goal (more space, same information architecture) is correct. But it does suggest the cleanest solution is:

Drop "Howdy, " from the bar trigger and show only the display name and avatar.
Leave the dropdown as-is since it already shows the name, username, large avatar, and Edit Profile link.
Moving the sentence into the panel doesn't actually preserve the greeting, it buries it.

This however, needs a lot of design input from the design folks.

#4 @Joen
7 weeks ago

I support this for all the same reasons, it's freeing up valuable space, it's likely even more in other languages. Moving the greeting inside the menu keeps the character and adds to its impact. 👍 👍

#5 @Mamaduka
7 weeks ago

  • Milestone Awaiting Review → 7.2

Adding this to the WP 7.2 milestone, as we're iterating more on toolbar/omnibar items.

This ticket was mentioned in ​Slack in #accessibility by joedolson. ​View the logs.


7 weeks ago

#7 @joedolson
7 weeks ago

  • Focuses accessibility removed

The accessibility team has no objections to this. I'm going to remove the accessibility focus, as this is essentially a text-only change and there's no reason for us to check up on it again.

But thanks for compromising against the icon-only option, which was definitely going to cause problems.

#8 @lucasmdo
7 weeks ago

Great :) Thanks for the feedback folks.

​@fushar commented on ​PR #13681:


6 weeks ago
#9

(Sorry if you received duplicated comments; I think GitHub is buggy, somehow it won't show my latest comments here? 🤔)

​@tyxla commented on ​PR #13681:


6 weeks ago
#10

No further feedback from my end. Thank you for your perseverance, @fushar and for going above and beyond to keep the change contained!

Would appreciate another 👁️ from @mcsf before we 🚢 it.

​@mcsf commented on ​PR #13681:


5 weeks ago
#11

I missed this ping last week. LGTM!

(Also, I recommend marking GitHub review threads as _Resolved_ so that it's easier for reviewers to catch up.)

#12 @mcsf
5 weeks ago

  • Owner set to mcsf
  • Resolution → fixed
  • Status new → closed

In 64312:

Toolbar: Move "Howdy" into user menu item to free up space.

Free up space in the toolbar by replacing the "Howdy, $user" line with "$user". In turn, the greeting is moved into the user menu item, thereby replacing "$user" with "Howdy, $user".

Props fushar, tyxla, mcsf, joen.

Fixes #66157.

#13 @sabernhardt
5 weeks ago

  • Keywords needs-dev-note added; needs-design-feedback removed

(The dev note probably could be part of the miscellaneous changes note.)

Last edited 5 weeks ago by sabernhardt (previous) (diff)

#14 @fushar
3 weeks ago

For the dev note, we can link to this comment.

UI changes

Before After
https://github.com/user-attachments/assets/191e6b12-bd51-4c13-b3bb-da8cafe50501 https://github.com/user-attachments/assets/0b687546-19d7-4faf-b27d-1c54a5241156
https://github.com/user-attachments/assets/8d565e25-a23d-4bab-a59a-dc374ddd0b2f https://github.com/user-attachments/assets/7176f455-658e-4eda-b739-e33c64b28c40

Diff of the my-account node markup

  • 7.

    old new  
    11<li id='wp-admin-bar-my-account' …>
    22  <a class='ab-item' …>
    3     Howdy, <span class="display-name">John Doe</span>
     3    <span class="display-name user-display-name">John Doe</span>
    44    <img …>
    55  </a>
    66  <div class="ab-sub-wrapper">
    7     <ul role='menu' aria-label='Howdy, John Doe' id='wp-admin-bar-user-actions' …>
     7    <ul role='menu' aria-label='John Doe' id='wp-admin-bar-user-actions' …>
    88      <li id='wp-admin-bar-user-info' …>
    99        <a class='ab-item' …>
    1010          <img …>
    11           <span class='display-name'>John Doe</span>
     11          <span class='display-name howdy'>Howdy, <span class='user-display-name'>John Doe</span></span>
    1212          <span class='username'>johndoe</span>
    1313          <span class='display-name edit-profile'>Edit Profile</span>
    1414        </a>
    1515      </li>
    1616      …
    1717    </ul>
    1818  </div>
    1919</li>

When the display name is the same as the username, the username element was not rendered before:

  • 7.

    old new  
    11…
     2           <span class='username' hidden>johndoe</span>
    23…
Note: See TracTickets for help on using tickets.