diff --git a/frontend_tests/node_tests/hotkey.js b/frontend_tests/node_tests/hotkey.js index d6eb7a1f14..82789971da 100644 --- a/frontend_tests/node_tests/hotkey.js +++ b/frontend_tests/node_tests/hotkey.js @@ -140,7 +140,7 @@ function stubbing(func_name_to_stub, test_function) { // Unmapped keys should immediately return false, without // calling any functions outside of hotkey.js. assert_unmapped('abdefhlmnoptuxyz'); - assert_unmapped('BEFGHILMNOQTUVWXYZ'); + assert_unmapped('BEFHILMNOQTUVWXYZ'); // We have to skip some checks due to the way the code is // currently organized for mapped keys. @@ -209,6 +209,7 @@ function stubbing(func_name_to_stub, test_function) { assert_mapping('v', 'lightbox.show_from_selected_message'); assert_mapping('i', 'popovers.open_message_menu'); assert_mapping(':', 'popovers.toggle_reactions_popover', true); + assert_mapping('G', 'navigate.to_end'); }()); (function test_motion_keys() { diff --git a/static/js/hotkey.js b/static/js/hotkey.js index bedf8453a3..48dbc252ac 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -100,6 +100,7 @@ var keypress_mappings = { 65: {name: 'stream_cycle_backward', message_view_only: true}, // 'A' 67: {name: 'compose_private_message', message_view_only: true}, // 'C' 68: {name: 'stream_cycle_forward', message_view_only: true}, // 'D' + 71: {name: 'G_end', message_view_only: true}, // 'G' 74: {name: 'vim_page_down', message_view_only: true}, // 'J' 75: {name: 'vim_page_up', message_view_only: true}, // 'K' 80: {name: 'narrow_private', message_view_only: true}, // 'P' @@ -594,6 +595,7 @@ exports.process_hotkey = function (e, hotkey) { navigate.to_home(); return true; case 'end': + case 'G_end': navigate.to_end(); return true; case 'page_up': diff --git a/templates/zerver/help/keyboard-shortcuts.md b/templates/zerver/help/keyboard-shortcuts.md index 07784a9d2e..d1a06027bc 100644 --- a/templates/zerver/help/keyboard-shortcuts.md +++ b/templates/zerver/help/keyboard-shortcuts.md @@ -34,7 +34,7 @@ Zulip keyboard shortcuts are divided into four categories: * **Scroll down**: `J`, `Spacebar`, or `PgDn` (`Fn` + `↓` on Mac) - This shortcut allows the user to scroll down through the messages in their view. -* **Last message**: `End` (`Fn`+`⇾` on Mac) - This shortcut +* **Last message**: `End` (`Fn`+`⇾` on Mac) or `G` - This shortcut allows the user to scroll to the most recent message in their view. * **First message in view**: `Home` (`Fn`+`⇽` on Mac) - This shortcut allows the user to scroll to the most recent message in their view. diff --git a/templates/zerver/keyboard_shortcuts.html b/templates/zerver/keyboard_shortcuts.html index 397ff01a23..92f28dd22e 100644 --- a/templates/zerver/keyboard_shortcuts.html +++ b/templates/zerver/keyboard_shortcuts.html @@ -37,7 +37,7 @@ {% trans %}Scroll down{% endtrans %} - End + End, G {% trans %}Last message{% endtrans %}