message_header: Remove unresolve topic button from message header.

This commit removes the "unresolve topic" button from the recipient row
controls in the message header. The unresolve topic option is already
present in the "Topic Actions" menu, and the operation is rare enough
that it does not warrant a dedicated button in the recipient row.
This commit is contained in:
Sayam Samal
2025-07-04 05:34:03 +05:30
committed by Tim Abbott
parent 04f3b6afe1
commit 23ac87606a
3 changed files with 8 additions and 24 deletions

View File

@@ -404,14 +404,6 @@ export function initialize(): void {
message_edit.toggle_resolve_topic(message_id, topic_name, false, $recipient_row);
});
$("body").on("click", ".message_header .on_hover_topic_unresolve", (e) => {
e.stopPropagation();
const $recipient_row = $(e.target).closest(".recipient_row");
const message_id = rows.id_for_recipient_row($recipient_row);
const topic_name = $(e.target).closest(".message_header").attr("data-topic-name")!;
message_edit.toggle_resolve_topic(message_id, topic_name, false, $recipient_row);
});
// RECIPIENT BARS
function get_row_id_for_narrowing(narrow_link_elem: HTMLElement): number {

View File

@@ -787,12 +787,12 @@ export function start($row: JQuery, edit_box_open_callback?: () => void): void {
}
function show_toggle_resolve_topic_spinner($row: JQuery): void {
const $button = $row.find(".on_hover_topic_resolve, .on_hover_topic_unresolve").expectOne();
const $button = $row.find(".on_hover_topic_resolve").expectOne();
$button.addClass("loading-resolve-topic-state");
// While we call the show_button_loading_indicator method to
// show the spinner, we don't need to call the corresponding
// hide_button_loading_indicator method later in the code
// for a successful resolve/unresolve request, as that results
// for a successful resolve request, as that results
// in a rerender of the message feed which replaces the button.
buttons.show_button_loading_indicator($button);
}
@@ -961,7 +961,7 @@ function do_toggle_resolve_topic(
data: request,
error(xhr) {
if ($row) {
const $button = $row.find(".on_hover_topic_resolve, .on_hover_topic_unresolve");
const $button = $row.find(".on_hover_topic_resolve");
buttons.hide_button_loading_indicator($button);
$button.removeClass("loading-resolve-topic-state");
// Remove any existing tippy instance on the button.
@@ -973,15 +973,9 @@ function do_toggle_resolve_topic(
trigger: "manual",
appendTo: () => document.body,
onShow(instance) {
if ($button.hasClass("on_hover_topic_resolve")) {
instance.setContent(
$t({defaultMessage: "Error: Could not resolve topic."}),
);
} else if ($button.hasClass("on_hover_topic_unresolve")) {
instance.setContent(
$t({defaultMessage: "Error: Could not unresolve topic."}),
);
}
instance.setContent(
$t({defaultMessage: "Error: Could not resolve topic."}),
);
},
});
// Manually trigger the error tooltip, and remove it after 2 seconds.

View File

@@ -55,11 +55,9 @@
{{/if}}
{{#if (and user_can_resolve_topic (not is_empty_string_topic))}}
{{#if topic_is_resolved}}
{{> components/icon_button icon="check-x" intent="neutral" custom_classes="on_hover_topic_unresolve recipient-bar-control recipient-bar-control-icon hidden-for-spectators" data-tippy-content=(t "Mark as unresolved") aria-label=(t "Mark as unresolved") }}
{{else}}
{{#unless topic_is_resolved}}
{{> components/icon_button icon="check" intent="neutral" custom_classes="on_hover_topic_resolve recipient-bar-control recipient-bar-control-icon hidden-for-spectators" data-tippy-content=(t "Mark as resolved") aria-label=(t "Mark as resolved") }}
{{/if}}
{{/unless}}
{{/if}}
{{! visibility policy menu }}