From 91ddcd4e1d2d3750583710c0e4d15629c3edec43 Mon Sep 17 00:00:00 2001 From: David Rosa Date: Fri, 8 Dec 2023 19:22:52 -0800 Subject: [PATCH] help: Tweak stream/group settings instructions for logged in users. Adds gear menu instructions for how to navigate to "All streams" and "All groups". --- help/change-the-color-of-a-stream.md | 2 +- help/include/how-to-create-a-user-group.md | 2 +- help/message-a-stream-by-email.md | 2 +- help/mute-a-stream.md | 2 +- help/pin-a-stream.md | 2 +- help/unsubscribe-from-a-stream.md | 2 +- zerver/lib/markdown/help_relative_links.py | 30 ++++++++++++---------- zerver/tests/test_docs.py | 10 ++++++-- 8 files changed, 30 insertions(+), 22 deletions(-) diff --git a/help/change-the-color-of-a-stream.md b/help/change-the-color-of-a-stream.md index 8f7c79ef7b..0221abd7a2 100644 --- a/help/change-the-color-of-a-stream.md +++ b/help/change-the-color-of-a-stream.md @@ -23,7 +23,7 @@ stream. Changing a stream's color does not change it for anyone else. {start_tabs} -{relative|stream|subscribed} +{relative|gear|stream-settings} 1. Select a stream. diff --git a/help/include/how-to-create-a-user-group.md b/help/include/how-to-create-a-user-group.md index d4eb64efd0..39c1f117e1 100644 --- a/help/include/how-to-create-a-user-group.md +++ b/help/include/how-to-create-a-user-group.md @@ -1,6 +1,6 @@ {start_tabs} -{relative|group|all} +{relative|gear|group-settings} 1. Click **Create user group** on the right, or click the **plus** () icon in the upper right. diff --git a/help/message-a-stream-by-email.md b/help/message-a-stream-by-email.md index 720dd97538..a060641f9c 100644 --- a/help/message-a-stream-by-email.md +++ b/help/message-a-stream-by-email.md @@ -24,7 +24,7 @@ API](/api/send-message). {start_tabs} -{relative|stream|subscribed} +{relative|gear|stream-settings} 1. Select a stream. diff --git a/help/mute-a-stream.md b/help/mute-a-stream.md index 041f3ca8f4..5bc9eeb507 100644 --- a/help/mute-a-stream.md +++ b/help/mute-a-stream.md @@ -49,7 +49,7 @@ {tab|desktop-web} -{relative|stream|subscribed} +{relative|gear|stream-settings} 1. Select a stream. diff --git a/help/pin-a-stream.md b/help/pin-a-stream.md index e37c14a235..0ebbe3bb76 100644 --- a/help/pin-a-stream.md +++ b/help/pin-a-stream.md @@ -50,7 +50,7 @@ which is especially handy if you are subscribed to a large number of streams. {tab|desktop-web} -{relative|stream|subscribed} +{relative|gear|stream-settings} 1. Select a stream. diff --git a/help/unsubscribe-from-a-stream.md b/help/unsubscribe-from-a-stream.md index f08eee56df..e5cb5f20e6 100644 --- a/help/unsubscribe-from-a-stream.md +++ b/help/unsubscribe-from-a-stream.md @@ -28,7 +28,7 @@ You can always unsubscribe from any stream in Zulip. {tab|desktop-web} -{relative|stream|subscribed} +{relative|gear|stream-settings} 1. Click the **checkmark** (checkmark) diff --git a/zerver/lib/markdown/help_relative_links.py b/zerver/lib/markdown/help_relative_links.py index bb52d9e041..24fa7a51a7 100644 --- a/zerver/lib/markdown/help_relative_links.py +++ b/zerver/lib/markdown/help_relative_links.py @@ -99,44 +99,46 @@ def help_handle_match(key: str) -> str: stream_info = { "all": ["All streams", "/#streams/all"], - "subscribed": ["Subscribed streams", "/#streams/subscribed"], } -stream_instructions_no_link = """ +stream_all_instructions = """ 1. Click on the **gear** () icon in the upper right corner of the web or desktop app. -1. Click **Stream settings**. +1. Select **Stream settings**. + +1. Click {item} in the upper left. """ def stream_handle_match(key: str) -> str: if relative_help_links: - return f"1. Go to [{stream_info[key][0]}]({stream_info[key][1]})." - if key == "all": - return stream_instructions_no_link + "\n\n1. Click **All streams** in the upper left." - return stream_instructions_no_link + item = f"[{stream_info[key][0]}]({stream_info[key][1]})" + else: + item = f"**{stream_info[key][0]}**" + return stream_all_instructions.format(item=item) group_info = { "all": ["All groups", "/#groups/all"], - "subscribed": ["Your groups", "/#groups/your"], } -group_instructions_no_link = """ +group_all_instructions = """ 1. Click on the **gear** () icon in the upper right corner of the web or desktop app. -1. Click **Group settings**. +1. Select **Group settings**. + +1. Click {item} in the upper left. """ def group_handle_match(key: str) -> str: if relative_help_links: - return f"1. Go to [{group_info[key][0]}]({group_info[key][1]})." - if key == "all": - return group_instructions_no_link + "\n\n1. Click **All groups** in the upper left." - return group_instructions_no_link + item = f"[{group_info[key][0]}]({group_info[key][1]})" + else: + item = f"**{group_info[key][0]}**" + return group_all_instructions.format(item=item) draft_instructions = """ diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py index 380ac05da7..d2c1b21648 100644 --- a/zerver/tests/test_docs.py +++ b/zerver/tests/test_docs.py @@ -424,13 +424,19 @@ class HelpTest(ZulipTestCase): def test_help_relative_links_for_stream(self) -> None: result = self.client_get("/help/message-a-stream-by-email") - self.assertIn('Subscribed streams', str(result.content)) + self.assertIn( + ' Stream settings', + str(result.content), + ) self.assertEqual(result.status_code, 200) with self.settings(ROOT_DOMAIN_LANDING_PAGE=True): result = self.client_get("/help/message-a-stream-by-email", subdomain="") self.assertEqual(result.status_code, 200) - self.assertIn("Stream settings", str(result.content)) + self.assertIn( + ' Stream settings', + str(result.content), + ) self.assertNotIn("/#streams", str(result.content))