From 6aec84147b2ef7b39731a0004782ce5a32aea266 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Wed, 9 Jul 2025 21:55:13 +0530 Subject: [PATCH] stream_list: Fix misleading tooltip. When in topic narrow, hovering over the topic's channel, should correctly show where it would navigate to. --- web/src/stream_list.ts | 12 +++++++++++- .../go_to_channel_list_of_topics_tooltip.hbs | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 web/templates/go_to_channel_list_of_topics_tooltip.hbs diff --git a/web/src/stream_list.ts b/web/src/stream_list.ts index 25a0d86c2e..966038e58b 100644 --- a/web/src/stream_list.ts +++ b/web/src/stream_list.ts @@ -5,6 +5,7 @@ import * as tippy from "tippy.js"; import render_filter_topics from "../templates/filter_topics.hbs"; import render_go_to_channel_feed_tooltip from "../templates/go_to_channel_feed_tooltip.hbs"; +import render_go_to_channel_list_of_topics_tooltip from "../templates/go_to_channel_list_of_topics_tooltip.hbs"; import render_stream_privacy from "../templates/stream_privacy.hbs"; import render_stream_sidebar_row from "../templates/stream_sidebar_row.hbs"; import render_stream_subheader from "../templates/streams_subheader.hbs"; @@ -878,7 +879,16 @@ export function initialize_tippy_tooltips(): void { const current_narrow_stream_id = narrow_state.stream_id(); const current_topic = narrow_state.topic(); if (current_narrow_stream_id === stream_id && current_topic !== undefined) { - instance.setContent(ui_util.parse_html(render_go_to_channel_feed_tooltip())); + if ( + user_settings.web_channel_default_view === + web_channel_default_view_values.list_of_topics.code + ) { + instance.setContent( + ui_util.parse_html(render_go_to_channel_list_of_topics_tooltip()), + ); + } else { + instance.setContent(ui_util.parse_html(render_go_to_channel_feed_tooltip())); + } return undefined; } // Then check for truncation diff --git a/web/templates/go_to_channel_list_of_topics_tooltip.hbs b/web/templates/go_to_channel_list_of_topics_tooltip.hbs new file mode 100644 index 0000000000..9396d2bd3a --- /dev/null +++ b/web/templates/go_to_channel_list_of_topics_tooltip.hbs @@ -0,0 +1,2 @@ +
{{t "Go to list of topics"}}
+{{tooltip_hotkey_hints "Y"}}