mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Add g+e keyboard shortcut for /explore (trending) (#38014)
This commit is contained in:
committed by
GitHub
parent
f953d40289
commit
87004ddb96
@@ -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');
|
||||
},
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -134,6 +134,10 @@ class KeyboardShortcuts extends ImmutablePureComponent {
|
||||
<td><kbd>g</kbd>+<kbd>h</kbd></td>
|
||||
<td><FormattedMessage id='keyboard_shortcuts.home' defaultMessage='to open home timeline' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><kbd>g</kbd>+<kbd>e</kbd></td>
|
||||
<td><FormattedMessage id='keyboard_shortcuts.explore' defaultMessage='to open trending timeline' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><kbd>g</kbd>+<kbd>n</kbd></td>
|
||||
<td><FormattedMessage id='keyboard_shortcuts.notifications' defaultMessage='to open notifications column' /></td>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user