Skip to content

Commit e523a11

Browse files
committed
core: Update scroll prompt in Popup headers.
Replace the hardcoded scroll hints with the commands' display keys.
1 parent 68fc6e3 commit e523a11

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

zulipterminal/core.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from typing_extensions import Literal
2020

2121
from zulipterminal.api_types import Composition, Message
22+
from zulipterminal.config.keys import primary_display_key_for_command
2223
from zulipterminal.config.symbols import POPUP_CONTENT_BORDER, POPUP_TOP_LINE
2324
from zulipterminal.config.themes import ThemeSpec
2425
from zulipterminal.config.ui_sizes import (
@@ -51,6 +52,14 @@
5152

5253
ExceptionInfo = Tuple[Type[BaseException], BaseException, TracebackType]
5354

55+
SCROLL_PROMPT = (
56+
"("
57+
+ primary_display_key_for_command("GO_UP")
58+
+ " / "
59+
+ primary_display_key_for_command("GO_DOWN")
60+
+ " scrolls)"
61+
)
62+
5463

5564
class Controller:
5665
"""
@@ -246,11 +255,11 @@ def exit_popup(self) -> None:
246255
self.loop.widget = self.view
247256

248257
def show_help(self) -> None:
249-
help_view = HelpView(self, "Help Menu (up/down scrolls)")
258+
help_view = HelpView(self, f"Help Menu {SCROLL_PROMPT}")
250259
self.show_pop_up(help_view, "area:help")
251260

252261
def show_markdown_help(self) -> None:
253-
markdown_view = MarkdownHelpView(self, "Markdown Help Menu (up/down scrolls)")
262+
markdown_view = MarkdownHelpView(self, "Markdown Help Menu " + SCROLL_PROMPT)
254263
self.show_pop_up(markdown_view, "area:help")
255264

256265
def show_topic_edit_mode(self, button: Any) -> None:
@@ -266,7 +275,7 @@ def show_msg_info(
266275
msg_info_view = MsgInfoView(
267276
self,
268277
msg,
269-
"Message Information (up/down scrolls)",
278+
f"Message Information {SCROLL_PROMPT}",
270279
topic_links,
271280
message_links,
272281
time_mentions,
@@ -315,7 +324,10 @@ def show_about(self) -> None:
315324
def show_user_info(self, user_id: int) -> None:
316325
self.show_pop_up(
317326
UserInfoView(
318-
self, user_id, "User Information (up/down scrolls)", "USER_INFO"
327+
self,
328+
user_id,
329+
f"User Information {SCROLL_PROMPT}",
330+
"USER_INFO",
319331
),
320332
"area:user",
321333
)
@@ -325,7 +337,7 @@ def show_msg_sender_info(self, user_id: int) -> None:
325337
UserInfoView(
326338
self,
327339
user_id,
328-
"Message Sender Information (up/down scrolls)",
340+
f"Message Sender Information {SCROLL_PROMPT}",
329341
"MSG_SENDER_INFO",
330342
),
331343
"area:user",
@@ -345,7 +357,7 @@ def show_full_rendered_message(
345357
topic_links,
346358
message_links,
347359
time_mentions,
348-
"Full rendered message (up/down scrolls)",
360+
f"Full rendered message {SCROLL_PROMPT}",
349361
),
350362
"area:msg",
351363
)
@@ -364,7 +376,7 @@ def show_full_raw_message(
364376
topic_links,
365377
message_links,
366378
time_mentions,
367-
"Full raw message (up/down scrolls)",
379+
f"Full raw message {SCROLL_PROMPT}",
368380
),
369381
"area:msg",
370382
)
@@ -383,7 +395,7 @@ def show_edit_history(
383395
topic_links,
384396
message_links,
385397
time_mentions,
386-
"Edit History (up/down scrolls)",
398+
f"Edit History {SCROLL_PROMPT}",
387399
),
388400
"area:msg",
389401
)

0 commit comments

Comments
 (0)