Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_header: Update legacy topic menu button to use icon button.

Sayam Samalfeedb6ea2de8
diff --git a/web/src/message_list_tooltips.ts b/web/src/message_list_tooltips.ts
index 562ff1fb62e..2eab1cd48b8 100644
--- a/web/src/message_list_tooltips.ts
+++ b/web/src/message_list_tooltips.ts
@@ -314,18 +314,12 @@ export function initialize(): void {
...topic_visibility_policy_tooltip_props,
});
- message_list_tooltip(
- [
- "#message_feed_container .recipient_bar_icon:not(.recipient-row-topic-menu):not(.toggle_resolve_topic_spinner)",
- "#message_feed_container .recipient-bar-control-icon:not(.recipient-row-topic-menu):not(.toggle_resolve_topic_spinner)",
- ].join(","),
- {
- delay: LONG_HOVER_DELAY,
- onHidden(instance) {
- instance.destroy();
- },
+ message_list_tooltip("#message_feed_container .recipient-bar-control-icon:not(.toggle_resolve_topic_spinner)", {
+ delay: LONG_HOVER_DELAY,
+ onHidden(instance) {
+ instance.destroy();
},
- );
+ });
message_list_tooltip(".rendered_markdown time", {
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
diff --git a/web/src/topic_popover.ts b/web/src/topic_popover.ts
index 1420f33cca6..8416bcd6682 100644
--- a/web/src/topic_popover.ts
+++ b/web/src/topic_popover.ts
@@ -7,6 +7,7 @@ import render_left_sidebar_topic_actions_popover from "../templates/popovers/lef
import * as clipboard_handler from "./clipboard_handler.ts";
import * as confirm_dialog from "./confirm_dialog.ts";
+import * as hash_util from "./hash_util.ts";
import {$t_html} from "./i18n.ts";
import * as message_edit from "./message_edit.ts";
import * as message_summary from "./message_summary.ts";
@@ -29,7 +30,14 @@ function get_conversation(instance: tippy.Instance): {
let topic_name;
let url;
- if (!instance.reference.classList.contains("topic-sidebar-menu-icon")) {
+ if (instance.reference.classList.contains("recipient-bar-control")) {
+ const $elt = $(instance.reference);
+ const $message_header = $elt.closest(".message_header").expectOne();
+ stream_id = Number.parseInt($message_header.attr("data-stream-id")!, 10);
+ topic_name = $message_header.attr("data-topic-name")!;
+ const topic_narrow_url = hash_util.by_stream_topic_url(stream_id, topic_name);
+ url = new URL(topic_narrow_url, realm.realm_url).href;
+ } else if (!instance.reference.classList.contains("topic-sidebar-menu-icon")) {
const $elt = $(instance.reference);
stream_id = Number.parseInt($elt.attr("data-stream-id")!, 10);
topic_name = $elt.attr("data-topic-name")!;
diff --git a/web/templates/recipient_row.hbs b/web/templates/recipient_row.hbs
index 5d220060e7d..b4c188b0c14 100644
--- a/web/templates/recipient_row.hbs
+++ b/web/templates/recipient_row.hbs
@@ -82,7 +82,12 @@
{{/if}}
{{! Topic menu }}
- <i class="zulip-icon zulip-icon-more-vertical recipient-row-topic-menu recipient-bar-control recipient_bar_icon" tabindex="0" aria-label="{{t 'Topic actions menu' }}" aria-haspopup="true" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" data-topic-url="{{topic_url}}"></i>
+ {{!-- We define the recipient-row-topic-menu class in a wrapper span
+ since the icon button component already has a tippy tooltip attached
+ to it and attaching the topic actions menu popover to it causes buggy behavior. --}}
+ <span class="recipient-row-topic-menu recipient-bar-control" aria-haspopup="true">
+ {{> components/icon_button icon="more-vertical" intent="neutral" custom_classes="recipient-bar-control-icon" data-tippy-content=(t "Topic actions") aria-label=(t "Topic actions") }}
+ </span>
</span>
<span class="recipient_row_date {{#if (and (not always_display_date) date_unchanged )}}recipient_row_date_unchanged{{/if}}">{{{date}}}</span>
</div>