From 9e7de8bb41d74ed4fe327f396f37f21ed1c1ea47 Mon Sep 17 00:00:00 2001 From: Niloth-p <20315308+Niloth-p@users.noreply.github.com> Date: Mon, 17 Jun 2024 22:40:58 +0530 Subject: [PATCH 1/2] keys: Add a new help category for opening compose box. Regroup key bindings that were previously categorized under message actions and the general category. Hotkeys document regenerated. --- docs/hotkeys.md | 18 +++++++++++------- zulipterminal/config/keys.py | 15 ++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/hotkeys.md b/docs/hotkeys.md index d1cd722db5..f6dabfbcc3 100644 --- a/docs/hotkeys.md +++ b/docs/hotkeys.md @@ -8,7 +8,6 @@ |Show/hide Help Menu|?| |Show/hide Markdown Help Menu|Meta + m| |Show/hide About Menu|Meta + ?| -|Open draft message saved in this session|d| |Copy information from About Menu to clipboard|c| |Redraw screen|Ctrl + l| |Quit|Ctrl + c| @@ -47,13 +46,7 @@ ## Message actions |Command|Key Combination| | :--- | :---: | -|Reply to the current message|r / Enter| -|Reply mentioning the sender of the current message|@| -|Reply quoting the current message text|>| -|Reply directly to the sender of the current message|R| |Edit message's content or topic|e| -|New message to a stream|c| -|New message to a person or group of people|x| |Show/hide emoji picker for current message|:| |Narrow to the stream of the current message|s| |Narrow to the topic of the current message|S| @@ -77,6 +70,17 @@ |Show/hide stream members (from stream information)|m| |Copy stream email to clipboard (from stream information)|c| +## Begin composing a message +|Command|Key Combination| +| :--- | :---: | +|Open draft message saved in this session|d| +|Reply to the current message|r / Enter| +|Reply mentioning the sender of the current message|@| +|Reply quoting the current message text|>| +|Reply directly to the sender of the current message|R| +|New message to a stream|c| +|New message to a person or group of people|x| + ## Composing a Message |Command|Key Combination| | :--- | :---: | diff --git a/zulipterminal/config/keys.py b/zulipterminal/config/keys.py index 254778a12b..9f80f972de 100644 --- a/zulipterminal/config/keys.py +++ b/zulipterminal/config/keys.py @@ -49,7 +49,7 @@ class KeyBinding(TypedDict): 'OPEN_DRAFT': { 'keys': ['d'], 'help_text': 'Open draft message saved in this session', - 'key_category': 'general', + 'key_category': 'open_compose', }, 'COPY_ABOUT_INFO': { 'keys': ['c'], @@ -104,22 +104,22 @@ class KeyBinding(TypedDict): 'REPLY_MESSAGE': { 'keys': ['r', 'enter'], 'help_text': 'Reply to the current message', - 'key_category': 'msg_actions', + 'key_category': 'open_compose', }, 'MENTION_REPLY': { 'keys': ['@'], 'help_text': 'Reply mentioning the sender of the current message', - 'key_category': 'msg_actions', + 'key_category': 'open_compose', }, 'QUOTE_REPLY': { 'keys': ['>'], 'help_text': 'Reply quoting the current message text', - 'key_category': 'msg_actions', + 'key_category': 'open_compose', }, 'REPLY_AUTHOR': { 'keys': ['R'], 'help_text': 'Reply directly to the sender of the current message', - 'key_category': 'msg_actions', + 'key_category': 'open_compose', }, 'EDIT_MESSAGE': { 'keys': ['e'], @@ -129,12 +129,12 @@ class KeyBinding(TypedDict): 'STREAM_MESSAGE': { 'keys': ['c'], 'help_text': 'New message to a stream', - 'key_category': 'msg_actions', + 'key_category': 'open_compose', }, 'PRIVATE_MESSAGE': { 'keys': ['x'], 'help_text': 'New message to a person or group of people', - 'key_category': 'msg_actions', + 'key_category': 'open_compose', }, 'CYCLE_COMPOSE_FOCUS': { 'keys': ['tab'], @@ -447,6 +447,7 @@ class KeyBinding(TypedDict): "searching": "Searching", "msg_actions": "Message actions", "stream_list": "Stream list actions", + "open_compose": "Begin composing a message", "msg_compose": "Composing a Message", "editor_navigation": "Editor: Navigation", "editor_text_manipulation": "Editor: Text Manipulation", From 5b6f02ef7dd1d1024d54cdc4e797dd1439312319 Mon Sep 17 00:00:00 2001 From: Niloth-p <20315308+Niloth-p@users.noreply.github.com> Date: Mon, 17 Jun 2024 22:32:44 +0530 Subject: [PATCH 2/2] keys: Rename the help category of message compose box actions. The category name in the code: 'msg_compose' -> 'compose_box' The user visible name: 'Composing a message' -> 'Writing a message' This is to emphasize its difference from the other newly created category for actions that open the compose box, to both users and developers. Hotkeys document regenerated. --- docs/hotkeys.md | 2 +- zulipterminal/config/keys.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/hotkeys.md b/docs/hotkeys.md index f6dabfbcc3..3c69e3dd3c 100644 --- a/docs/hotkeys.md +++ b/docs/hotkeys.md @@ -81,7 +81,7 @@ |New message to a stream|c| |New message to a person or group of people|x| -## Composing a Message +## Writing a message |Command|Key Combination| | :--- | :---: | |Cycle through recipient and content boxes|Tab| diff --git a/zulipterminal/config/keys.py b/zulipterminal/config/keys.py index 9f80f972de..684b1d1611 100644 --- a/zulipterminal/config/keys.py +++ b/zulipterminal/config/keys.py @@ -139,28 +139,28 @@ class KeyBinding(TypedDict): 'CYCLE_COMPOSE_FOCUS': { 'keys': ['tab'], 'help_text': 'Cycle through recipient and content boxes', - 'key_category': 'msg_compose', + 'key_category': 'compose_box', }, 'SEND_MESSAGE': { 'keys': ['ctrl d', 'meta enter'], 'help_text': 'Send a message', - 'key_category': 'msg_compose', + 'key_category': 'compose_box', }, 'SAVE_AS_DRAFT': { 'keys': ['meta s'], 'help_text': 'Save current message as a draft', - 'key_category': 'msg_compose', + 'key_category': 'compose_box', }, 'AUTOCOMPLETE': { 'keys': ['ctrl f'], 'help_text': ('Autocomplete @mentions, #stream_names, :emoji:' ' and topics'), - 'key_category': 'msg_compose', + 'key_category': 'compose_box', }, 'AUTOCOMPLETE_REVERSE': { 'keys': ['ctrl r'], 'help_text': 'Cycle through autocomplete suggestions in reverse', - 'key_category': 'msg_compose', + 'key_category': 'compose_box', }, 'ADD_REACTION': { 'keys': [':'], @@ -180,12 +180,12 @@ class KeyBinding(TypedDict): 'NARROW_MESSAGE_RECIPIENT': { 'keys': ['meta .'], 'help_text': 'Narrow to compose box message recipient', - 'key_category': 'msg_compose', + 'key_category': 'compose_box', }, 'EXIT_COMPOSE': { 'keys': ['esc'], 'help_text': 'Exit message compose box', - 'key_category': 'msg_compose', + 'key_category': 'compose_box', }, 'TOGGLE_NARROW': { 'keys': ['z'], @@ -426,7 +426,7 @@ class KeyBinding(TypedDict): # and to differentiate from other hotkeys using 'enter'. 'keys': ['enter'], 'help_text': 'Insert new line', - 'key_category': 'msg_compose', + 'key_category': 'compose_box', }, 'FULL_RENDERED_MESSAGE': { 'keys': ['f'], @@ -448,7 +448,7 @@ class KeyBinding(TypedDict): "msg_actions": "Message actions", "stream_list": "Stream list actions", "open_compose": "Begin composing a message", - "msg_compose": "Composing a Message", + "compose_box": "Writing a message", "editor_navigation": "Editor: Navigation", "editor_text_manipulation": "Editor: Text Manipulation", }