streams: Improve formatting of channel archive/unarchive notifications.

This commit updates the formatting of the channel archive and
unarchive notifications to make the channel name bold and clickable.
The channel name is now displayed as a Markdown link with bold
formatting, ensuring it stands out while remaining a clickable link
to the channel.
This commit is contained in:
whilstsomebody
2025-04-30 13:37:11 +05:30
committed by Tim Abbott
parent 2780360b00
commit 5c33cc9eab
2 changed files with 6 additions and 4 deletions

View File

@@ -188,7 +188,9 @@ def do_deactivate_stream(stream: Stream, *, acting_user: UserProfile | None) ->
sender,
stream,
topic_name=str(Realm.STREAM_EVENTS_NOTIFICATION_TOPIC_NAME),
content=_("Channel {channel_name} has been archived.").format(channel_name=stream.name),
content=_("Channel #**{channel_name}** has been archived.").format(
channel_name=stream.name
),
archived_channel_notice=True,
limit_unread_user_ids=set(),
)
@@ -310,7 +312,7 @@ def do_unarchive_stream(stream: Stream, new_name: str, *, acting_user: UserProfi
sender,
stream,
str(Realm.STREAM_EVENTS_NOTIFICATION_TOPIC_NAME),
_("Channel {channel_name} un-archived.").format(channel_name=new_name),
_("Channel #**{channel_name}** has been unarchived.").format(channel_name=new_name),
)

View File

@@ -2012,7 +2012,7 @@ class StreamAdminTest(ZulipTestCase):
self.assertTrue(check_subscriptions_exists(user_profile, stream))
# Assert that a notification message was sent for the archive.
message = self.get_last_message()
expected_content = f"Channel {stream.name} has been archived."
expected_content = f"Channel #**{stream.name}** has been archived."
self.assertEqual(message.content, expected_content)
# Assert that the message is read.
@@ -2042,7 +2042,7 @@ class StreamAdminTest(ZulipTestCase):
self.assertTrue(check_subscriptions_exists(user_profile, stream))
# Assert that a notification message was sent for the archive.
message = self.get_last_message()
expected_content = f"Channel {stream.name} has been archived."
expected_content = f"Channel #**{stream.name}** has been archived."
self.assertEqual(message.content, expected_content)
# Assert that the message is read.