From d6a2bbc2efb129306258d8c60f19e86e5eeab8af Mon Sep 17 00:00:00 2001 From: Pratik Chanda Date: Sat, 25 Nov 2023 03:57:05 +0530 Subject: [PATCH] keyboard_shortcut: Add feedback for N/P shortcut after no more message. Earlier navigating to the next unread topic or DM with N / P and reaching last unread topic or dm, nothing happened when shortcut was pressed again. This commit changes the behaviour when shortcut reaches the last topic or dm and pressed again. Now it notifies the user that there are no more unread messages. Fixes zulip#27862. --- web/src/narrow.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/src/narrow.js b/web/src/narrow.js index 83938ff143..ed7cc9a36a 100644 --- a/web/src/narrow.js +++ b/web/src/narrow.js @@ -815,6 +815,12 @@ export function narrow_to_next_topic(opts = {}) { } if (!next_narrow) { + feedback_widget.show({ + populate($container) { + $container.text($t({defaultMessage: "You have no more unread topics."})); + }, + title_text: $t({defaultMessage: "You're done!"}), + }); return; } @@ -832,6 +838,12 @@ export function narrow_to_next_pm_string(opts = {}) { const next_direct_message = topic_generator.get_next_unread_pm_string(current_direct_message); if (!next_direct_message) { + feedback_widget.show({ + populate($container) { + $container.text($t({defaultMessage: "You have no more unread direct messages."})); + }, + title_text: $t({defaultMessage: "You're done!"}), + }); return; }