Patch #44293
closedAdd a caret to the account menu to indicate it opens a dropdown
Description
In 7.0.0, the account menu in the top bar (avatar in the top-right corner) became a dropdown (#31353).
Its trigger is a plain avatar with no visual affordance hinting that it opens a menu.
First-time users may not realize it is clickable.
This patch adds a small caret next to the avatar, using the existing `.dropdown` / `.dropdown-content` markup and `:has()` selector already used by the component: the caret rotates 180° while the menu is open, using CSS only (no JS change needed).
Patch attached: account_menu_caret.patch (against trunk, 2 files changed:app/views/layouts/base.html.erb, app/assets/stylesheets/dropdown.css).
diff --git a/app/assets/stylesheets/dropdown.css b/app/assets/stylesheets/dropdown.css
index 648ee5b03..8caddc15f 100644
--- a/app/assets/stylesheets/dropdown.css
+++ b/app/assets/stylesheets/dropdown.css
@@ -16,6 +16,19 @@
text-decoration: none;
}
+.dropdown-caret {
+ display: inline-block;
+ margin-inline-start: 6px;
+ border-inline: 4px solid transparent;
+ border-block-start: 5px solid var(--oc-gray-1);
+ border-block-end: 0;
+ transition: transform 0.15s ease;
+}
+
+.dropdown:has(> .dropdown-content:not(.hidden)) .dropdown-caret {
+ transform: rotate(180deg);
+}
+
.dropdown-content {
position: absolute;
inset-block-start: 100%;
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index b294a2bff..1ae5ecf9c 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -68,6 +68,7 @@
<div id="account" class="dropdown" data-controller="dropdown">
<a href="#" class="dropdown-trigger" data-action="click->dropdown#toggle">
<%= avatar(User.current, :size => "22") %>
+ <span class="dropdown-caret" aria-hidden="true"></span>
</a>
<div class="dropdown-content hidden" data-dropdown-target="content">
<div class="user-info">
Files
Related issues
Updated by Go MAEDA about 1 month ago
- File 44293-before@2x.png 44293-before@2x.png added
- File 44293-after@2x.png 44293-after@2x.png added
- Target version set to 7.0.1
This is a nice UI improvement. It should be included in Redmine 7.0.1.
Before:
After:
Updated by Marius BĂLTEANU 23 days ago
- Related to Patch #44341: Increase top menu hover highlight by increasing the padding of the elements added
Updated by Marius BĂLTEANU 23 days ago
- Related to Feature #31353: Replace user related links in the top menu bar with a proper user menu. added
Updated by Marius BĂLTEANU 23 days ago
- File 0001-Add-SVG-caret-to-account-menu-44293.patch added
I think most users are used to having an openable account menu in the top bar, but I'm happy to add the caret for extra clarity. I'd prefer to use our existing SVG icon and skip the animation, though.
Patch attached, we can include this in the next release.
Updated by Marius BĂLTEANU 23 days ago
- File deleted (
0001-Add-SVG-caret-to-account-menu-44293.patch)
Updated by Marius BĂLTEANU 23 days ago
- File 0001-Add-SVG-caret-to-account-menu-44293.patch added
Updated the patch to fix the stroke color and to unify the styles of the SVG icon from the account menu with other potential SVG icons added by plugins in the top menu.
Updated by Marius BĂLTEANU 23 days ago
- File deleted (
0001-Add-SVG-caret-to-account-menu-44293.patch)