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.

hotkey: Add Y shortcut to go to a list of topics in channel.

Aman Agrawaldefd120c9481
diff --git a/help/keyboard-shortcuts.md b/help/keyboard-shortcuts.md
index 7ca441c33f1..bf14fd594b2 100644
--- a/help/keyboard-shortcuts.md
+++ b/help/keyboard-shortcuts.md
@@ -105,6 +105,8 @@ in the Zulip app to add more to your repertoire as needed.
* **Go to direct message feed**: <kbd>Shift</kbd> + <kbd>P</kbd>
+* **Go to list of topics for the current channel**: <kbd>Y</kbd>
+
* **Zoom to message in conversation context**: <kbd>Z</kbd> — This view does not mark messages as read.
* **Cycle between channel views**: <kbd>Shift</kbd> + <kbd>A</kbd>
diff --git a/help/list-of-topics.md b/help/list-of-topics.md
index d6cee09591d..eb470b8ecc3 100644
--- a/help/list-of-topics.md
+++ b/help/list-of-topics.md
@@ -20,6 +20,10 @@ overview if you like reading your messages one channel at a time.
the list of topics when done (e.g., by using the **back** button in your
browser or desktop app) to select the next conversation.
+!!! keyboard_tip ""
+
+ Use <kbd>Y</kbd> to go to the list of topics for the current channel.
+
{tab|mobile}
{!mobile-channels.md!}
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index 4e5f65a9443..90f465e8b28 100644
--- a/web/src/hotkey.js
+++ b/web/src/hotkey.js
@@ -55,6 +55,7 @@ import * as sidebar_ui from "./sidebar_ui.ts";
import * as spectators from "./spectators.ts";
import * as starred_messages_ui from "./starred_messages_ui.ts";
import {realm} from "./state_data.ts";
+import * as stream_data from "./stream_data.ts";
import * as stream_list from "./stream_list.ts";
import * as stream_popover from "./stream_popover.ts";
import * as stream_settings_ui from "./stream_settings_ui.ts";
@@ -177,6 +178,7 @@ const KEYDOWN_MAPPINGS = {
V: {name: "show_lightbox", message_view_only: true},
W: {name: "query_users", message_view_only: true},
X: {name: "compose_private_message", message_view_only: true},
+ Y: {name: "list_of_channel_topics", message_view_only: true},
Z: {name: "zoom_to_message_near", message_view_only: true},
Tab: {name: "tab", message_view_only: false},
Escape: {name: "escape", message_view_only: false},
@@ -1171,6 +1173,29 @@ export function process_hotkey(e, hotkey) {
return true;
}
return false;
+ case "list_of_channel_topics":
+ if (message_lists.current !== undefined) {
+ let channel_id;
+ const selected_message = message_lists.current.selected_message();
+ if (selected_message === undefined) {
+ const current_filter = narrow_state.filter();
+ const current_channel = current_filter.get_operand("channel");
+ if (current_channel) {
+ channel_id = stream_data.get_stream_id(current_channel);
+ }
+ } else if (selected_message.type === "stream") {
+ channel_id = stream_data.get_stream_id(selected_message.stream);
+ }
+
+ if (channel_id === undefined) {
+ return false;
+ }
+
+ const channel_topic_list_url = hash_util.by_channel_topic_list_url(channel_id);
+ browser_history.go_to_location(channel_topic_list_url);
+ return true;
+ }
+ return false;
}
// Shortcuts that are useful with an empty message feed, like opening compose.
diff --git a/web/templates/keyboard_shortcuts.hbs b/web/templates/keyboard_shortcuts.hbs
index 84b1f1c0140..d070dbf7dc6 100644
--- a/web/templates/keyboard_shortcuts.hbs
+++ b/web/templates/keyboard_shortcuts.hbs
@@ -151,6 +151,10 @@
<td class="definition">{{t 'Go to direct message feed' }}</td>
<td><span class="hotkey"><kbd>Shift</kbd> + <kbd>P</kbd></span></td>
</tr>
+ <tr>
+ <td class="definition">{{t 'Go to list of topics for the current channel' }}</td>
+ <td><span class="hotkey"><kbd>Y</kbd></span></td>
+ </tr>
<tr>
<td class="definition">{{t 'Zoom to message in conversation context' }}</td>
<td><span class="hotkey"><kbd>Z</kbd></span></td>
diff --git a/web/templates/popovers/left_sidebar/left_sidebar_stream_actions_popover.hbs b/web/templates/popovers/left_sidebar/left_sidebar_stream_actions_popover.hbs
index 64ec7af4361..0d8f520d95d 100644
--- a/web/templates/popovers/left_sidebar/left_sidebar_stream_actions_popover.hbs
+++ b/web/templates/popovers/left_sidebar/left_sidebar_stream_actions_popover.hbs
@@ -37,6 +37,7 @@
<a role="button" href="{{stream.list_of_topics_view_url}}" class="stream-popover-go-to-list-of-topics popover-menu-link" tabindex="0">
<i class="popover-menu-icon zulip-icon zulip-icon-topic-list" aria-hidden="true"></i>
<span class="popover-menu-label">{{t "Go to list of topics" }}</span>
+ {{../popover_hotkey_hints "Y"}}
</a>
</li>
{{/if}}