message-list-view: Use specific header for DM conversation with self.

For the DM conversation with the current user, use "Messages with
yourself" for the message header bar and tooltip.

Fixes #33321.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
This commit is contained in:
Harsh
2025-02-09 12:36:48 +05:30
committed by Tim Abbott
parent bdf2317b40
commit bc9e6e13bb
2 changed files with 15 additions and 9 deletions

View File

@@ -123,6 +123,7 @@ export type MessageGroup = {
pm_with_url: string;
recipient_users: RecipientRowUser[];
always_display_date: boolean;
is_dm_with_self: boolean;
}
);
@@ -458,6 +459,7 @@ function populate_group_from_message(
display_recipient,
pm_with_url: message.pm_with_url,
recipient_users: get_users_for_recipient_row(message),
is_dm_with_self: people.is_direct_message_conversation_with_self(user_ids),
display_reply_to_for_tooltip: message_store.get_pm_full_names(user_ids),
always_display_date,
};

View File

@@ -88,17 +88,21 @@
<div class="message-header-contents">
<a class="message_label_clickable narrows_by_recipient stream_label tippy-narrow-tooltip"
href="{{pm_with_url}}"
data-tippy-content="{{t 'Go to direct messages with {display_reply_to_for_tooltip}' }}">
data-tippy-content="{{#if is_dm_with_self}}{{t 'Go to direct messages with yourself' }}{{else}}{{t 'Go to direct messages with {display_reply_to_for_tooltip}' }}{{/if}}">
<span class="private_message_header_icon"><i class="zulip-icon zulip-icon-user"></i></span>
<span class="private_message_header_name">
{{~#tr}}You and <z-user-names></z-user-names>
{{#*inline "z-user-names"}}
{{#each recipient_users}}
{{~full_name}}{{#if is_bot}}<i class="zulip-icon zulip-icon-bot" aria-label="{{t 'Bot' }}"></i>{{/if}}
{{~#if should_add_guest_user_indicator}}&nbsp;<i>({{t 'guest'}})</i>{{/if}}{{#unless @last}}, {{/unless~}}
{{/each}}
{{/inline}}
{{/tr~}}
{{#if is_dm_with_self}}
{{t 'Messages with yourself' }}
{{else}}
{{~#tr}}You and <z-user-names></z-user-names>
{{#*inline "z-user-names"}}
{{#each recipient_users}}
{{~full_name}}{{#if is_bot}}<i class="zulip-icon zulip-icon-bot" aria-label="{{t 'Bot' }}"></i>{{/if~}}
{{#if should_add_guest_user_indicator}}&nbsp;<i>({{t 'guest'}})</i>{{/if}}{{#unless @last}}, {{/unless}}
{{/each}}
{{/inline}}
{{/tr~}}
{{/if}}
</span>
</a>
<span class="recipient_row_date {{#if (and (not always_display_date) date_unchanged )}}recipient_row_date_unchanged{{/if}}">{{{date}}}</span>