keyboard-shortcuts: Document browse back and forward in history.

Documents in help center `/keyboard-shortcuts` and in the app `?`
menu the shortcuts used by browsers for navigating back and forward
through the open tab's history, which are made to work in Zulip.

Also, updates `adjust_mac_shortcuts` to update the shortcut keys
for users with Mac user agents.

Fixes #18542.
This commit is contained in:
Lauryn Menard
2022-07-13 12:28:12 +02:00
committed by Tim Abbott
parent 5bcf78e0cb
commit f03eed5231
4 changed files with 15 additions and 0 deletions

View File

@@ -100,6 +100,7 @@ run_test("adjust_mac_shortcuts mac non-defaults", ({override}) => {
["PgUp", "↑"], ["PgUp", "↑"],
["PgDn", "↓"], ["PgDn", "↓"],
["Ctrl", "⌘"], ["Ctrl", "⌘"],
["Alt", "⌘"],
["X + Shift", "X + Shift"], ["X + Shift", "X + Shift"],
["⌘ + Return", "⌘ + Return"], ["⌘ + Return", "⌘ + Return"],
["Enter or Backspace", "Enter or Backspace"], ["Enter or Backspace", "Enter or Backspace"],
@@ -157,6 +158,7 @@ run_test("adjust_mac_shortcuts mac defaults", ({override}) => {
["PgUp", "↑"], ["PgUp", "↑"],
["PgDn", "↓"], ["PgDn", "↓"],
["Ctrl", "⌘"], ["Ctrl", "⌘"],
["Alt", "⌘"],
["[", "["], ["[", "["],
["X", "X"], ["X", "X"],
]); ]);

View File

@@ -61,6 +61,7 @@ export function adjust_mac_shortcuts(key_elem_class: string, kbd_elem = true): v
["PgUp", "↑"], ["PgUp", "↑"],
["PgDn", "↓"], ["PgDn", "↓"],
["Ctrl", "⌘"], ["Ctrl", "⌘"],
["Alt", "⌘"],
]); ]);
const fn_shortcuts = new Set(["Home", "End", "PgUp", "PgDn"]); const fn_shortcuts = new Set(["Home", "End", "PgUp", "PgDn"]);

View File

@@ -101,6 +101,14 @@
<td class="definition">{{t 'First message' }}</td> <td class="definition">{{t 'First message' }}</td>
<td><span class="hotkey"><kbd>Home</kbd></span></td> <td><span class="hotkey"><kbd>Home</kbd></span></td>
</tr> </tr>
<tr>
<td class="definition">{{t 'Go back through viewing history' }}</td>
<td><span class="hotkey"><kbd>Alt</kbd> + <kbd class="arrow-key">←</kbd></span></td>
</tr>
<tr>
<td class="definition">{{t 'Go forward through viewing history' }}</td>
<td><span class="hotkey"><kbd>Alt</kbd> + <kbd class="arrow-key">→</kbd></span></td>
</tr>
</table> </table>
</div> </div>
<div> <div>

View File

@@ -67,6 +67,10 @@ below, and add more to your repertoire as needed.
* **Scroll down**: `PgDn`, `J`, or `Spacebar` * **Scroll down**: `PgDn`, `J`, or `Spacebar`
* **Go back through viewing history**: `Alt` + `←`
* **Go forward through viewing history**: `Alt` + `→`
## Narrowing ## Narrowing
* **Narrow to next unread topic**: `n` * **Narrow to next unread topic**: `n`