Skip to content

Commit 2890a5d

Browse files
committed
refactor: api_types/buttons: Use RESOLVED_TOPIC_PREFIX as in server.
This both renames the constant in use from RESOLVED_PREFIX, but also combines the prefix single character value with a space - as both used in the backend and frontend on the Zulip server.
1 parent bac05b3 commit 2890a5d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

zulipterminal/api_types.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from typing_extensions import Literal, TypedDict
44

55

6-
RESOLVED_PREFIX = "✔"
6+
RESOLVED_TOPIC_PREFIX = "✔ "
7+
78
EditPropagateMode = Literal["change_one", "change_all", "change_later"]
89
EmojiType = Literal["realm_emoji", "unicode_emoji", "zulip_extra_emoji"]
910
# Limited flags which could be present in update_message_flag events.

zulipterminal/ui_tools/buttons.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import urwid
77
from typing_extensions import TypedDict
88

9-
from zulipterminal.api_types import RESOLVED_PREFIX, EditPropagateMode
9+
from zulipterminal.api_types import RESOLVED_TOPIC_PREFIX, EditPropagateMode
1010
from zulipterminal.config.keys import is_command_key, primary_key_for_command
1111
from zulipterminal.config.regexes import REGEX_INTERNAL_LINK_STREAM_ID
1212
from zulipterminal.config.symbols import (
@@ -301,7 +301,7 @@ def __init__(
301301
# The space acts as a TopButton prefix and gives an effective 3 spaces for unresolved topics.
302302
topic_prefix = " "
303303
topic_name = self.topic_name
304-
if self.topic_name.startswith(RESOLVED_PREFIX + " "):
304+
if self.topic_name.startswith(RESOLVED_TOPIC_PREFIX):
305305
topic_prefix = self.topic_name[:1]
306306
topic_name = self.topic_name[2:]
307307

0 commit comments

Comments
 (0)