Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_list_tooltips: Add "View bot card" tooltips for bots.
Sayam Samal069680a7d162
diff --git a/web/src/message_list_tooltips.js b/web/src/message_list_tooltips.jsindex d2ad430eff9..ee797f0ca9b 100644--- a/web/src/message_list_tooltips.js+++ b/web/src/message_list_tooltips.js@@ -283,6 +283,14 @@ export function initialize() {message_list_tooltip(".view_user_card_tooltip", {delay: LONG_HOVER_DELAY,+ onShow(instance) {+ const is_bot = $(instance.reference).data("is-bot");+ if (is_bot) {+ instance.setContent(parse_html($("#view-bot-card-tooltip-template").html()));+ } else {+ instance.setContent(parse_html($("#view-user-card-tooltip-template").html()));+ }+ },onHidden(instance) {instance.destroy();},diff --git a/web/templates/message_avatar.hbs b/web/templates/message_avatar.hbsindex 737fb7fd415..df614d526ba 100644--- a/web/templates/message_avatar.hbs+++ b/web/templates/message_avatar.hbs@@ -1,4 +1,4 @@-<div class="u-{{msg/sender_id}} message-avatar sender_info_hover view_user_card_tooltip no-select" aria-hidden="true" data-tooltip-template-id="view-user-card-tooltip-template">+<div class="u-{{msg/sender_id}} message-avatar sender_info_hover view_user_card_tooltip no-select" aria-hidden="true" data-is-bot="{{sender_is_bot}}"><div class="inline_profile_picture {{#sender_is_guest}} guest-avatar{{/sender_is_guest}}"><img src="{{small_avatar_url}}" alt="" class="no-drag"/></div>diff --git a/web/templates/message_body.hbs b/web/templates/message_body.hbsindex 0dbcde5e606..e9b8bc8bd38 100644--- a/web/templates/message_body.hbs+++ b/web/templates/message_body.hbs@@ -4,7 +4,7 @@<span class="message_sender">{{#if include_sender}}<span class="sender_info_hover sender_name" role="button" tabindex="0">- <span class="view_user_card_tooltip sender_name_text" data-tooltip-template-id="view-user-card-tooltip-template">+ <span class="view_user_card_tooltip sender_name_text" data-is-bot="{{sender_is_bot}}">{{> user_full_name name=msg/sender_full_name should_add_guest_user_indicator=should_add_guest_indicator_for_sender}}</span>{{#unless status_message}}diff --git a/web/templates/tooltip_templates.hbs b/web/templates/tooltip_templates.hbsindex a56fe256b51..937d73fd13d 100644--- a/web/templates/tooltip_templates.hbs+++ b/web/templates/tooltip_templates.hbs@@ -2,6 +2,10 @@{{t 'View user card' }}{{tooltip_hotkey_hints "U"}}</template>+<template id="view-bot-card-tooltip-template">+ {{t 'View bot card' }}+ {{tooltip_hotkey_hints "U"}}+</template><template id="compose_draft_tooltip_template">{{t 'Drafts' }}{{tooltip_hotkey_hints "D"}}