message_feed: Modify tooltips to clarify draft saving.

Update the tooltips for the "Cancel" and "Spinner".  Provide clear
information about the draft saving behavior when a message fails to
send successfully.

Fixes part of #29100.
This commit is contained in:
sujal 2024-02-29 15:53:43 +05:30 committed by Tim Abbott
parent f144400d46
commit eba0097c7f
4 changed files with 19 additions and 10 deletions

View File

@ -8,7 +8,6 @@ import render_message_edit_notice_tooltip from "../templates/message_edit_notice
import render_message_inline_image_tooltip from "../templates/message_inline_image_tooltip.hbs";
import render_narrow_tooltip from "../templates/narrow_tooltip.hbs";
import {$t} from "./i18n";
import * as message_lists from "./message_lists";
import * as popover_menus from "./popover_menus";
import * as reactions from "./reactions";
@ -221,12 +220,6 @@ export function initialize(): void {
message_list_tooltip(".slow-send-spinner", {
onShow(instance) {
instance.setContent(
$t({
defaultMessage:
"Your message is taking longer than expected to be sent. Sending…",
}),
);
const $elem = $(instance.reference);
// We need to check for removal of local class from message_row since

View File

@ -34,7 +34,7 @@
</a>
{{#if (and (not msg/failed_request) msg/locally_echoed)}}
<span class="fa fa-circle-o-notch slow-send-spinner{{#unless msg/show_slow_send_spinner }} hidden{{/unless}}"></span>
<span data-tooltip-template-id="slow-send-spinner-tooltip-template" class="fa fa-circle-o-notch slow-send-spinner{{#unless msg/show_slow_send_spinner }} hidden{{/unless}}"></span>
{{/if}}
{{> message_controls}}

View File

@ -22,8 +22,8 @@
<i class="fa fa-refresh refresh-failed-message" aria-label="{{t 'Retry' }}" role="button" tabindex="0"></i>
</div>
<div class="message_control_button failed_message_action" data-tippy-content="{{t 'Cancel' }}">
<i class="fa fa-times-circle remove-failed-message" aria-label="{{t 'Cancel' }}" role="button" tabindex="0"></i>
<div class="message_control_button failed_message_action" data-tooltip-template-id="dismiss-failed-send-button-tooltip-template">
<i class="fa fa-times-circle remove-failed-message" aria-label="{{t 'Dismiss' }}" role="button" tabindex="0"></i>
</div>
</div>

View File

@ -154,6 +154,22 @@
{{t "Message actions" }}
{{tooltip_hotkey_hints "I"}}
</template>
<template id="dismiss-failed-send-button-tooltip-template">
<div>
<div>{{t "Dismiss failed message" }}</div>
<div class="italic tooltip-inner-content">
{{t "This content remains saved in your drafts." }}
</div>
</div>
</template>
<template id="slow-send-spinner-tooltip-template">
<div>
<div>{{t "Sending…" }}</div>
<div class="italic">
{{t "This message will remain saved in your drafts until it is successfully sent." }}
</div>
</div>
</template>
<template id="star-message-tooltip-template">
<div class="starred-status">{{t "Star this message" }}</div>
{{tooltip_hotkey_hints "Ctrl" "S"}}