diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results.hbs b/app/assets/javascripts/discourse/app/components/search-menu/results.hbs
index 2d666379085..6cfec455484 100644
--- a/app/assets/javascripts/discourse/app/components/search-menu/results.hbs
+++ b/app/assets/javascripts/discourse/app/components/search-menu/results.hbs
@@ -62,6 +62,7 @@
@resultTypes={{this.resultTypesWithComponent}}
@closeSearchMenu={{@closeSearchMenu}}
@searchTermChanged={{@searchTermChanged}}
+ @displayNameWithUser={{true}}
/>
{{/if}}
{{/if}}
diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/type/user.hbs b/app/assets/javascripts/discourse/app/components/search-menu/results/type/user.hbs
index 731df825b3e..d6a9a070ad3 100644
--- a/app/assets/javascripts/discourse/app/components/search-menu/results/type/user.hbs
+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/type/user.hbs
@@ -5,7 +5,7 @@
username=@result.username
}}
- {{#if @result.name}}
+ {{#if (and @displayNameWithUser @result.name)}}
{{@result.name}}
{{/if}}
diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/types.hbs b/app/assets/javascripts/discourse/app/components/search-menu/results/types.hbs
index 72943c92f2a..2c9660a994b 100644
--- a/app/assets/javascripts/discourse/app/components/search-menu/results/types.hbs
+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/types.hbs
@@ -17,7 +17,10 @@
{{on "click" this.onClick}}
class="search-link"
>
-
+
{{/each}}
diff --git a/app/assets/javascripts/discourse/tests/acceptance/glimmer-search-test.js b/app/assets/javascripts/discourse/tests/acceptance/glimmer-search-test.js
index 9b868b310fb..f12cb72c377 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/glimmer-search-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/glimmer-search-test.js
@@ -1136,9 +1136,6 @@ acceptance("Search - Glimmer - assistant", function (needs) {
const username = firstUser.querySelector(".username").innerText.trim();
assert.strictEqual(username, "TeaMoe");
- const name = firstUser.querySelector(".name").innerText.trim();
- assert.strictEqual(name, "TeaMoe Full");
-
await click(firstUser);
assert.strictEqual(query("#search-term").value, `@${username}`);
});
diff --git a/app/assets/stylesheets/common/base/search-menu.scss b/app/assets/stylesheets/common/base/search-menu.scss
index 7fb1f3dee86..48bfffa8657 100644
--- a/app/assets/stylesheets/common/base/search-menu.scss
+++ b/app/assets/stylesheets/common/base/search-menu.scss
@@ -387,12 +387,11 @@ $search-pad-horizontal: 0.5em;
}
.search-item-user {
- .username {
- margin-right: 0.33rem;
- }
+ display: flex;
+ align-self: center;
- img.avatar {
- margin-right: 0 !important;
+ .username {
+ margin-right: 0.33em;
}
}