diff --git a/app/javascript/mastodon/components/hotkeys/hotkeys.stories.tsx b/app/javascript/mastodon/components/hotkeys/hotkeys.stories.tsx index 9baef18668..43002013a3 100644 --- a/app/javascript/mastodon/components/hotkeys/hotkeys.stories.tsx +++ b/app/javascript/mastodon/components/hotkeys/hotkeys.stories.tsx @@ -50,6 +50,9 @@ const hotkeyTest: Story['play'] = async ({ canvas, userEvent }) => { await userEvent.keyboard('gh'); await confirmHotkey('goToHome'); + await userEvent.keyboard('ge'); + await confirmHotkey('goToExplore'); + await userEvent.keyboard('gn'); await confirmHotkey('goToNotifications'); @@ -106,6 +109,9 @@ export const Default = { goToHome: () => { setMatchedHotkey('goToHome'); }, + goToExplore: () => { + setMatchedHotkey('goToExplore'); + }, goToNotifications: () => { setMatchedHotkey('goToNotifications'); }, diff --git a/app/javascript/mastodon/components/hotkeys/index.tsx b/app/javascript/mastodon/components/hotkeys/index.tsx index c62fc0c20a..751ec01fe5 100644 --- a/app/javascript/mastodon/components/hotkeys/index.tsx +++ b/app/javascript/mastodon/components/hotkeys/index.tsx @@ -118,6 +118,7 @@ const hotkeyMatcherMap = { openMedia: just('e'), onTranslate: just('t'), goToHome: sequence('g', 'h'), + goToExplore: sequence('g', 'e'), goToNotifications: sequence('g', 'n'), goToLocal: sequence('g', 'l'), goToFederated: sequence('g', 't'), diff --git a/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx b/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx index 8a6ebe6def..d2b041ec3f 100644 --- a/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx +++ b/app/javascript/mastodon/features/keyboard_shortcuts/index.jsx @@ -134,6 +134,10 @@ class KeyboardShortcuts extends ImmutablePureComponent { g+h + + g+e + + g+n diff --git a/app/javascript/mastodon/features/ui/index.jsx b/app/javascript/mastodon/features/ui/index.jsx index 17822929a7..d40891ef62 100644 --- a/app/javascript/mastodon/features/ui/index.jsx +++ b/app/javascript/mastodon/features/ui/index.jsx @@ -534,6 +534,10 @@ class UI extends PureComponent { this.props.history.push('/home'); }; + handleHotkeyGoToExplore = () => { + this.props.history.push('/explore'); + }; + handleHotkeyGoToNotifications = () => { this.props.history.push('/notifications'); }; @@ -595,6 +599,7 @@ class UI extends PureComponent { moveToTop: this.handleMoveToTop, back: this.handleHotkeyBack, goToHome: this.handleHotkeyGoToHome, + goToExplore: this.handleHotkeyGoToExplore, goToNotifications: this.handleHotkeyGoToNotifications, goToLocal: this.handleHotkeyGoToLocal, goToFederated: this.handleHotkeyGoToFederated, diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 03b7a5d2c4..e7a346a38f 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -682,6 +682,7 @@ "keyboard_shortcuts.direct": "Open private mentions column", "keyboard_shortcuts.down": "Move down in the list", "keyboard_shortcuts.enter": "Open post", + "keyboard_shortcuts.explore": "Open trending timeline", "keyboard_shortcuts.favourite": "Favorite post", "keyboard_shortcuts.favourites": "Open favorites list", "keyboard_shortcuts.federated": "Open federated timeline",