user_card_popover: Fix bot owner field overflowing for long names.

This commit fixes the overflowing issue for long bot owner names in the
user card popover, and also repositions the bot owner user card popover
to align with the bot owner name on the bot user card popover.
This commit is contained in:
Sayam Samal 2024-07-24 21:18:48 +05:30 committed by Tim Abbott
parent 9b314da0ea
commit 9c2b60a304
3 changed files with 13 additions and 1 deletions

View File

@ -692,6 +692,15 @@ function register_click_handlers() {
e.preventDefault(); e.preventDefault();
}); });
$("body").on("click", ".view_bot_owner_user_profile", (e) => {
const user_id = Number.parseInt($(e.currentTarget).attr("data-user-id"), 10);
const user = people.get_by_user_id(user_id);
const $target = $(e.currentTarget).closest(".popover-menu-user-type");
toggle_user_card_popover($target, user);
e.stopPropagation();
e.preventDefault();
});
$("body").on("click", ".view_user_profile, .person_picker .pill[data-user-id]", (e) => { $("body").on("click", ".view_user_profile, .person_picker .pill[data-user-id]", (e) => {
const user_id = Number.parseInt($(e.currentTarget).attr("data-user-id"), 10); const user_id = Number.parseInt($(e.currentTarget).attr("data-user-id"), 10);
const user = people.get_by_user_id(user_id); const user = people.get_by_user_id(user_id);

View File

@ -992,6 +992,7 @@ ul.popover-group-menu-member-list {
.popover-menu-user-info { .popover-menu-user-info {
width: max-content; width: max-content;
align-self: center; align-self: center;
overflow: hidden;
} }
.popover-menu-user-full-name { .popover-menu-user-full-name {
@ -1011,6 +1012,8 @@ ul.popover-group-menu-member-list {
/* 16px at 14px/1em */ /* 16px at 14px/1em */
line-height: 1.1428em; line-height: 1.1428em;
color: var(--color-text-item); color: var(--color-text-item);
text-overflow: ellipsis;
white-space: nowrap;
} }
.user_circle_empty { .user_circle_empty {

View File

@ -17,7 +17,7 @@
{{#if is_bot}} {{#if is_bot}}
{{#if bot_owner}} {{#if bot_owner}}
<div class="bot_owner" data-tippy-content="{{ bot_owner.full_name }}">{{t "Bot owner" }}: <div class="bot_owner" data-tippy-content="{{ bot_owner.full_name }}">{{t "Bot owner" }}:
<span class="bot-owner-name view_user_profile" data-user-id='{{ bot_owner.user_id }}'> <span class="bot-owner-name view_bot_owner_user_profile" data-user-id='{{ bot_owner.user_id }}'>
{{bot_owner.full_name}} {{bot_owner.full_name}}
</span> </span>
</div> </div>